summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f7bae4e)
raw | patch | inline | side by side (parent: f7bae4e)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 17 Aug 2019 18:56:20 +0000 (21:56 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 17 Aug 2019 18:56:20 +0000 (21:56 +0300) |
src/game/g_console.pas | patch | blob | history |
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 033a46827d5a3312a6b062fa335d37446edc5038..8b25d01e0903c6313fffdca6f7a2d6af9a2f8f7e 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
procedure g_Console_Switch;
begin
+ if gConsoleShow then
+ Cons_Y := Max(Cons_Y, -Floor(gScreenHeight * ConsoleHeight))
+ else
+ Cons_Y := Min(Cons_Y, -Floor(gScreenHeight * ConsoleHeight));
gChatShow := False;
gConsoleShow := not gConsoleShow;
Cons_Shown := True;
procedure g_Console_Chat_Switch (Team: Boolean = False);
begin
if not g_Game_IsNet then Exit;
+ if gConsoleShow then
+ Cons_Y := Max(Cons_Y, -Floor(gScreenHeight * ConsoleHeight))
+ else
+ Cons_Y := Min(Cons_Y, -Floor(gScreenHeight * ConsoleHeight));
gConsoleShow := False;
gChatShow := not gChatShow;
gChatTeam := Team;
'toggleconsole':
g_Console_Switch;
'togglechat':
- if not gConsoleShow and (g_ActiveWindow = nil) then
- g_Console_Chat_Switch;
+ g_Console_Chat_Switch;
'toggleteamchat':
if gGameSettings.GameMode in [GM_TDM, GM_CTF] then
- if not gConsoleShow and (g_ActiveWindow = nil) then
- g_Console_Chat_Switch(True);
+ g_Console_Chat_Switch(True);
end
end;
begin
if Cons_Shown then
begin
- (* Open animation *)
- if gConsoleShow and (Cons_Y < 0) then
- Cons_Y := Cons_Y+Step;
-
- (* Colse animation *)
- if (not gConsoleShow) and (Cons_Y > -Floor(gScreenHeight * ConsoleHeight)) then
- Cons_Y := Cons_Y-Step;
-
- if gChatShow then
- begin
- (* End open chat animation. Do not show console *)
- Cons_Y := -Floor(gScreenHeight * ConsoleHeight);
- Cons_Shown := False;
- InputReady := True;
- end
- else
- if Cons_Y >= 0 then
+ if gConsoleShow then
begin
- (* End open animation *)
- Cons_Y := 0;
- Cons_Shown := True;
- InputReady := True;
+ (* Open animation *)
+ Cons_Y := Min(Cons_Y + Step, 0);
+ if Cons_Y >= 0 then
+ InputReady := True
end
else
- if Cons_Y <= -Floor(gScreenHeight * ConsoleHeight) then
begin
- (* End close animation *)
- Cons_Y := -Floor(gScreenHeight * ConsoleHeight);
- Cons_Shown := False;
- InputReady := False;
+ (* Close animation *)
+ Cons_Y := Max(Cons_Y - Step, -Floor(gScreenHeight * ConsoleHeight));
+ if Cons_Y <= -Floor(gScreenHeight * ConsoleHeight) then
+ begin
+ Cons_Shown := False;
+ InputReady := False
+ end
end;
+
+ if gChatShow then
+ InputReady := True
end;
a := 0;