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/>.
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('p1_name', GameCVars
);
392 AddCommand('p2_name', GameCVars
);
393 AddCommand('p1_color', GameCVars
);
394 AddCommand('p2_color', GameCVars
);
395 AddCommand('r_showfps', GameCVars
);
396 AddCommand('r_showtime', GameCVars
);
397 AddCommand('r_showscore', GameCVars
);
398 AddCommand('r_showlives', GameCVars
);
399 AddCommand('r_showstat', GameCVars
);
400 AddCommand('r_showkillmsg', GameCVars
);
401 AddCommand('r_showspect', GameCVars
);
402 AddCommand('r_showping', GameCVars
);
403 AddCommand('g_gamemode', GameCVars
);
404 AddCommand('g_friendlyfire', GameCVars
);
405 AddCommand('g_weaponstay', GameCVars
);
406 AddCommand('g_allow_exit', GameCVars
);
407 AddCommand('g_allow_monsters', GameCVars
);
408 AddCommand('g_bot_vsmonsters', GameCVars
);
409 AddCommand('g_bot_vsplayers', GameCVars
);
410 AddCommand('g_scorelimit', GameCVars
);
411 AddCommand('g_timelimit', GameCVars
);
412 AddCommand('g_maxlives', GameCVars
);
413 AddCommand('g_warmuptime', GameCVars
);
414 AddCommand('net_interp', GameCVars
);
415 AddCommand('net_forceplayerupdate', GameCVars
);
416 AddCommand('net_predictself', GameCVars
);
417 AddCommand('sv_name', GameCVars
);
418 AddCommand('sv_passwd', GameCVars
);
419 AddCommand('sv_maxplrs', GameCVars
);
420 AddCommand('sv_public', GameCVars
);
421 AddCommand('sv_intertime', GameCVars
);
423 AddCommand('quit', GameCommands
);
424 AddCommand('exit', GameCommands
);
425 AddCommand('pause', GameCommands
);
426 AddCommand('endgame', GameCommands
);
427 AddCommand('restart', GameCommands
);
428 AddCommand('addbot', GameCommands
);
429 AddCommand('bot_add', GameCommands
);
430 AddCommand('bot_addlist', GameCommands
);
431 AddCommand('bot_addred', GameCommands
);
432 AddCommand('bot_addblue', GameCommands
);
433 AddCommand('bot_removeall', GameCommands
);
434 AddCommand('chat', GameCommands
);
435 AddCommand('teamchat', GameCommands
);
436 AddCommand('game', GameCommands
);
437 AddCommand('host', GameCommands
);
438 AddCommand('map', GameCommands
);
439 AddCommand('nextmap', GameCommands
);
440 AddCommand('endmap', GameCommands
);
441 AddCommand('goodbye', GameCommands
);
442 AddCommand('suicide', GameCommands
);
443 AddCommand('spectate', GameCommands
);
444 AddCommand('ready', GameCommands
);
445 AddCommand('kick', GameCommands
);
446 AddCommand('kick_id', GameCommands
);
447 AddCommand('ban', GameCommands
);
448 AddCommand('permban', GameCommands
);
449 AddCommand('ban_id', GameCommands
);
450 AddCommand('permban_id', GameCommands
);
451 AddCommand('unban', GameCommands
);
452 AddCommand('connect', GameCommands
);
453 AddCommand('disconnect', GameCommands
);
454 AddCommand('reconnect', GameCommands
);
455 AddCommand('say', GameCommands
);
456 AddCommand('tell', GameCommands
);
457 AddCommand('overtime', GameCommands
);
458 AddCommand('rcon_password', GameCommands
);
459 AddCommand('rcon', GameCommands
);
460 AddCommand('callvote', GameCommands
);
461 AddCommand('vote', GameCommands
);
462 AddCommand('clientlist', GameCommands
);
463 AddCommand('event', GameCommands
);
465 AddCommand('god', GameCheats
);
466 AddCommand('notarget', GameCheats
);
467 AddCommand('give', GameCheats
); // "exit" too ;-)
468 AddCommand('open', GameCheats
);
469 AddCommand('fly', GameCheats
);
470 AddCommand('noclip', GameCheats
);
471 AddCommand('speedy', GameCheats
);
472 AddCommand('jumpy', GameCheats
);
473 AddCommand('noreload', GameCheats
);
474 AddCommand('aimline', GameCheats
);
475 AddCommand('automap', GameCheats
);
477 WhitelistCommand('say');
478 WhitelistCommand('tell');
479 WhitelistCommand('overtime');
480 WhitelistCommand('ready');
481 WhitelistCommand('map');
482 WhitelistCommand('nextmap');
483 WhitelistCommand('endmap');
484 WhitelistCommand('restart');
485 WhitelistCommand('kick');
486 WhitelistCommand('ban');
488 WhitelistCommand('addbot');
489 WhitelistCommand('bot_add');
490 WhitelistCommand('bot_addred');
491 WhitelistCommand('bot_addblue');
492 WhitelistCommand('bot_removeall');
494 WhitelistCommand('g_gamemode');
495 WhitelistCommand('g_friendlyfire');
496 WhitelistCommand('g_weaponstay');
497 WhitelistCommand('g_allow_exit');
498 WhitelistCommand('g_allow_monsters');
499 WhitelistCommand('g_scorelimit');
500 WhitelistCommand('g_timelimit');
502 g_Console_Add(Format(_lc
[I_CONSOLE_WELCOME
], [GAME_VERSION
]));
506 procedure g_Console_Update();
512 // Â ïðîöåññå îòêðûòèÿ:
513 if gConsoleShow
and (Cons_Y
< 0) then
515 Cons_Y
:= Cons_Y
+Step
;
518 // Â ïðîöåññå çàêðûòèÿ:
519 if (not gConsoleShow
) and
520 (Cons_Y
> -(gScreenHeight
div 2)) then
521 Cons_Y
:= Cons_Y
-Step
;
523 // Îêîí÷àòåëüíî îòêðûëàñü:
527 // Îêîí÷àòåëüíî çàêðûëàñü:
528 if Cons_Y
<= (-(gScreenHeight
div 2)) then
530 Cons_Y
:= -(gScreenHeight
div 2);
536 while a
<= High(MsgArray
) do
538 if MsgArray
[a
].Time
> 0 then
540 if MsgArray
[a
].Time
= 1 then
542 if a
< High(MsgArray
) then
544 for b
:= a
to High(MsgArray
)-1 do
545 MsgArray
[b
] := MsgArray
[b
+1];
547 MsgArray
[High(MsgArray
)].Time
:= 0;
553 Dec(MsgArray
[a
].Time
);
561 procedure drawConsoleText ();
563 CWidth
, CHeight
: Byte;
568 procedure putLine (sp
, ep
: LongWord);
577 cw
:= e_TextureFontCharWidth(cbufAt(p
), gStdFont
);
578 if wdt
+cw
> gScreenWidth
-8 then break
;
579 //e_TextureFontPrintChar(X, Y: Integer; Ch: Char; FontID: DWORD; Shadow: Boolean = False);
583 if p
<> ep
then putLine(p
, ep
); // do rest of the line first
584 // now print our part
592 cw
:= e_TextureFontCharWidth(cbufAt(p
), gStdFont
);
593 e_TextureFontPrintCharEx(wdt
, ty
, cbufAt(p
), gStdFont
);
606 e_TextureFontGetSize(gStdFont
, CWidth
, CHeight
);
607 ty
:= (gScreenHeight
div 2)-4-2*CHeight
-Abs(Cons_Y
);
608 skip
:= conSkipLines
;
609 cbufLastLine(sp
, ep
);
612 if ty
+CHeight
<= 0 then break
;
613 until not cbufLineUp(sp
, ep
);
616 procedure g_Console_Draw();
618 CWidth
, CHeight
: Byte;
622 e_TextureFontGetSize(gStdFont
, CWidth
, CHeight
);
624 for a
:= 0 to High(MsgArray
) do
625 if MsgArray
[a
].Time
> 0 then
626 e_TextureFontPrintFmt(0, CHeight
*a
, MsgArray
[a
].Msg
,
629 if not Cons_Shown
then
635 e_TextureFontPrintEx(0, gScreenHeight
- CHeight
- 1, 'say team> ' + Line
,
636 gStdFont
, 255, 255, 255, 1, True);
637 e_TextureFontPrintEx((CPos
+ 9)*CWidth
, gScreenHeight
- CHeight
- 1, '_',
638 gStdFont
, 255, 255, 255, 1, True);
642 e_TextureFontPrintEx(0, gScreenHeight
- CHeight
- 1, 'say> ' + Line
,
643 gStdFont
, 255, 255, 255, 1, True);
644 e_TextureFontPrintEx((CPos
+ 4)*CWidth
, gScreenHeight
- CHeight
- 1, '_',
645 gStdFont
, 255, 255, 255, 1, True);
653 e_CharFont_GetSize(gMenuFont
, DEBUG_STRING
, mfW
, mfH
);
654 a
:= (gScreenWidth
- 2*mfW
) div 2;
655 b
:= Cons_Y
+ ((gScreenHeight
div 2) - 2*mfH
) div 2;
656 e_CharFont_PrintEx(gMenuFont
, a
div 2, b
div 2, DEBUG_STRING
,
657 _RGB(128, 0, 0), 2.0);
660 e_DrawSize(ID
, 0, Cons_Y
, Alpha
, False, False, gScreenWidth
, gScreenHeight
div 2);
661 e_TextureFontPrint(0, Cons_Y
+(gScreenHeight
div 2)-CHeight
-4, '> '+Line
, gStdFont
);
665 if ConsoleHistory <> nil then
669 if Length(ConsoleHistory) > ((gScreenHeight div 2) div CHeight)-1 then
670 b := Length(ConsoleHistory)-((gScreenHeight div 2) div CHeight)+1;
672 b := Max(b-Offset, 0);
673 d := Max(High(ConsoleHistory)-Offset, 0);
676 for a := d downto b do
678 e_TextureFontPrintFmt(0, (gScreenHeight div 2)-4-c*CHeight-Abs(Cons_Y), ConsoleHistory[a],
685 e_TextureFontPrint((CPos
+1)*CWidth
, Cons_Y
+(gScreenHeight
div 2)-21, '_', gStdFont
);
688 procedure g_Console_Switch();
690 if gChatShow
then Exit
;
691 gConsoleShow
:= not gConsoleShow
;
695 procedure g_Console_Chat_Switch(Team
: Boolean = False);
697 if gConsoleShow
then Exit
;
698 if not g_Game_IsNet
then Exit
;
699 gChatShow
:= not gChatShow
;
707 procedure g_Console_Char(C
: Char);
709 if gChatShow
and (not gChatEnter
) then
711 Insert(C
, Line
, CPos
);
715 procedure Complete();
725 for i
:= 0 to High(Commands
) do
726 if LowerCase(Line
) = LowerCase(Copy(Commands
[i
].Cmd
, 0, Length(Line
))) then
728 SetLength(t
, Length(t
) + 1);
729 t
[Length(t
)-1] := Commands
[i
].Cmd
;
735 if Length(t
) = 1 then
738 CPos
:= Length(Line
)+1;
743 for i
:= 0 to High(t
) do
744 g_Console_Add(' '+t
[i
]);
748 procedure g_Console_Control(K
: Word);
752 if (Length(Line
) > 0) and (CPos
> 1) then
754 Delete(Line
, CPos
-1, 1);
758 if (Length(Line
) > 0) and (CPos
<= Length(Line
)) then
759 Delete(Line
, CPos
, 1);
763 IK_RIGHT
, IK_KPRIGHT
:
764 if CPos
<= Length(Line
) then
766 IK_RETURN
, IK_KPRETURN
:
769 g_Console_Process(Line
)
773 if (Length(Line
) > 0) and g_Game_IsNet
then
777 if g_Game_IsClient
then
778 MC_SEND_Chat(b_Text_Format(Line
), NET_CHAT_TEAM
)
780 MH_SEND_Chat('[' + gPlayer1Settings
.Name
+ ']: ' + b_Text_Format(Line
),
781 NET_CHAT_TEAM
, gPlayer1Settings
.Team
);
785 if g_Game_IsClient
then
786 MC_SEND_Chat(b_Text_Format(Line
), NET_CHAT_PLAYER
)
788 MH_SEND_Chat('[' + gPlayer1Settings
.Name
+ ']: ' + b_Text_Format(Line
),
796 gJustChatted
:= True;
800 if not gChatShow
then
803 if not gChatShow
then
804 if (CommandHistory
<> nil) and
805 (CmdIndex
< Length(CommandHistory
)) then
807 if CmdIndex
< Length(CommandHistory
)-1 then
808 CmdIndex
:= CmdIndex
+ 1;
809 Line
:= CommandHistory
[CmdIndex
];
810 CPos
:= Length(Line
) + 1;
813 if not gChatShow
then
814 if (CommandHistory
<> nil) and
815 (CmdIndex
<= Length(CommandHistory
)) then
818 CmdIndex
:= CmdIndex
- 1;
819 Line
:= CommandHistory
[CmdIndex
];
820 Cpos
:= Length(Line
) + 1;
822 IK_PAGEUP
, IK_KPPAGEUP
: // PgUp
823 if not gChatShow
then Inc(conSkipLines
);
824 IK_PAGEDN
, IK_KPPAGEDN
: // PgDown
825 if not gChatShow
and (conSkipLines
> 0) then Dec(conSkipLines
);
829 CPos
:= Length(Line
) + 1;
833 function GetStr(var Str
: String): String;
840 for b
:= 1 to Length(Str
) do
841 if (b
= Length(Str
)) or (Str
[b
+1] = '"') then
843 Result
:= Copy(Str
, 2, b
-1);
850 for a
:= 1 to Length(Str
) do
851 if (a
= Length(Str
)) or (Str
[a
+1] = ' ') then
853 Result
:= Copy(Str
, 1, a
);
860 function ParseString(Str
: String): SArray
;
871 SetLength(Result
, Length(Result
)+1);
872 Result
[High(Result
)] := GetStr(Str
);
876 procedure g_Console_Add (L
: string; Show
: Boolean=false);
878 procedure conmsg (s
: AnsiString);
882 if length(s
) = 0 then exit
;
883 for a
:= 0 to High(MsgArray
) do
895 for a
:= 0 to High(MsgArray
)-1 do MsgArray
[a
] := MsgArray
[a
+1];
896 with MsgArray
[High(MsgArray
)] do
908 if (length(L
) = 0) or ((L
[length(L
)] <> #10) and (L
[length(L
)] <> #13)) then cbufPut(#10);
910 // now show 'em out of console too
911 Show
:= Show
and gAllowConsoleMessages
;
912 if Show
and gShowMessages
then
914 // Âûâîä ñòðîê ñ ïåðåíîñàìè ïî î÷åðåäè
915 while length(L
) > 0 do
918 if f
<= 0 then f
:= length(L
)+1;
919 conmsg(Copy(L
, 1, f
-1));
924 //SetLength(ConsoleHistory, Length(ConsoleHistory)+1);
925 //ConsoleHistory[High(ConsoleHistory)] := L;
929 e_WriteLog('CON: ' + L, MSG_NOTIFY);
934 procedure g_Console_Clear();
936 //ConsoleHistory := nil;
941 procedure AddToHistory(L
: String);
945 len
:= Length(CommandHistory
);
948 (LowerCase(CommandHistory
[len
-1]) <> LowerCase(L
)) then
950 SetLength(CommandHistory
, len
+1);
951 CommandHistory
[len
] := L
;
954 CmdIndex
:= Length(CommandHistory
);
957 function g_Console_CommandBlacklisted(C
: String): Boolean;
969 Arr
:= ParseString(C
);
973 for i
:= 0 to High(Whitelist
) do
974 if Whitelist
[i
] = LowerCase(Arr
[0]) then
978 procedure g_Console_Process(L
: String; Quiet
: Boolean = False);
988 conSkipLines
:= 0; // "unscroll"
990 if L
= 'goobers' then
995 g_Console_Add('Your memory serves you well.');
1001 g_Console_Add('> '+L
);
1006 Arr
:= ParseString(L
);
1010 if Commands
= nil then
1016 for i
:= 0 to High(Commands
) do
1017 if Commands
[i
].Cmd
= LowerCase(Arr
[0]) then
1018 if @Commands
[i
].Proc
<> nil then
1020 Commands
[i
].Proc(Arr
);
1024 g_Console_Add(Format(_lc
[I_CONSOLE_UNKNOWN
], [Arr
[0]]));