DEADSOFTWARE

fixed cheats and YN prompts
authorFGSFDSFGS <derp.primus@gmail.com>
Wed, 6 Apr 2016 12:52:06 +0000 (15:52 +0300)
committerFGSFDSFGS <derp.primus@gmail.com>
Wed, 6 Apr 2016 18:42:31 +0000 (21:42 +0300)
src/engine/e_input.pas
src/game/g_main.pas
src/game/g_menu.pas

index 818fe8b952685c1aaf3ae18422f1bb1b31df3aad..618199d2bb1837bf1b404c20a401fb64dc40ff2c 100644 (file)
@@ -54,6 +54,8 @@ const
   IK_BACKQUOTE = SDL_SCANCODE_GRAVE;
   IK_GRAVE     = SDL_SCANCODE_GRAVE;
   IK_PAUSE   = SDL_SCANCODE_PAUSE;
+  IK_Y       = SDL_SCANCODE_Y;
+  IK_N       = SDL_SCANCODE_N;
   // TODO: think of something better than this shit
   IK_LASTKEY = SDL_NUM_SCANCODES-1;
 
index 8c43ef8472b6b45efc755df3ca17fd3a42408def..853693c582393d718417ec187fc94f346ec810ed 100644 (file)
@@ -381,7 +381,6 @@ end;
 procedure KeyPress(K: Word);
 var
   Msg: g_gui.TMessage;
-  a: Integer;
 begin
   case K of
     IK_PAUSE: // <Pause/Break>:
@@ -483,13 +482,6 @@ begin
             begin
               g_GUI_ShowWindow('MainMenu');
               g_Sound_PlayEx('MENU_OPEN');
-            end
-            else
-            begin
-              for a := 0 to 14 do
-                charbuff[a] := charbuff[a+1];
-              charbuff[15] := UpCase(Chr(K));
-              Cheat();
             end;
           end;
       end;
@@ -499,6 +491,7 @@ end;
 procedure CharPress(C: Char);
 var
   Msg: g_gui.TMessage;
+  a: Integer;
 begin
   if (not gChatShow) and ((C = '`') or (C = '~') or (C = '¸') or (C = '¨')) then
     Exit;
@@ -511,6 +504,13 @@ begin
       Msg.Msg := WM_CHAR;
       Msg.WParam := Ord(C);
       g_ActiveWindow.OnMessage(Msg);
+    end
+    else
+    begin
+      for a := 0 to 14 do
+        charbuff[a] := charbuff[a+1];
+      charbuff[15] := UpCase(C);
+      Cheat();
     end;
 end;
 
index 21eba04fdf38c99bc261d872b2bcc502e9969b91..231737bb1db45fba057737caf4bf4feee5a3cdfd 100644 (file)
@@ -889,7 +889,7 @@ var
   snd: TPlayableSound;
   res: Boolean;
 begin
-  if Key = Ord('y') then
+  if Key = IK_Y then
   begin
     g_Game_StopAllSounds(True);
     case (Random(18)) of
@@ -927,7 +927,7 @@ begin
     g_Game_Quit();
   end
     else
-      if Key = Ord('n') then
+      if Key = IK_N then
         g_GUI_HideWindow();
 end;