DEADSOFTWARE

Holmes UI is more important than console! ;-)
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Sun, 27 Aug 2017 14:55:00 +0000 (17:55 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Sun, 27 Aug 2017 15:12:19 +0000 (18:12 +0300)
src/game/g_game.pas
src/game/g_holmes.pas
src/game/g_holmes_ui.inc

index f5b1903db7cde1fe171408dd13c7052329becc36..844e9a4554a02fcf4f9650a6fb2b230658e53d5d 100644 (file)
@@ -3337,6 +3337,8 @@ begin
     drawTime(gScreenWidth-72, gScreenHeight-16);
 
   if gGameOn then drawProfilers();
+
+  g_Holmes_DrawUI();
 end;
 
 procedure g_Game_Quit();
index 7f2ddb09168f53ba9e88a7f3d0d66828a7db60bc..98c458c7619d1e33d06c594789aa10ae4f25db73 100644 (file)
@@ -76,6 +76,7 @@ procedure g_Holmes_WindowFocused ();
 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
@@ -116,6 +117,7 @@ var
 
 // ////////////////////////////////////////////////////////////////////////// //
 var
+  g_ol_nice: Boolean = false;
   g_ol_rlayer_back: Boolean = false;
   g_ol_rlayer_step: Boolean = false;
   g_ol_rlayer_wall: Boolean = false;
@@ -181,6 +183,8 @@ begin
   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);
@@ -686,11 +690,14 @@ begin
     plrDebugDraw();
   end;
 
-  uiDraw();
+  laserSet := false;
+end;
 
-  drawCursor();
 
-  laserSet := false;
+procedure g_Holmes_DrawUI ();
+begin
+  uiDraw();
+  drawCursor();
 end;
 
 
index 3f26b360c8e770e30c6592c38f0e0c64780d6543..cc5fe2f81de41d70337bafc18d1c4b9271891f25 100644 (file)
@@ -898,14 +898,36 @@ begin
       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: