X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_console.pas;h=2105faf013636025b9175cf27828dcc645462115;hb=f4de88f1f4384cc3c798bccc695d92ad3781eb7b;hp=35f86b6ec63b27cdc9408d4e36bd84416cc111c2;hpb=bbbeedfda9dba4529b0a7eac50ebbdb20cfbedb0;p=d2df-sdl.git diff --git a/src/game/g_console.pas b/src/game/g_console.pas index 35f86b6..2105faf 100644 --- a/src/game/g_console.pas +++ b/src/game/g_console.pas @@ -78,7 +78,7 @@ var gChatTeam: Boolean = false; gAllowConsoleMessages: Boolean = true; gJustChatted: Boolean = false; // ÷òîáû àäìèí â èíòåðå ÷àòÿñü íå ïðîìàòûâàë ñòàòèñòèêó - gParsingBinds: Boolean = false; // íå ïåðåñîõðàíÿòü êîíôèã âî âðåìÿ ïàðñèíãà + gParsingBinds: Boolean = true; // íå ïåðåñîõðàíÿòü êîíôèã âî âðåìÿ ïàðñèíãà gPlayerAction: Array [0..1, 0..LAST_ACTION] of Boolean; // [player, action] implementation @@ -146,7 +146,6 @@ var down, up: SSArray; end; menu_toggled: BOOLEAN; (* hack for menu controls *) - gSkipFirstChar: Boolean; (* hack for console/chat input *) procedure g_Console_Switch; @@ -718,23 +717,14 @@ begin menu_toggled := True end; 'toggleconsole': - begin - g_Console_Switch; - gSkipFirstChar := g_Console_Interactive(); - end; + g_Console_Switch; 'togglechat': - begin - if not gConsoleShow and (g_ActiveWindow = nil) then - g_Console_Chat_Switch; - gSkipFirstChar := not g_Console_Interactive() - end; + if not gConsoleShow and (g_ActiveWindow = nil) then + g_Console_Chat_Switch; 'toggleteamchat': if gGameSettings.GameMode in [GM_TDM, GM_CTF] then - begin if not gConsoleShow and (g_ActiveWindow = nil) then g_Console_Chat_Switch(True); - gSkipFirstChar := not g_Console_Interactive() - end; end end; @@ -977,7 +967,6 @@ begin WhitelistCommand('g_scorelimit'); WhitelistCommand('g_timelimit'); - gParsingBinds := True; g_Console_ResetBinds; g_Console_ReadConfig(GameDir + '/dfconfig.cfg'); g_Console_ReadConfig(GameDir + '/autoexec.cfg'); @@ -1171,12 +1160,8 @@ end; procedure g_Console_Char(C: AnsiChar); begin - if not gSkipFirstChar then - begin - Insert(C, Line, CPos); - CPos := CPos + 1; - end; - gSkipFirstChar := False + Insert(C, Line, CPos); + CPos := CPos + 1; end; @@ -1384,19 +1369,15 @@ begin IK_0, IK_1, IK_2, IK_3, IK_4, IK_5, IK_6, IK_7, IK_8, IK_9, IK_MINUS, IK_EQUALS: (* see TEXTINPUT event *) else - if not gSkipFirstChar then + if gConsoleShow and not Cons_Shown and g_Console_MatchBind(K, 'toggleconsole') then + g_Console_Switch; + if g_Console_MatchBind(K, 'togglemenu') then begin - if gConsoleShow and g_Console_MatchBind(K, 'toggleconsole') then - g_Console_Switch; - - if g_Console_MatchBind(K, 'togglemenu') then - begin - menu_toggled := True; - if gChatShow then - g_Console_Chat_Switch - else if gConsoleShow then - g_Console_Switch - end + menu_toggled := True; + if gChatShow then + g_Console_Chat_Switch + else if gConsoleShow and not Cons_Shown then + g_Console_Switch end end end;