DEADSOFTWARE

fixed bug in grid update; one more mode for Holmes
[d2df-sdl.git] / src / game / g_holmes.pas
index 210368deda7b60c463d95b1acc1b13fe11395527..87788a4b03b6f2ac449ecf91a5de91ae524a6ea1 100644 (file)
@@ -104,6 +104,7 @@ var
   kbS: Word = 0; // keyboard modifiers state
   showMonsInfo: Boolean = false;
   showMonsLOS2Plr: Boolean = false;
+  showAllMonsCells: Boolean = false;
 
 
 // ////////////////////////////////////////////////////////////////////////// //
@@ -372,6 +373,12 @@ procedure plrDebugDraw ();
     }
   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;
@@ -399,6 +406,8 @@ begin
     end;
   end;
 
+  if showAllMonsCells then g_Mons_ForEach(highlightAllMonsterCells);
+
   //e_DrawPoint(16, laserX0, laserY0, 255, 255, 255);
 
   glPopMatrix();
@@ -453,6 +462,13 @@ begin
       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;
   end;
 end;