-
Notifications
You must be signed in to change notification settings - Fork 0
/
FX_LOG.PAS
50 lines (40 loc) · 863 Bytes
/
FX_LOG.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Unit fx_log;
interface
function Consoled: boolean;
procedure Console_out(text:string);
procedure Show_console;
implementation
uses flaction,tpcomms,parsing,fx_console,fx_init;
const Exit = 'exit';
ConsoleX = 10;
ConsoleY = 10;
ConsoleW = 150;
ConsoleH = 80;
var Console : PConsole;
procedure Console_out;
begin
if Console<>Nil then Console^.Output(Text);
end;
function Consoled;
begin
Consoled:=Console<>Nil;
end;
procedure Show_console;
var s:string;
cmd:integer;
begin
New(Console,Init(ConsoleW,ConsoleH,LightFont,Screen));
Console^.Show(ConsoleX,ConsoleY);
repeat
s:=console^.input;
cmd:=findcomm(Argument(S,0));
s:=Tail(S,1);
if cmd<>-1
then MakeCommand(Cmd,S)
else Console^.Output('Unknown command');
until same(s,exit);
Dispose(Console,Done);
Console:=Nil;
end;
begin
end.