From: Ketmar Dark Date: Sun, 17 Apr 2016 04:54:07 +0000 (+0300) Subject: "yes/no" menu now accepts space as "y" X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=commitdiff_plain;h=b8db17f63a79d8f79ddde6405fabbc9919f51678 "yes/no" menu now accepts space as "y" --- diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index a3bf1ef..015c1e2 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -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;