DEADSOFTWARE

"yes/no" menu now accepts space as "y"
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Sun, 17 Apr 2016 04:54:07 +0000 (07:54 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Sun, 17 Apr 2016 04:55:06 +0000 (07:55 +0300)
src/game/g_menu.pas

index a3bf1ef5937613de1b959c5e5ac8cc1614b52ba2..015c1e2556f31c61b0905dc464af6633e45ee029 100644 (file)
@@ -39,9 +39,10 @@ type TYNCallback = procedure (yes:Boolean);
 procedure YNKeyDownProc (win: TGUIWindow; Key: Byte);
 begin
   if win.UserData = nil then exit;
-  //writeln('YNEX; key=', Key, '; ', (Key = ord('y')));
-       if Key = ord('y') then TYNCallback(win.UserData)(true)
-  else if Key = ord('n') then TYNCallback(win.UserData)(false);
+  case Key of
+    IK_Y, IK_SPACE: TYNCallback(win.UserData)(true);
+    IK_N: TYNCallback(win.UserData)(false);
+  end;
 end;
 
 function CreateYNMenu (Name, Text: String; MaxLen: Word; FontID: DWORD; ActionProc: TYNCallback): TGUIWindow;