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
);
394 AddCommand('p1_name', GameCVars
);
395 AddCommand('p2_name', GameCVars
);
396 AddCommand('p1_color', GameCVars
);
397 AddCommand('p2_color', GameCVars
);
398 AddCommand('r_showfps', GameCVars
);
399 AddCommand('r_showtime', GameCVars
);
400 AddCommand('r_showscore', GameCVars
);
401 AddCommand('r_showlives', GameCVars
);
402 AddCommand('r_showstat', GameCVars
);
403 AddCommand('r_showkillmsg', GameCVars
);
404 AddCommand('r_showspect', GameCVars
);
405 AddCommand('r_showping', GameCVars
);
406 AddCommand('g_gamemode', GameCVars
);
407 AddCommand('g_friendlyfire', GameCVars
);
408 AddCommand('g_weaponstay', GameCVars
);
409 AddCommand('g_allow_exit', GameCVars
);
410 AddCommand('g_allow_monsters', GameCVars
);
411 AddCommand('g_bot_vsmonsters', GameCVars
);
412 AddCommand('g_bot_vsplayers', GameCVars
);
413 AddCommand('g_scorelimit', GameCVars
);
414 AddCommand('g_timelimit', GameCVars
);
415 AddCommand('g_maxlives', GameCVars
);
416 AddCommand('g_warmuptime', GameCVars
);
417 AddCommand('net_interp', GameCVars
);
418 AddCommand('net_forceplayerupdate', GameCVars
);
419 AddCommand('net_predictself', GameCVars
);
420 AddCommand('sv_name', GameCVars
);
421 AddCommand('sv_passwd', GameCVars
);
422 AddCommand('sv_maxplrs', GameCVars
);
423 AddCommand('sv_public', GameCVars
);
424 AddCommand('sv_intertime', GameCVars
);
426 AddCommand('quit', GameCommands
);
427 AddCommand('exit', GameCommands
);
428 AddCommand('pause', GameCommands
);
429 AddCommand('endgame', GameCommands
);
430 AddCommand('restart', GameCommands
);
431 AddCommand('addbot', GameCommands
);
432 AddCommand('bot_add', GameCommands
);
433 AddCommand('bot_addlist', GameCommands
);
434 AddCommand('bot_addred', GameCommands
);
435 AddCommand('bot_addblue', GameCommands
);
436 AddCommand('bot_removeall', GameCommands
);
437 AddCommand('chat', GameCommands
);
438 AddCommand('teamchat', GameCommands
);
439 AddCommand('game', GameCommands
);
440 AddCommand('host', GameCommands
);
441 AddCommand('map', GameCommands
);
442 AddCommand('nextmap', GameCommands
);
443 AddCommand('endmap', GameCommands
);
444 AddCommand('goodbye', GameCommands
);
445 AddCommand('suicide', GameCommands
);
446 AddCommand('spectate', GameCommands
);
447 AddCommand('ready', GameCommands
);
448 AddCommand('kick', GameCommands
);
449 AddCommand('kick_id', GameCommands
);
450 AddCommand('ban', GameCommands
);
451 AddCommand('permban', GameCommands
);
452 AddCommand('ban_id', GameCommands
);
453 AddCommand('permban_id', GameCommands
);
454 AddCommand('unban', GameCommands
);
455 AddCommand('connect', GameCommands
);
456 AddCommand('disconnect', GameCommands
);
457 AddCommand('reconnect', GameCommands
);
458 AddCommand('say', GameCommands
);
459 AddCommand('tell', GameCommands
);
460 AddCommand('overtime', GameCommands
);
461 AddCommand('rcon_password', GameCommands
);
462 AddCommand('rcon', GameCommands
);
463 AddCommand('callvote', GameCommands
);
464 AddCommand('vote', GameCommands
);
465 AddCommand('clientlist', GameCommands
);
466 AddCommand('event', GameCommands
);
468 AddCommand('god', GameCheats
);
469 AddCommand('notarget', GameCheats
);
470 AddCommand('give', GameCheats
); // "exit" too ;-)
471 AddCommand('open', GameCheats
);
472 AddCommand('fly', GameCheats
);
473 AddCommand('noclip', GameCheats
);
474 AddCommand('speedy', GameCheats
);
475 AddCommand('jumpy', GameCheats
);
476 AddCommand('noreload', GameCheats
);
477 AddCommand('aimline', GameCheats
);
478 AddCommand('automap', GameCheats
);
480 WhitelistCommand('say');
481 WhitelistCommand('tell');
482 WhitelistCommand('overtime');
483 WhitelistCommand('ready');
484 WhitelistCommand('map');
485 WhitelistCommand('nextmap');
486 WhitelistCommand('endmap');
487 WhitelistCommand('restart');
488 WhitelistCommand('kick');
489 WhitelistCommand('ban');
491 WhitelistCommand('addbot');
492 WhitelistCommand('bot_add');
493 WhitelistCommand('bot_addred');
494 WhitelistCommand('bot_addblue');
495 WhitelistCommand('bot_removeall');
497 WhitelistCommand('g_gamemode');
498 WhitelistCommand('g_friendlyfire');
499 WhitelistCommand('g_weaponstay');
500 WhitelistCommand('g_allow_exit');
501 WhitelistCommand('g_allow_monsters');
502 WhitelistCommand('g_scorelimit');
503 WhitelistCommand('g_timelimit');
505 g_Console_Add(Format(_lc
[I_CONSOLE_WELCOME
], [GAME_VERSION
]));
509 procedure g_Console_Update();
515 // Â ïðîöåññå îòêðûòèÿ:
516 if gConsoleShow
and (Cons_Y
< 0) then
518 Cons_Y
:= Cons_Y
+Step
;
521 // Â ïðîöåññå çàêðûòèÿ:
522 if (not gConsoleShow
) and
523 (Cons_Y
> -(gScreenHeight
div 2)) then
524 Cons_Y
:= Cons_Y
-Step
;
526 // Îêîí÷àòåëüíî îòêðûëàñü:
530 // Îêîí÷àòåëüíî çàêðûëàñü:
531 if Cons_Y
<= (-(gScreenHeight
div 2)) then
533 Cons_Y
:= -(gScreenHeight
div 2);
539 while a
<= High(MsgArray
) do
541 if MsgArray
[a
].Time
> 0 then
543 if MsgArray
[a
].Time
= 1 then
545 if a
< High(MsgArray
) then
547 for b
:= a
to High(MsgArray
)-1 do
548 MsgArray
[b
] := MsgArray
[b
+1];
550 MsgArray
[High(MsgArray
)].Time
:= 0;
556 Dec(MsgArray
[a
].Time
);
564 procedure drawConsoleText ();
566 CWidth
, CHeight
: Byte;
571 procedure putLine (sp
, ep
: LongWord);
580 cw
:= e_TextureFontCharWidth(cbufAt(p
), gStdFont
);
581 if wdt
+cw
> gScreenWidth
-8 then break
;
582 //e_TextureFontPrintChar(X, Y: Integer; Ch: Char; FontID: DWORD; Shadow: Boolean = False);
586 if p
<> ep
then putLine(p
, ep
); // do rest of the line first
587 // now print our part
595 cw
:= e_TextureFontCharWidth(cbufAt(p
), gStdFont
);
596 e_TextureFontPrintCharEx(wdt
, ty
, cbufAt(p
), gStdFont
);
609 e_TextureFontGetSize(gStdFont
, CWidth
, CHeight
);
610 ty
:= (gScreenHeight
div 2)-4-2*CHeight
-Abs(Cons_Y
);
611 skip
:= conSkipLines
;
612 cbufLastLine(sp
, ep
);
615 if ty
+CHeight
<= 0 then break
;
616 until not cbufLineUp(sp
, ep
);
619 procedure g_Console_Draw();
621 CWidth
, CHeight
: Byte;
625 e_TextureFontGetSize(gStdFont
, CWidth
, CHeight
);
627 for a
:= 0 to High(MsgArray
) do
628 if MsgArray
[a
].Time
> 0 then
629 e_TextureFontPrintFmt(0, CHeight
*a
, MsgArray
[a
].Msg
,
632 if not Cons_Shown
then
638 e_TextureFontPrintEx(0, gScreenHeight
- CHeight
- 1, 'say team> ' + Line
,
639 gStdFont
, 255, 255, 255, 1, True);
640 e_TextureFontPrintEx((CPos
+ 9)*CWidth
, gScreenHeight
- CHeight
- 1, '_',
641 gStdFont
, 255, 255, 255, 1, True);
645 e_TextureFontPrintEx(0, gScreenHeight
- CHeight
- 1, 'say> ' + Line
,
646 gStdFont
, 255, 255, 255, 1, True);
647 e_TextureFontPrintEx((CPos
+ 4)*CWidth
, gScreenHeight
- CHeight
- 1, '_',
648 gStdFont
, 255, 255, 255, 1, True);
656 e_CharFont_GetSize(gMenuFont
, DEBUG_STRING
, mfW
, mfH
);
657 a
:= (gScreenWidth
- 2*mfW
) div 2;
658 b
:= Cons_Y
+ ((gScreenHeight
div 2) - 2*mfH
) div 2;
659 e_CharFont_PrintEx(gMenuFont
, a
div 2, b
div 2, DEBUG_STRING
,
660 _RGB(128, 0, 0), 2.0);
663 e_DrawSize(ID
, 0, Cons_Y
, Alpha
, False, False, gScreenWidth
, gScreenHeight
div 2);
664 e_TextureFontPrint(0, Cons_Y
+(gScreenHeight
div 2)-CHeight
-4, '> '+Line
, gStdFont
);
668 if ConsoleHistory <> nil then
672 if Length(ConsoleHistory) > ((gScreenHeight div 2) div CHeight)-1 then
673 b := Length(ConsoleHistory)-((gScreenHeight div 2) div CHeight)+1;
675 b := Max(b-Offset, 0);
676 d := Max(High(ConsoleHistory)-Offset, 0);
679 for a := d downto b do
681 e_TextureFontPrintFmt(0, (gScreenHeight div 2)-4-c*CHeight-Abs(Cons_Y), ConsoleHistory[a],
688 e_TextureFontPrint((CPos
+1)*CWidth
, Cons_Y
+(gScreenHeight
div 2)-21, '_', gStdFont
);
691 procedure g_Console_Switch();
693 if gChatShow
then Exit
;
694 gConsoleShow
:= not gConsoleShow
;
698 procedure g_Console_Chat_Switch(Team
: Boolean = False);
700 if gConsoleShow
then Exit
;
701 if not g_Game_IsNet
then Exit
;
702 gChatShow
:= not gChatShow
;
710 procedure g_Console_Char(C
: Char);
712 if gChatShow
and (not gChatEnter
) then
714 Insert(C
, Line
, CPos
);
718 procedure Complete();
728 for i
:= 0 to High(Commands
) do
729 if LowerCase(Line
) = LowerCase(Copy(Commands
[i
].Cmd
, 0, Length(Line
))) then
731 SetLength(t
, Length(t
) + 1);
732 t
[Length(t
)-1] := Commands
[i
].Cmd
;
738 if Length(t
) = 1 then
741 CPos
:= Length(Line
)+1;
746 for i
:= 0 to High(t
) do
747 g_Console_Add(' '+t
[i
]);
751 procedure g_Console_Control(K
: Word);
755 if (Length(Line
) > 0) and (CPos
> 1) then
757 Delete(Line
, CPos
-1, 1);
761 if (Length(Line
) > 0) and (CPos
<= Length(Line
)) then
762 Delete(Line
, CPos
, 1);
766 IK_RIGHT
, IK_KPRIGHT
:
767 if CPos
<= Length(Line
) then
769 IK_RETURN
, IK_KPRETURN
:
772 g_Console_Process(Line
)
776 if (Length(Line
) > 0) and g_Game_IsNet
then
780 if g_Game_IsClient
then
781 MC_SEND_Chat(b_Text_Format(Line
), NET_CHAT_TEAM
)
783 MH_SEND_Chat('[' + gPlayer1Settings
.Name
+ ']: ' + b_Text_Format(Line
),
784 NET_CHAT_TEAM
, gPlayer1Settings
.Team
);
788 if g_Game_IsClient
then
789 MC_SEND_Chat(b_Text_Format(Line
), NET_CHAT_PLAYER
)
791 MH_SEND_Chat('[' + gPlayer1Settings
.Name
+ ']: ' + b_Text_Format(Line
),
799 gJustChatted
:= True;
803 if not gChatShow
then
806 if not gChatShow
then
807 if (CommandHistory
<> nil) and
808 (CmdIndex
< Length(CommandHistory
)) then
810 if CmdIndex
< Length(CommandHistory
)-1 then
811 CmdIndex
:= CmdIndex
+ 1;
812 Line
:= CommandHistory
[CmdIndex
];
813 CPos
:= Length(Line
) + 1;
816 if not gChatShow
then
817 if (CommandHistory
<> nil) and
818 (CmdIndex
<= Length(CommandHistory
)) then
821 CmdIndex
:= CmdIndex
- 1;
822 Line
:= CommandHistory
[CmdIndex
];
823 Cpos
:= Length(Line
) + 1;
825 IK_PAGEUP
, IK_KPPAGEUP
: // PgUp
826 if not gChatShow
then Inc(conSkipLines
);
827 IK_PAGEDN
, IK_KPPAGEDN
: // PgDown
828 if not gChatShow
and (conSkipLines
> 0) then Dec(conSkipLines
);
832 CPos
:= Length(Line
) + 1;
836 function GetStr(var Str
: String): String;
843 for b
:= 1 to Length(Str
) do
844 if (b
= Length(Str
)) or (Str
[b
+1] = '"') then
846 Result
:= Copy(Str
, 2, b
-1);
853 for a
:= 1 to Length(Str
) do
854 if (a
= Length(Str
)) or (Str
[a
+1] = ' ') then
856 Result
:= Copy(Str
, 1, a
);
863 function ParseString(Str
: String): SArray
;
874 SetLength(Result
, Length(Result
)+1);
875 Result
[High(Result
)] := GetStr(Str
);
879 procedure g_Console_Add (L
: string; Show
: Boolean=false);
881 procedure conmsg (s
: AnsiString);
885 if length(s
) = 0 then exit
;
886 for a
:= 0 to High(MsgArray
) do
898 for a
:= 0 to High(MsgArray
)-1 do MsgArray
[a
] := MsgArray
[a
+1];
899 with MsgArray
[High(MsgArray
)] do
911 if (length(L
) = 0) or ((L
[length(L
)] <> #10) and (L
[length(L
)] <> #13)) then cbufPut(#10);
913 // now show 'em out of console too
914 Show
:= Show
and gAllowConsoleMessages
;
915 if Show
and gShowMessages
then
917 // Âûâîä ñòðîê ñ ïåðåíîñàìè ïî î÷åðåäè
918 while length(L
) > 0 do
921 if f
<= 0 then f
:= length(L
)+1;
922 conmsg(Copy(L
, 1, f
-1));
927 //SetLength(ConsoleHistory, Length(ConsoleHistory)+1);
928 //ConsoleHistory[High(ConsoleHistory)] := L;
932 e_WriteLog('CON: ' + L, MSG_NOTIFY);
937 procedure g_Console_Clear();
939 //ConsoleHistory := nil;
944 procedure AddToHistory(L
: String);
948 len
:= Length(CommandHistory
);
951 (LowerCase(CommandHistory
[len
-1]) <> LowerCase(L
)) then
953 SetLength(CommandHistory
, len
+1);
954 CommandHistory
[len
] := L
;
957 CmdIndex
:= Length(CommandHistory
);
960 function g_Console_CommandBlacklisted(C
: String): Boolean;
972 Arr
:= ParseString(C
);
976 for i
:= 0 to High(Whitelist
) do
977 if Whitelist
[i
] = LowerCase(Arr
[0]) then
981 procedure g_Console_Process(L
: String; Quiet
: Boolean = False);
991 conSkipLines
:= 0; // "unscroll"
993 if L
= 'goobers' then
998 g_Console_Add('Your memory serves you well.');
1004 g_Console_Add('> '+L
);
1009 Arr
:= ParseString(L
);
1013 if Commands
= nil then
1019 for i
:= 0 to High(Commands
) do
1020 if Commands
[i
].Cmd
= LowerCase(Arr
[0]) then
1021 if @Commands
[i
].Proc
<> nil then
1023 Commands
[i
].Proc(Arr
);
1027 g_Console_Add(Format(_lc
[I_CONSOLE_UNKNOWN
], [Arr
[0]]));