1 (* Copyright (C) DooM 2D:Forever Developers
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 {$INCLUDE ../shared/a_modes.inc}
21 procedure g_Console_Init();
22 procedure g_Console_Update();
23 procedure g_Console_Draw();
24 procedure g_Console_Switch();
25 procedure g_Console_Char(C
: Char);
26 procedure g_Console_Control(K
: Word);
27 procedure g_Console_Process(L
: String; Quiet
: Boolean = False);
28 procedure g_Console_Add(L
: String; Show
: Boolean = False);
29 procedure g_Console_Clear();
30 function g_Console_CommandBlacklisted(C
: String): Boolean;
32 procedure g_Console_Chat_Switch(Team
: Boolean = False);
35 gConsoleShow
: Boolean; // True - êîíñîëü îòêðûòà èëè îòêðûâàåòñÿ
37 gChatTeam
: Boolean = False;
38 gAllowConsoleMessages
: Boolean = True;
39 gChatEnter
: Boolean = True;
40 gJustChatted
: Boolean = False; // ÷òîáû àäìèí â èíòåðå ÷àòÿñü íå ïðîìàòûâàë ñòàòèñòèêó
45 g_textures
, g_main
, e_graphics
, e_input
, g_game
,
46 SysUtils
, g_basic
, g_options
, wadreader
, Math
,
47 g_menu
, g_language
, g_net
, g_netmsg
, e_log
, conbuf
;
50 TCmdProc
= procedure (P
: SArray
);
66 MaxScriptRecursion
= 16;
68 DEBUG_STRING
= 'DEBUG MODE';
72 RecursionDepth
: Word = 0;
73 RecursionLimitHit
: Boolean = False;
75 Cons_Shown
: Boolean; // Ðèñîâàòü ëè êîíñîëü?
78 //ConsoleHistory: SArray;
79 CommandHistory
: SArray
;
81 Commands
: Array of TCommand
;
82 Aliases
: Array of TAlias
;
84 conSkipLines
: Integer = 0;
85 MsgArray
: Array [0..4] of record
90 function GetStrACmd(var Str
: String): String;
95 for a
:= 1 to Length(Str
) do
96 if (a
= Length(Str
)) or (Str
[a
+1] = ';') then
98 Result
:= Copy(Str
, 1, a
);
105 function ParseAlias(Str
: String): SArray
;
116 SetLength(Result
, Length(Result
)+1);
117 Result
[High(Result
)] := GetStrACmd(Str
);
121 procedure ConsoleCommands(P
: SArray
);
127 Cmd
:= LowerCase(P
[0]);
130 if Cmd
= 'clear' then
132 //ConsoleHistory := nil;
136 for a
:= 0 to High(MsgArray
) do
144 if Cmd
= 'clearhistory' then
145 CommandHistory
:= nil;
147 if Cmd
= 'showhistory' then
148 if CommandHistory
<> nil then
151 for a
:= 0 to High(CommandHistory
) do
152 g_Console_Add(' '+CommandHistory
[a
]);
155 if Cmd
= 'commands' then
158 g_Console_Add('Commands list:');
159 for a
:= High(Commands
) downto 0 do
160 g_Console_Add(' '+Commands
[a
].Cmd
);
164 g_Console_Add(TimeToStr(Now
), True);
167 g_Console_Add(DateToStr(Now
), True);
170 if Length(P
) > 1 then
172 if P
[1] = 'ololo' then
177 for a
:= 1 to High(P
) do
179 g_Console_Add(b_Text_Format(s
), True);
188 if ConsoleHistory <> nil then
190 if Length(P) > 1 then
193 s := GameDir+'/console.txt';
198 if IOResult <> 0 then
200 g_Console_Add(Format(_lc[I_CONSOLE_ERROR_WRITE], [s]));
205 for a := 0 to High(ConsoleHistory) do
206 WriteLn(F, ConsoleHistory[a]);
209 g_Console_Add(Format(_lc[I_CONSOLE_DUMPED], [s]));
218 if Length(P
) > 1 then
220 s
:= GameDir
+'/'+P
[1];
225 if IOResult
<> 0 then
227 g_Console_Add(Format(_lc
[I_CONSOLE_ERROR_READ
], [s
]));
231 g_Console_Add(Format(_lc
[I_CONSOLE_EXEC
], [s
]));
236 if IOResult
<> 0 then
238 g_Console_Add(Format(_lc
[I_CONSOLE_ERROR_READ
], [s
]));
242 if Pos('#', s
) <> 1 then // script comment
244 // prevents endless loops
246 RecursionLimitHit
:= (RecursionDepth
> MaxScriptRecursion
) or RecursionLimitHit
;
247 if not RecursionLimitHit
then
248 g_Console_Process(s
, True);
252 if (RecursionDepth
= 0) and RecursionLimitHit
then
254 g_Console_Add(Format(_lc
[I_CONSOLE_ERROR_CALL
], [s
]));
255 RecursionLimitHit
:= False;
262 g_Console_Add('exec <script file>');
265 if Cmd
= 'alias' then
267 // alias [alias_name] [commands]
268 if Length(P
) > 1 then
270 for a
:= 0 to High(Aliases
) do
271 if Aliases
[a
].Name
= P
[1] then
273 if Length(P
) > 2 then
274 Aliases
[a
].Commands
:= ParseAlias(P
[2])
276 for b
:= 0 to High(Aliases
[a
].Commands
) do
277 g_Console_Add(Aliases
[a
].Commands
[b
]);
280 SetLength(Aliases
, Length(Aliases
)+1);
282 Aliases
[a
].Name
:= P
[1];
283 if Length(P
) > 2 then
284 Aliases
[a
].Commands
:= ParseAlias(P
[2])
286 for b
:= 0 to High(Aliases
[a
].Commands
) do
287 g_Console_Add(Aliases
[a
].Commands
[b
]);
289 for a
:= 0 to High(Aliases
) do
290 if Aliases
[a
].Commands
<> nil then
291 g_Console_Add(Aliases
[a
].Name
);
297 if Length(P
) > 1 then
299 if Aliases
= nil then
301 for a
:= 0 to High(Aliases
) do
302 if Aliases
[a
].Name
= P
[1] then
304 if Aliases
[a
].Commands
<> nil then
306 // with this system proper endless loop detection seems either impossible
307 // or very dirty to implement, so let's have this instead
308 // prevents endless loops
309 for b
:= 0 to High(Aliases
[a
].Commands
) do
312 RecursionLimitHit
:= (RecursionDepth
> MaxScriptRecursion
) or RecursionLimitHit
;
313 if not RecursionLimitHit
then
314 g_Console_Process(Aliases
[a
].Commands
[b
], True);
317 if (RecursionDepth
= 0) and RecursionLimitHit
then
319 g_Console_Add(Format(_lc
[I_CONSOLE_ERROR_CALL
], [s
]));
320 RecursionLimitHit
:= False;
327 g_Console_Add('call <alias name>');
331 procedure WhitelistCommand(Cmd
: string);
335 SetLength(Whitelist
, Length(Whitelist
)+1);
336 a
:= High(Whitelist
);
340 procedure AddCommand(Cmd
: String; Proc
: TCmdProc
);
344 SetLength(Commands
, Length(Commands
)+1);
346 Commands
[a
].Cmd
:= Cmd
;
347 Commands
[a
].Proc
:= Proc
;
350 procedure g_Console_Init();
354 g_Texture_CreateWAD(ID
, GameWAD
+':TEXTURES\CONSOLE');
355 Cons_Y
:= -(gScreenHeight
div 2);
356 gConsoleShow
:= False;
361 for a
:= 0 to High(MsgArray
) do
368 AddCommand('clear', ConsoleCommands
);
369 AddCommand('clearhistory', ConsoleCommands
);
370 AddCommand('showhistory', ConsoleCommands
);
371 AddCommand('commands', ConsoleCommands
);
372 AddCommand('time', ConsoleCommands
);
373 AddCommand('date', ConsoleCommands
);
374 AddCommand('echo', ConsoleCommands
);
375 AddCommand('dump', ConsoleCommands
);
376 AddCommand('exec', ConsoleCommands
);
377 AddCommand('alias', ConsoleCommands
);
378 AddCommand('call', ConsoleCommands
);
380 AddCommand('d_window', DebugCommands
);
381 AddCommand('d_sounds', DebugCommands
);
382 AddCommand('d_frames', DebugCommands
);
383 AddCommand('d_winmsg', DebugCommands
);
384 AddCommand('d_monoff', DebugCommands
);
385 AddCommand('d_botoff', DebugCommands
);
386 AddCommand('d_monster', DebugCommands
);
387 AddCommand('d_health', DebugCommands
);
388 AddCommand('d_player', DebugCommands
);
389 AddCommand('d_joy', DebugCommands
);
391 AddCommand('dpp', ProfilerCommands
);
392 AddCommand('dpu', ProfilerCommands
);
393 AddCommand('dpc', ProfilerCommands
);
394 AddCommand('r_gridrender', ProfilerCommands
);
395 AddCommand('dbg_coldet_grid', ProfilerCommands
);
397 AddCommand('p1_name', GameCVars
);
398 AddCommand('p2_name', GameCVars
);
399 AddCommand('p1_color', GameCVars
);
400 AddCommand('p2_color', GameCVars
);
401 AddCommand('r_showfps', GameCVars
);
402 AddCommand('r_showtime', GameCVars
);
403 AddCommand('r_showscore', GameCVars
);
404 AddCommand('r_showlives', GameCVars
);
405 AddCommand('r_showstat', GameCVars
);
406 AddCommand('r_showkillmsg', GameCVars
);
407 AddCommand('r_showspect', GameCVars
);
408 AddCommand('r_showping', GameCVars
);
409 AddCommand('g_gamemode', GameCVars
);
410 AddCommand('g_friendlyfire', GameCVars
);
411 AddCommand('g_weaponstay', GameCVars
);
412 AddCommand('g_allow_exit', GameCVars
);
413 AddCommand('g_allow_monsters', GameCVars
);
414 AddCommand('g_bot_vsmonsters', GameCVars
);
415 AddCommand('g_bot_vsplayers', GameCVars
);
416 AddCommand('g_scorelimit', GameCVars
);
417 AddCommand('g_timelimit', GameCVars
);
418 AddCommand('g_maxlives', GameCVars
);
419 AddCommand('g_warmuptime', GameCVars
);
420 AddCommand('net_interp', GameCVars
);
421 AddCommand('net_forceplayerupdate', GameCVars
);
422 AddCommand('net_predictself', GameCVars
);
423 AddCommand('sv_name', GameCVars
);
424 AddCommand('sv_passwd', GameCVars
);
425 AddCommand('sv_maxplrs', GameCVars
);
426 AddCommand('sv_public', GameCVars
);
427 AddCommand('sv_intertime', GameCVars
);
429 AddCommand('quit', GameCommands
);
430 AddCommand('exit', GameCommands
);
431 AddCommand('pause', GameCommands
);
432 AddCommand('endgame', GameCommands
);
433 AddCommand('restart', GameCommands
);
434 AddCommand('addbot', GameCommands
);
435 AddCommand('bot_add', GameCommands
);
436 AddCommand('bot_addlist', GameCommands
);
437 AddCommand('bot_addred', GameCommands
);
438 AddCommand('bot_addblue', GameCommands
);
439 AddCommand('bot_removeall', GameCommands
);
440 AddCommand('chat', GameCommands
);
441 AddCommand('teamchat', GameCommands
);
442 AddCommand('game', GameCommands
);
443 AddCommand('host', GameCommands
);
444 AddCommand('map', GameCommands
);
445 AddCommand('nextmap', GameCommands
);
446 AddCommand('endmap', GameCommands
);
447 AddCommand('goodbye', GameCommands
);
448 AddCommand('suicide', GameCommands
);
449 AddCommand('spectate', GameCommands
);
450 AddCommand('ready', GameCommands
);
451 AddCommand('kick', GameCommands
);
452 AddCommand('kick_id', GameCommands
);
453 AddCommand('ban', GameCommands
);
454 AddCommand('permban', GameCommands
);
455 AddCommand('ban_id', GameCommands
);
456 AddCommand('permban_id', GameCommands
);
457 AddCommand('unban', GameCommands
);
458 AddCommand('connect', GameCommands
);
459 AddCommand('disconnect', GameCommands
);
460 AddCommand('reconnect', GameCommands
);
461 AddCommand('say', GameCommands
);
462 AddCommand('tell', GameCommands
);
463 AddCommand('overtime', GameCommands
);
464 AddCommand('rcon_password', GameCommands
);
465 AddCommand('rcon', GameCommands
);
466 AddCommand('callvote', GameCommands
);
467 AddCommand('vote', GameCommands
);
468 AddCommand('clientlist', GameCommands
);
469 AddCommand('event', GameCommands
);
471 AddCommand('god', GameCheats
);
472 AddCommand('notarget', GameCheats
);
473 AddCommand('give', GameCheats
); // "exit" too ;-)
474 AddCommand('open', GameCheats
);
475 AddCommand('fly', GameCheats
);
476 AddCommand('noclip', GameCheats
);
477 AddCommand('speedy', GameCheats
);
478 AddCommand('jumpy', GameCheats
);
479 AddCommand('noreload', GameCheats
);
480 AddCommand('aimline', GameCheats
);
481 AddCommand('automap', GameCheats
);
483 WhitelistCommand('say');
484 WhitelistCommand('tell');
485 WhitelistCommand('overtime');
486 WhitelistCommand('ready');
487 WhitelistCommand('map');
488 WhitelistCommand('nextmap');
489 WhitelistCommand('endmap');
490 WhitelistCommand('restart');
491 WhitelistCommand('kick');
492 WhitelistCommand('ban');
494 WhitelistCommand('addbot');
495 WhitelistCommand('bot_add');
496 WhitelistCommand('bot_addred');
497 WhitelistCommand('bot_addblue');
498 WhitelistCommand('bot_removeall');
500 WhitelistCommand('g_gamemode');
501 WhitelistCommand('g_friendlyfire');
502 WhitelistCommand('g_weaponstay');
503 WhitelistCommand('g_allow_exit');
504 WhitelistCommand('g_allow_monsters');
505 WhitelistCommand('g_scorelimit');
506 WhitelistCommand('g_timelimit');
508 g_Console_Add(Format(_lc
[I_CONSOLE_WELCOME
], [GAME_VERSION
]));
512 procedure g_Console_Update();
518 // Â ïðîöåññå îòêðûòèÿ:
519 if gConsoleShow
and (Cons_Y
< 0) then
521 Cons_Y
:= Cons_Y
+Step
;
524 // Â ïðîöåññå çàêðûòèÿ:
525 if (not gConsoleShow
) and
526 (Cons_Y
> -(gScreenHeight
div 2)) then
527 Cons_Y
:= Cons_Y
-Step
;
529 // Îêîí÷àòåëüíî îòêðûëàñü:
533 // Îêîí÷àòåëüíî çàêðûëàñü:
534 if Cons_Y
<= (-(gScreenHeight
div 2)) then
536 Cons_Y
:= -(gScreenHeight
div 2);
542 while a
<= High(MsgArray
) do
544 if MsgArray
[a
].Time
> 0 then
546 if MsgArray
[a
].Time
= 1 then
548 if a
< High(MsgArray
) then
550 for b
:= a
to High(MsgArray
)-1 do
551 MsgArray
[b
] := MsgArray
[b
+1];
553 MsgArray
[High(MsgArray
)].Time
:= 0;
559 Dec(MsgArray
[a
].Time
);
567 procedure drawConsoleText ();
569 CWidth
, CHeight
: Byte;
574 procedure putLine (sp
, ep
: LongWord);
583 cw
:= e_TextureFontCharWidth(cbufAt(p
), gStdFont
);
584 if wdt
+cw
> gScreenWidth
-8 then break
;
585 //e_TextureFontPrintChar(X, Y: Integer; Ch: Char; FontID: DWORD; Shadow: Boolean = False);
589 if p
<> ep
then putLine(p
, ep
); // do rest of the line first
590 // now print our part
598 cw
:= e_TextureFontCharWidth(cbufAt(p
), gStdFont
);
599 e_TextureFontPrintCharEx(wdt
, ty
, cbufAt(p
), gStdFont
);
612 e_TextureFontGetSize(gStdFont
, CWidth
, CHeight
);
613 ty
:= (gScreenHeight
div 2)-4-2*CHeight
-Abs(Cons_Y
);
614 skip
:= conSkipLines
;
615 cbufLastLine(sp
, ep
);
618 if ty
+CHeight
<= 0 then break
;
619 until not cbufLineUp(sp
, ep
);
622 procedure g_Console_Draw();
624 CWidth
, CHeight
: Byte;
628 e_TextureFontGetSize(gStdFont
, CWidth
, CHeight
);
630 for a
:= 0 to High(MsgArray
) do
631 if MsgArray
[a
].Time
> 0 then
632 e_TextureFontPrintFmt(0, CHeight
*a
, MsgArray
[a
].Msg
,
635 if not Cons_Shown
then
641 e_TextureFontPrintEx(0, gScreenHeight
- CHeight
- 1, 'say team> ' + Line
,
642 gStdFont
, 255, 255, 255, 1, True);
643 e_TextureFontPrintEx((CPos
+ 9)*CWidth
, gScreenHeight
- CHeight
- 1, '_',
644 gStdFont
, 255, 255, 255, 1, True);
648 e_TextureFontPrintEx(0, gScreenHeight
- CHeight
- 1, 'say> ' + Line
,
649 gStdFont
, 255, 255, 255, 1, True);
650 e_TextureFontPrintEx((CPos
+ 4)*CWidth
, gScreenHeight
- CHeight
- 1, '_',
651 gStdFont
, 255, 255, 255, 1, True);
659 e_CharFont_GetSize(gMenuFont
, DEBUG_STRING
, mfW
, mfH
);
660 a
:= (gScreenWidth
- 2*mfW
) div 2;
661 b
:= Cons_Y
+ ((gScreenHeight
div 2) - 2*mfH
) div 2;
662 e_CharFont_PrintEx(gMenuFont
, a
div 2, b
div 2, DEBUG_STRING
,
663 _RGB(128, 0, 0), 2.0);
666 e_DrawSize(ID
, 0, Cons_Y
, Alpha
, False, False, gScreenWidth
, gScreenHeight
div 2);
667 e_TextureFontPrint(0, Cons_Y
+(gScreenHeight
div 2)-CHeight
-4, '> '+Line
, gStdFont
);
671 if ConsoleHistory <> nil then
675 if Length(ConsoleHistory) > ((gScreenHeight div 2) div CHeight)-1 then
676 b := Length(ConsoleHistory)-((gScreenHeight div 2) div CHeight)+1;
678 b := Max(b-Offset, 0);
679 d := Max(High(ConsoleHistory)-Offset, 0);
682 for a := d downto b do
684 e_TextureFontPrintFmt(0, (gScreenHeight div 2)-4-c*CHeight-Abs(Cons_Y), ConsoleHistory[a],
691 e_TextureFontPrint((CPos
+1)*CWidth
, Cons_Y
+(gScreenHeight
div 2)-21, '_', gStdFont
);
694 procedure g_Console_Switch();
696 if gChatShow
then Exit
;
697 gConsoleShow
:= not gConsoleShow
;
701 procedure g_Console_Chat_Switch(Team
: Boolean = False);
703 if gConsoleShow
then Exit
;
704 if not g_Game_IsNet
then Exit
;
705 gChatShow
:= not gChatShow
;
713 procedure g_Console_Char(C
: Char);
715 if gChatShow
and (not gChatEnter
) then
717 Insert(C
, Line
, CPos
);
721 procedure Complete();
731 for i
:= 0 to High(Commands
) do
732 if LowerCase(Line
) = LowerCase(Copy(Commands
[i
].Cmd
, 0, Length(Line
))) then
734 SetLength(t
, Length(t
) + 1);
735 t
[Length(t
)-1] := Commands
[i
].Cmd
;
741 if Length(t
) = 1 then
744 CPos
:= Length(Line
)+1;
749 for i
:= 0 to High(t
) do
750 g_Console_Add(' '+t
[i
]);
754 procedure g_Console_Control(K
: Word);
758 if (Length(Line
) > 0) and (CPos
> 1) then
760 Delete(Line
, CPos
-1, 1);
764 if (Length(Line
) > 0) and (CPos
<= Length(Line
)) then
765 Delete(Line
, CPos
, 1);
769 IK_RIGHT
, IK_KPRIGHT
:
770 if CPos
<= Length(Line
) then
772 IK_RETURN
, IK_KPRETURN
:
775 g_Console_Process(Line
)
779 if (Length(Line
) > 0) and g_Game_IsNet
then
783 if g_Game_IsClient
then
784 MC_SEND_Chat(b_Text_Format(Line
), NET_CHAT_TEAM
)
786 MH_SEND_Chat('[' + gPlayer1Settings
.Name
+ ']: ' + b_Text_Format(Line
),
787 NET_CHAT_TEAM
, gPlayer1Settings
.Team
);
791 if g_Game_IsClient
then
792 MC_SEND_Chat(b_Text_Format(Line
), NET_CHAT_PLAYER
)
794 MH_SEND_Chat('[' + gPlayer1Settings
.Name
+ ']: ' + b_Text_Format(Line
),
802 gJustChatted
:= True;
806 if not gChatShow
then
809 if not gChatShow
then
810 if (CommandHistory
<> nil) and
811 (CmdIndex
< Length(CommandHistory
)) then
813 if CmdIndex
< Length(CommandHistory
)-1 then
814 CmdIndex
:= CmdIndex
+ 1;
815 Line
:= CommandHistory
[CmdIndex
];
816 CPos
:= Length(Line
) + 1;
819 if not gChatShow
then
820 if (CommandHistory
<> nil) and
821 (CmdIndex
<= Length(CommandHistory
)) then
824 CmdIndex
:= CmdIndex
- 1;
825 Line
:= CommandHistory
[CmdIndex
];
826 Cpos
:= Length(Line
) + 1;
828 IK_PAGEUP
, IK_KPPAGEUP
: // PgUp
829 if not gChatShow
then Inc(conSkipLines
);
830 IK_PAGEDN
, IK_KPPAGEDN
: // PgDown
831 if not gChatShow
and (conSkipLines
> 0) then Dec(conSkipLines
);
835 CPos
:= Length(Line
) + 1;
839 function GetStr(var Str
: String): String;
846 for b
:= 1 to Length(Str
) do
847 if (b
= Length(Str
)) or (Str
[b
+1] = '"') then
849 Result
:= Copy(Str
, 2, b
-1);
856 for a
:= 1 to Length(Str
) do
857 if (a
= Length(Str
)) or (Str
[a
+1] = ' ') then
859 Result
:= Copy(Str
, 1, a
);
866 function ParseString(Str
: String): SArray
;
877 SetLength(Result
, Length(Result
)+1);
878 Result
[High(Result
)] := GetStr(Str
);
882 procedure g_Console_Add (L
: string; Show
: Boolean=false);
884 procedure conmsg (s
: AnsiString);
888 if length(s
) = 0 then exit
;
889 for a
:= 0 to High(MsgArray
) do
901 for a
:= 0 to High(MsgArray
)-1 do MsgArray
[a
] := MsgArray
[a
+1];
902 with MsgArray
[High(MsgArray
)] do
914 if (length(L
) = 0) or ((L
[length(L
)] <> #10) and (L
[length(L
)] <> #13)) then cbufPut(#10);
916 // now show 'em out of console too
917 Show
:= Show
and gAllowConsoleMessages
;
918 if Show
and gShowMessages
then
920 // Âûâîä ñòðîê ñ ïåðåíîñàìè ïî î÷åðåäè
921 while length(L
) > 0 do
924 if f
<= 0 then f
:= length(L
)+1;
925 conmsg(Copy(L
, 1, f
-1));
930 //SetLength(ConsoleHistory, Length(ConsoleHistory)+1);
931 //ConsoleHistory[High(ConsoleHistory)] := L;
935 e_WriteLog('CON: ' + L, MSG_NOTIFY);
940 procedure g_Console_Clear();
942 //ConsoleHistory := nil;
947 procedure AddToHistory(L
: String);
951 len
:= Length(CommandHistory
);
954 (LowerCase(CommandHistory
[len
-1]) <> LowerCase(L
)) then
956 SetLength(CommandHistory
, len
+1);
957 CommandHistory
[len
] := L
;
960 CmdIndex
:= Length(CommandHistory
);
963 function g_Console_CommandBlacklisted(C
: String): Boolean;
975 Arr
:= ParseString(C
);
979 for i
:= 0 to High(Whitelist
) do
980 if Whitelist
[i
] = LowerCase(Arr
[0]) then
984 procedure g_Console_Process(L
: String; Quiet
: Boolean = False);
994 conSkipLines
:= 0; // "unscroll"
996 if L
= 'goobers' then
1001 g_Console_Add('Your memory serves you well.');
1007 g_Console_Add('> '+L
);
1012 Arr
:= ParseString(L
);
1016 if Commands
= nil then
1022 for i
:= 0 to High(Commands
) do
1023 if Commands
[i
].Cmd
= LowerCase(Arr
[0]) then
1024 if @Commands
[i
].Proc
<> nil then
1026 Commands
[i
].Proc(Arr
);
1030 g_Console_Add(Format(_lc
[I_CONSOLE_UNKNOWN
], [Arr
[0]]));