summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9849224)
raw | patch | inline | side by side (parent: 9849224)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 27 Aug 2017 16:11:04 +0000 (19:11 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 27 Aug 2017 16:11:11 +0000 (19:11 +0300) |
src/game/g_holmes.pas | patch | blob | history | |
src/game/g_holmes_ui.inc | patch | blob | history |
diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index 9ab1c77752b25fafac2af63419a867e1df3d4980..1f68911b260c4c44994f6b1b982779dcec03a057 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
showMonsLOS2Plr: Boolean = false;
showAllMonsCells: Boolean = false;
showMapCurPos: Boolean = false;
-
+ showLayersWindow: Boolean = false;
+ showOutlineWindow: Boolean = false;
+ oldShowLayersWindow: Boolean = false;
+ oldShowOutlineWindow: Boolean = false;
// ////////////////////////////////////////////////////////////////////////// //
{$INCLUDE g_holmes.inc}
llb.appendItem('monster info', @showMonsInfo);
llb.appendItem('monster LOS to player', @showMonsLOS2Plr);
llb.appendItem('monster cells (SLOW!)', @showAllMonsCells);
+ llb.appendItem('', nil);
+ llb.appendItem('layers window', @showLayersWindow);
+ llb.appendItem('outline window', @showOutlineWindow);
winOptions := THTopWindow.Create('Holmes Options', 100, 100);
winOptions.escClose := true;
winOptions.appendChild(llb);
// ////////////////////////////////////////////////////////////////////////// //
procedure g_Holmes_VidModeChanged ();
begin
- e_WriteLog(Format('Inspector: videomode changed: %dx%d', [gScreenWidth, gScreenHeight]), MSG_NOTIFY);
+ e_WriteLog(Format('Holmes: videomode changed: %dx%d', [gScreenWidth, gScreenHeight]), MSG_NOTIFY);
// texture space is possibly lost here, idc
curtexid := 0;
font6texid := 0;
if (ev.scan = SDL_SCANCODE_L) and ((ev.kstate and THKeyEvent.ModCtrl) <> 0) then
begin
result := true;
- if (winLayers = nil) then createLayersWindow();
- if not uiVisibleWindow(winLayers) then uiAddWindow(winLayers) else uiRemoveWindow(winLayers);
+ showLayersWindow := not showLayersWindow;
exit;
end;
// C-O: toggle outlines window
if (ev.scan = SDL_SCANCODE_O) and ((ev.kstate and THKeyEvent.ModCtrl) <> 0) then
begin
result := true;
- if (winOutlines = nil) then createOutlinesWindow();
- if not uiVisibleWindow(winOutlines) then uiAddWindow(winOutlines) else uiRemoveWindow(winOutlines);
+ showOutlineWindow := not showOutlineWindow;
exit;
end;
// F1: toggle options window
// ////////////////////////////////////////////////////////////////////////// //
procedure g_Holmes_Draw ();
begin
+ if (oldShowLayersWindow <> showLayersWindow) then
+ begin
+ oldShowLayersWindow := showLayersWindow;
+ if showLayersWindow then
+ begin
+ if (winLayers = nil) then createLayersWindow();
+ uiAddWindow(winLayers);
+ end
+ else
+ begin
+ uiRemoveWindow(winLayers);
+ end;
+ end
+ else
+ begin
+ showLayersWindow := uiVisibleWindow(winLayers);
+ oldShowLayersWindow := showLayersWindow;
+ end;
+
+ if (oldShowOutlineWindow <> showOutlineWindow) then
+ begin
+ oldShowOutlineWindow := showOutlineWindow;
+ if showOutlineWindow then
+ begin
+ if (winOutlines = nil) then createOutlinesWindow();
+ uiAddWindow(winOutlines);
+ end
+ else
+ begin
+ uiRemoveWindow(winOutlines);
+ end;
+ end
+ else
+ begin
+ showOutlineWindow := uiVisibleWindow(winOutlines);
+ oldShowOutlineWindow := showOutlineWindow;
+ end;
+
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); // modify color buffer
glDisable(GL_STENCIL_TEST);
glDisable(GL_BLEND);
index 5175e95155a8663bf3a450283ff8015500202c48..4f372842ff369a7c8a598207b044152c1299188e 100644 (file)
--- a/src/game/g_holmes_ui.inc
+++ b/src/game/g_holmes_ui.inc
procedure uiDraw ();
var
f: Integer;
+ ctl: THControl;
begin
- for f := 0 to High(uiTopList) do uiTopList[f].draw();
+ for f := 0 to High(uiTopList) do
+ begin
+ ctl := uiTopList[f];
+ ctl.draw();
+ if (f <> High(uiTopList)) then darkenRect(ctl.x0, ctl.y0, ctl.width, ctl.height, 128);
+ end;
end;
var
r, g, b: Integer;
begin
+ {
if getFocused then
begin
r := 255;
g := 127;
b := 127;
end;
+ }
+ r := 255;
+ g := 255;
+ b := 255;
drawRect(mX, mY, mWidth, mHeight, r, g, b);
if (Length(mTitle) > 0) then
begin
SetLength(mChecks, Length(mChecks)+1);
mChecks[High(mChecks)] := bv;
if (Length(mItems)*8+4 > mHeight) then mHeight := Length(mItems)*8+4;
+ if (mCurIndex < 0) then mCurIndex := 0;
end;