summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 30bcb89)
raw | patch | inline | side by side (parent: 30bcb89)
author | FGSFDSFGS <derp.primus@gmail.com> | |
Wed, 6 Apr 2016 12:52:06 +0000 (15:52 +0300) | ||
committer | FGSFDSFGS <derp.primus@gmail.com> | |
Wed, 6 Apr 2016 18:42:31 +0000 (21:42 +0300) |
src/engine/e_input.pas | patch | blob | history | |
src/game/g_main.pas | patch | blob | history | |
src/game/g_menu.pas | patch | blob | history |
diff --git a/src/engine/e_input.pas b/src/engine/e_input.pas
index 818fe8b952685c1aaf3ae18422f1bb1b31df3aad..618199d2bb1837bf1b404c20a401fb64dc40ff2c 100644 (file)
--- a/src/engine/e_input.pas
+++ b/src/engine/e_input.pas
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;
diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index 8c43ef8472b6b45efc755df3ca17fd3a42408def..853693c582393d718417ec187fc94f346ec810ed 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
procedure KeyPress(K: Word);
var
Msg: g_gui.TMessage;
- a: Integer;
begin
case K of
IK_PAUSE: // <Pause/Break>:
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;
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;
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;
diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index 21eba04fdf38c99bc261d872b2bcc502e9969b91..231737bb1db45fba057737caf4bf4feee5a3cdfd 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
snd: TPlayableSound;
res: Boolean;
begin
- if Key = Ord('y') then
+ if Key = IK_Y then
begin
g_Game_StopAllSounds(True);
case (Random(18)) of
g_Game_Quit();
end
else
- if Key = Ord('n') then
+ if Key = IK_N then
g_GUI_HideWindow();
end;