1 (* Copyright (C) DooM 2D:Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *)
16 {$INCLUDE ../shared/a_modes.inc}
19 interface
21 uses
22 e_log,
25 xprofiler;
28 type
30 public
31 const
32 // both for but and for bstate
39 // event types
44 public
54 public
55 const
56 // modifiers
61 // event types
65 public
80 function g_Holmes_mouseEvent (var ev: THMouseEvent): Boolean; // returns `true` if event was eaten
83 // hooks for player
88 var
92 implementation
94 uses
99 var
100 //globalInited: Boolean = false;
110 // ////////////////////////////////////////////////////////////////////////// //
111 {$INCLUDE g_holmes.inc}
113 // ////////////////////////////////////////////////////////////////////////// //
115 begin
116 e_WriteLog(Format('Inspector: videomode changed: %dx%d', [gScreenWidth, gScreenHeight]), MSG_NOTIFY);
117 // texture space is possibly lost here, idc
123 //createCursorTexture();
127 begin
133 begin
137 // ////////////////////////////////////////////////////////////////////////// //
138 var
147 begin
156 begin
173 begin
175 e_WriteLog(Format('wall #%d(%d); enabled=%d (%d)', [pan.arrIdx, pan.proxyId, Integer(pan.Enabled), Integer(mapGrid.proxyEnabled[pan.proxyId])]), MSG_NOTIFY);
180 begin
184 //if pan.Enabled then g_Map_DisableWall(pan.arrIdx) else g_Map_EnableWall(pan.arrIdx);
188 begin
190 e_WriteLog(Format('monster #%d (UID:%u) (proxyid:%d)', [mon.arrIdx, mon.UID, mon.proxyId]), MSG_NOTIFY);
193 begin
194 //e_WriteLog(Format('mouse: x=%d; y=%d; but=%d; bstate=%d', [msx, msy, but, bstate]), MSG_NOTIFY);
201 begin
203 begin
204 // dump monsters in cell
208 end
209 else
210 begin
211 // toggle wall
216 exit;
220 begin
225 exit;
233 var
235 begin
238 begin
241 begin
244 begin
245 //e_DrawQuad(x, y, x+mapGrid.tileSize-1, y+mapGrid.tileSize-1, 96, 96, 96, 96);
255 begin
260 begin
261 //e_WriteLog(Format('h1: (%d,%d)', [cx, cy]), MSG_NOTIFY);
266 begin
269 //e_WriteLog(Format('h1: (%d,%d)', [cx, cy]), MSG_NOTIFY);
274 var
277 begin
282 begin
288 var
292 var
297 begin
299 begin
302 end
304 begin
307 end
308 else
309 begin
310 exit;
314 if (g_Map_traceToNearestWall(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, @ex, @ey) <> nil) then
315 begin
321 var
325 begin
331 {$IF DEFINED(D2F_DEBUG)}
332 //mapGrid.dbgRayTraceTileHitCB := hilightCell1;
333 {$ENDIF}
334 if (g_Map_traceToNearestWall(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, @ex, @ey) <> nil) then
335 //if (mapGrid.traceRay(ex, ey, mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, hilightWallTrc, (GridTagWall or GridTagDoor)) <> nil) then
336 begin
339 {$IF DEFINED(D2F_DEBUG)}
340 //mapGrid.dbgRayTraceTileHitCB := nil;
341 {$ENDIF}
344 begin
347 //mx += mw div 2;
352 begin
353 //fillRect(mx-4, my-7*8-6, 110, 7*8+6, 0, 0, 94, 250);
358 // type
359 drawText6(mx, my, Format('%s(U:%u)', [monsTypeToString(mon.MonsterType), mon.UID]), 255, 127, 0); my -= 8;
360 // beh
361 drawText6(mx, my, Format('Beh: %s', [monsBehToString(mon.MonsterBehaviour)]), 255, 127, 0); my -= 8;
362 // state
363 drawText6(mx, my, Format('State:%s (%d)', [monsStateToString(mon.MonsterState), mon.MonsterSleep]), 255, 127, 0); my -= 8;
364 // health
366 // ammo
368 // target
375 {
376 property MonsterRemoved: Boolean read FRemoved write FRemoved;
377 property MonsterPain: Integer read FPain write FPain;
378 property MonsterAnim: Byte read FCurAnim write FCurAnim;
379 }
383 begin
388 var
391 begin
392 //e_DrawPoint(4, plrMouseX, plrMouseY, 255, 0, 255);
395 //e_WriteLog(Format('(%d,%d)-(%d,%d)', [laserX0, laserY0, laserX1, laserY1]), MSG_NOTIFY);
405 begin
408 begin
417 //e_DrawPoint(16, laserX0, laserY0, 255, 255, 255);
423 // ////////////////////////////////////////////////////////////////////////// //
425 begin
437 var
440 begin
450 // press
452 begin
453 // M-M: one monster think step
455 begin
459 exit;
461 // M-I: toggle monster info
463 begin
466 exit;
468 // M-L: toggle monster LOS to player
470 begin
473 exit;
475 // M-G: toggle "show all cells occupied by monsters"
477 begin
480 exit;
482 // M-A: wake up monster
484 begin
487 begin
491 exit;
493 // C-T: teleport player
495 begin
497 //e_WriteLog(Format('TELEPORT: (%d,%d)', [pmsCurMapX, pmsCurMapY]), MSG_NOTIFY);
499 begin
501 gPlayers[0].TeleportTo(pmsCurMapX-w div 2, pmsCurMapY-h div 2, true, 69); // 69: don't change dir
503 exit;
509 // ////////////////////////////////////////////////////////////////////////// //
511 begin
519 begin
523 //drawText6Prop(10, 10, 'Hi there, I''m Holmes!', 255, 255, 0);
524 //drawText8Prop(10, 20, 'Hi there, I''m Holmes!', 255, 255, 0);