DEADSOFTWARE

Console: Fix copypasta
[d2df-sdl.git] / src / game / g_console.pas
index 33bfcf7dafedefaef8e4b74a39c8d07e746f151d..fd7c36612ffca0daf6f7ad87daf7ba292502ae6c 100644 (file)
@@ -243,24 +243,6 @@ end;
 
 
 procedure intVarHandler (me: PCommand; p: SSArray);
-  procedure binaryFlag (var flag: Boolean; msg: AnsiString);
-  begin
-    if (Length(p) > 2) then
-    begin
-      conwritefln('too many arguments to ''%s''', [p[0]]);
-    end
-    else
-    begin
-      case conGetBoolArg(p, 1) of
-        -1: begin end;
-         0: if not me.cheat or conIsCheatsEnabled then flag := false else begin conwriteln('not available'); exit; end;
-         1: if not me.cheat or conIsCheatsEnabled then flag := true else begin conwriteln('not available'); exit; end;
-         666: if not me.cheat or conIsCheatsEnabled then flag := not flag else begin conwriteln('not available'); exit; end;
-      end;
-      if (Length(msg) = 0) then msg := p[0] else msg += ':';
-      if flag then conwritefln('%s tan', [msg]) else conwritefln('%s ona', [msg]);
-    end;
-  end;
 begin
   if (Length(p) <> 2) then
   begin
@@ -719,13 +701,15 @@ begin
     end;
   'togglechat':
     begin
-      g_Console_Chat_Switch;
+      if not gConsoleShow and (g_ActiveWindow = nil) then
+        g_Console_Chat_Switch;
       gSkipFirstChar := not g_Console_Interactive()
     end;
   'toggleteamchat':
     if gGameSettings.GameMode in [GM_TDM, GM_CTF] then
     begin
-      g_Console_Chat_Switch(True);
+      if not gConsoleShow and (g_ActiveWindow = nil) then
+        g_Console_Chat_Switch(True);
       gSkipFirstChar := not g_Console_Interactive()
     end;
   end
@@ -849,7 +833,6 @@ begin
   AddCommand('p2_name', GameCVars);
   AddCommand('p1_color', GameCVars);
   AddCommand('p2_color', GameCVars);
-  AddCommand('r_showtime', GameCVars);
   AddCommand('r_showscore', GameCVars);
   AddCommand('r_showlives', GameCVars);
   AddCommand('r_showstat', GameCVars);
@@ -1730,8 +1713,11 @@ begin
   if (not g_GUIGrabInput) and (key >= 0) and (key < e_MaxInputKeys) and ((gInputBinds[key].down <> nil) or (gInputBinds[key].up <> nil)) then
   begin
     if down then
-      for i := 0 to High(gInputBinds[key].down) do
-        g_Console_Process(gInputBinds[key].down[i], True)
+    begin
+      if not gChatShow then
+        for i := 0 to High(gInputBinds[key].down) do
+          g_Console_Process(gInputBinds[key].down[i], True);
+    end
     else
       for i := 0 to High(gInputBinds[key].up) do
         g_Console_Process(gInputBinds[key].up[i], True)