diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index 210368deda7b60c463d95b1acc1b13fe11395527..d7ab6bfec15ac5484115a67a40a23b0f22d30b24 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
kbS: Word = 0; // keyboard modifiers state
showMonsInfo: Boolean = false;
showMonsLOS2Plr: Boolean = false;
+ showAllMonsCells: Boolean = false;
// ////////////////////////////////////////////////////////////////////////// //
laserY0 := ay0;
laserX1 := ax1;
laserY1 := ay1;
+ laserSet := laserSet; // shut up, fpc!
end;
function wallToggle (pan: TPanel; tag: Integer): Boolean;
begin
result := false; // don't stop
+ e_WriteLog(Format('wall #%d(%d); enabled=%d (%d)', [pan.arrIdx, pan.proxyId, Integer(pan.Enabled), Integer(mapGrid.proxyEnabled[pan.proxyId])]), MSG_NOTIFY);
if pan.Enabled then g_Map_DisableWall(pan.arrIdx) else g_Map_EnableWall(pan.arrIdx);
end;
begin
//e_WriteLog(Format('mouse: x=%d; y=%d; but=%d; bstate=%d', [msx, msy, but, bstate]), MSG_NOTIFY);
- if (gPlayer1 = nil) then exit;
+ if (gPlayer1 = nil) or not vpSet then exit;
if (ev.kind <> THMouseEvent.Press) then exit;
+ e_WriteLog(Format('mev: %d', [Integer(ev.kind)]), MSG_NOTIFY);
+
if (ev.but = THMouseEvent.Left) then
begin
if ((kbS and THKeyEvent.ModShift) <> 0) then
else
begin
// toggle wall
+ e_WriteLog('=== TOGGLE WALL ===', MSG_NOTIFY);
mapGrid.forEachAtPoint(pmsCurMapX, pmsCurMapY, wallToggle, (GridTagWall or GridTagDoor));
+ e_WriteLog('--- toggle wall ---', MSG_NOTIFY);
end;
exit;
end;
}
end;
+ function highlightAllMonsterCells (mon: TMonster): Boolean;
+ begin
+ result := false; // don't stop
+ monsGrid.forEachBodyCell(mon.proxyId, hilightCell);
+ end;
+
var
mon: TMonster;
mx, my, mw, mh: Integer;
end;
end;
+ if showAllMonsCells then g_Mons_ForEach(highlightAllMonsterCells);
+
//e_DrawPoint(16, laserX0, laserY0, 255, 255, 255);
glPopMatrix();
msY := ev.y;
msB := ev.bstate;
kbS := ev.kstate;
+ msB := msB;
plrDebugMouse(ev);
end;
function g_Holmes_KeyEvent (var ev: THKeyEvent): Boolean;
+var
+ mon: TMonster;
begin
result := false;
msB := ev.bstate;
showMonsLOS2Plr := not showMonsLOS2Plr;
exit;
end;
+ // M-G: toggle "show all cells occupied by monsters"
+ if (ev.scan = SDL_SCANCODE_G) and ((ev.kstate and THKeyEvent.ModAlt) <> 0) then
+ begin
+ result := true;
+ showAllMonsCells := not showAllMonsCells;
+ exit;
+ end;
+ // M-A: wake up monster
+ if (ev.scan = SDL_SCANCODE_A) and ((ev.kstate and THKeyEvent.ModAlt) <> 0) then
+ begin
+ result := true;
+ if (monMarkedUID <> -1) then
+ begin
+ mon := g_Monsters_ByUID(monMarkedUID);
+ if (mon <> nil) then mon.WakeUp();
+ end;
+ exit;
+ end;
end;
end;
//drawText8Prop(10, 20, 'Hi there, I''m Holmes!', 255, 255, 0);
drawCursor();
+
+ laserSet := false;
end;