X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_console.pas;h=a0839f3d3d0a2dba96e743b4f0b33cc8f6bc4521;hb=4de34c0c003869d8f125768be330702020f3c514;hp=69158eae2eb830bacfa8b785e2f09b35b28dde35;hpb=7301e8529da2fdfdae50653f91c1f9597df65541;p=d2df-sdl.git diff --git a/src/game/g_console.pas b/src/game/g_console.pas index 69158ea..a0839f3 100644 --- a/src/game/g_console.pas +++ b/src/game/g_console.pas @@ -48,12 +48,14 @@ procedure g_Console_Add (L: AnsiString; show: Boolean=false); procedure g_Console_Clear (); function g_Console_CommandBlacklisted (C: AnsiString): Boolean; procedure g_Console_ReadConfig (filename: String); +procedure g_Console_WriteConfig (filename: String); function g_Console_Interactive: Boolean; function g_Console_Action (action: Integer): Boolean; -function g_Console_FindBind (n: Integer; cmd: AnsiString): Integer; -procedure g_Console_BindKey (key: Integer; cmd: AnsiString); +function g_Console_FindBind (n: Integer; down: AnsiString; up: AnsiString = ''): Integer; +procedure g_Console_BindKey (key: Integer; down: AnsiString; up: AnsiString = ''); procedure g_Console_ProcessBind (key: Integer; down: Boolean); +procedure g_Console_ResetBinds; procedure conwriteln (const s: AnsiString; show: Boolean=false); procedure conwritefln (const s: AnsiString; args: array of const; show: Boolean=false); @@ -77,7 +79,7 @@ var gChatTeam: Boolean = false; gAllowConsoleMessages: Boolean = true; gJustChatted: Boolean = false; // ÷òîáû àäìèí â èíòåðå ÷àòÿñü íå ïðîìàòûâàë ñòàòèñòèêó - gPlayerAction, gDefaultAction: Array [0..1, 0..LAST_ACTION] of Boolean; // [player, action] + gPlayerAction: Array [0..1, 0..LAST_ACTION] of Boolean; // [player, action] implementation @@ -140,10 +142,10 @@ var Time: Word; end; - bindDown, bindProcess: Boolean; gInputBinds: Array [0..e_MaxInputKeys - 1] of record - commands: SSArray; + down, up: SSArray; end; + menu_toggled: BOOLEAN; // poor man's floating literal parser; i'm sorry, but `StrToFloat()` sux cocks @@ -513,14 +515,20 @@ begin begin // exec if Length(p) = 2 then - begin - s := GameDir + '/' + p[1]; - g_Console_ReadConfig(s); - end + g_Console_ReadConfig(GameDir + '/' + p[1]) else g_Console_Add('exec