summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 293ea76)
raw | patch | inline | side by side (parent: 293ea76)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 27 Aug 2017 14:55:00 +0000 (17:55 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 27 Aug 2017 15:12:19 +0000 (18:12 +0300) |
src/game/g_game.pas | patch | blob | history | |
src/game/g_holmes.pas | patch | blob | history | |
src/game/g_holmes_ui.inc | patch | blob | history |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index f5b1903db7cde1fe171408dd13c7052329becc36..844e9a4554a02fcf4f9650a6fb2b230658e53d5d 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
drawTime(gScreenWidth-72, gScreenHeight-16);
if gGameOn then drawProfilers();
+
+ g_Holmes_DrawUI();
end;
procedure g_Game_Quit();
diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index 7f2ddb09168f53ba9e88a7f3d0d66828a7db60bc..98c458c7619d1e33d06c594789aa10ae4f25db73 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
procedure g_Holmes_WindowBlured ();
procedure g_Holmes_Draw ();
+procedure g_Holmes_DrawUI ();
function g_Holmes_MouseEvent (var ev: THMouseEvent): Boolean; // returns `true` if event was eaten
function g_Holmes_KeyEvent (var ev: THKeyEvent): Boolean; // returns `true` if event was eaten
// ////////////////////////////////////////////////////////////////////////// //
var
+ g_ol_nice: Boolean = false;
g_ol_rlayer_back: Boolean = false;
g_ol_rlayer_step: Boolean = false;
g_ol_rlayer_wall: Boolean = false;
llb.appendItem('acid2', @g_ol_rlayer_acid2);
llb.appendItem('water', @g_ol_rlayer_water);
llb.appendItem('foreground', @g_ol_rlayer_fore);
+ llb.appendItem('', nil);
+ llb.appendItem('slow''n''nice', @g_ol_nice);
winOutlines := THTopWindow.Create('outlines', 100, 10);
winOutlines.escClose := true;
winOutlines.appendChild(llb);
plrDebugDraw();
end;
- uiDraw();
+ laserSet := false;
+end;
- drawCursor();
- laserSet := false;
+procedure g_Holmes_DrawUI ();
+begin
+ uiDraw();
+ drawCursor();
end;
index 3f26b360c8e770e30c6592c38f0e0c64780d6543..cc5fe2f81de41d70337bafc18d1c4b9271891f25 100644 (file)
--- a/src/game/g_holmes_ui.inc
+++ b/src/game/g_holmes_ui.inc
SDL_SCANCODE_UP:
begin
result := true;
- if (mCurIndex < 0) then mCurIndex := Length(mItems)
- else if (mCurIndex > 0) then Dec(mCurIndex);
+ if (Length(mItems) > 0) then
+ begin
+ if (mCurIndex < 0) then mCurIndex := Length(mItems);
+ while (mCurIndex > 0) do
+ begin
+ Dec(mCurIndex);
+ if (mChecks[mCurIndex] <> nil) then break;
+ end;
+ end
+ else
+ begin
+ mCurIndex := -1;
+ end;
end;
SDL_SCANCODE_DOWN:
begin
result := true;
- if (mCurIndex < 0) then mCurIndex := 0
- else if (mCurIndex < High(mItems)) then Inc(mCurIndex);
+ if (Length(mItems) > 0) then
+ begin
+ if (mCurIndex < 0) then mCurIndex := -1;
+ while (mCurIndex < High(mItems)) do
+ begin
+ Inc(mCurIndex);
+ if (mChecks[mCurIndex] <> nil) then break;
+ end;
+ end
+ else
+ begin
+ mCurIndex := -1;
+ end;
end;
SDL_SCANCODE_SPACE,
SDL_SCANCODE_RETURN: