diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index 27fd1691c8ee62058d15c0c97c00ab664fbb265a..9f98ca3172d7c9588605a5d5115aebe4db45f114 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
var
g_holmes_enabled: Boolean = {$IF DEFINED(D2F_DEBUG)}true{$ELSE}false{$ENDIF};
+ g_holmes_ui_scale: Single = 1.0;
implementation
msY: Integer = -666;
msB: Word = 0; // button state
kbS: Word = 0; // keyboard modifiers state
- showGrid: Boolean = true;
+ showGrid: Boolean = false;
showMonsInfo: Boolean = false;
showMonsLOS2Plr: Boolean = false;
showAllMonsCells: Boolean = false;
showMapCurPos: Boolean = false;
showLayersWindow: Boolean = false;
showOutlineWindow: Boolean = false;
- showTriggers: Boolean = {$IF DEFINED(D2F_DEBUG)}true{$ELSE}false{$ENDIF};
+ showTriggers: Boolean = {$IF DEFINED(D2F_DEBUG)}false{$ELSE}false{$ENDIF};
// ////////////////////////////////////////////////////////////////////////// //
{$INCLUDE g_holmes.inc}
TRIGGER_TEXTURE: begin end;
TRIGGER_ON, TRIGGER_OFF, TRIGGER_ONOFF, TRIGGER_PRESS:
begin
- fillRect(
- trig.trigData.trigTX, trig.trigData.trigTY,
- trig.trigData.trigTWidth, trig.trigData.trigTHeight,
- 0, 255, 255, 42);
- drawLine(
- trig.trigCenter.x, trig.trigCenter.y,
- trig.trigData.trigTX+trig.trigData.trigTWidth div 2,
- trig.trigData.trigTY+trig.trigData.trigTHeight div 2,
- 255, 0, 255, 220);
+ if (trig.trigData.trigTWidth > 0) and (trig.trigData.trigTHeight > 0) then
+ begin
+ fillRect(
+ trig.trigData.trigTX, trig.trigData.trigTY,
+ trig.trigData.trigTWidth, trig.trigData.trigTHeight,
+ 0, 255, 255, 42);
+ drawLine(
+ trig.trigCenter.x, trig.trigCenter.y,
+ trig.trigData.trigTX+trig.trigData.trigTWidth div 2,
+ trig.trigData.trigTY+trig.trigData.trigTHeight div 2,
+ 255, 0, 255, 220);
+ end;
end;
TRIGGER_SOUND: begin end;
TRIGGER_SPAWNMONSTER: begin end;
// ////////////////////////////////////////////////////////////////////////// //
function g_Holmes_MouseEvent (var ev: THMouseEvent): Boolean;
+var
+ he: THMouseEvent;
begin
holmesInitCommands();
holmesInitBinds();
result := true;
- msX := ev.x;
- msY := ev.y;
+ msX := trunc(ev.x/g_holmes_ui_scale);
+ msY := trunc(ev.y/g_holmes_ui_scale);
msB := ev.bstate;
kbS := ev.kstate;
msB := msB;
- if not uiMouseEvent(ev) then plrDebugMouse(ev);
+ he := ev;
+ he.x := trunc(he.x/g_holmes_ui_scale);
+ he.y := trunc(he.y/g_holmes_ui_scale);
+ if not uiMouseEvent(he) then plrDebugMouse(he);
end;
procedure g_Holmes_DrawUI ();
begin
{$IF not DEFINED(HEADLESS)}
+ glPushMatrix();
+ glScalef(g_holmes_ui_scale, g_holmes_ui_scale, 1.0);
uiDraw();
drawCursor();
+ glPopMatrix();
{$ENDIF}
end;
end;
+begin
+ conRegVar('hlm_ui_scale', @g_holmes_ui_scale, 0.01, 5.0, 'Holmes UI scale', '', false);
end.