hedgewars/uConsole.pas
changeset 3038 4e48c276a468
parent 2990 b62e567f17b9
child 3133 1ab5f18f4df8
equal deleted inserted replaced
3037:ab6e949eb5cb 3038:4e48c276a468
    24 
    24 
    25 var isDeveloperMode: boolean;
    25 var isDeveloperMode: boolean;
    26 type TVariableType = (vtCommand, vtLongInt, vthwFloat, vtBoolean);
    26 type TVariableType = (vtCommand, vtLongInt, vthwFloat, vtBoolean);
    27      TCommandHandler = procedure (var params: shortstring);
    27      TCommandHandler = procedure (var params: shortstring);
    28 
    28 
    29 procedure init_uConsole;
    29 procedure initModule;
    30 procedure free_uConsole;
    30 procedure freeModule;
    31 procedure WriteToConsole(s: shortstring);
    31 procedure WriteToConsole(s: shortstring);
    32 procedure WriteLnToConsole(s: shortstring);
    32 procedure WriteLnToConsole(s: shortstring);
    33 procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean);
    33 procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean);
    34 procedure StopMessages(Message: Longword);
    34 procedure StopMessages(Message: Longword);
    35 function  GetLastConsoleLine: shortstring;
    35 function  GetLastConsoleLine: shortstring;
   209 if (Message and gm_Down) <> 0 then ParseCommand('/-down', true) else
   209 if (Message and gm_Down) <> 0 then ParseCommand('/-down', true) else
   210 if (Message and gm_Attack) <> 0 then ParseCommand('/-attack', true)
   210 if (Message and gm_Attack) <> 0 then ParseCommand('/-attack', true)
   211 end;
   211 end;
   212 
   212 
   213 {$INCLUDE "CCHandlers.inc"}
   213 {$INCLUDE "CCHandlers.inc"}
   214 procedure init_uConsole;
   214 procedure initModule;
   215 var i: LongInt;
   215 var i: LongInt;
   216 begin
   216 begin
   217     CurrLine:= 0;
   217     CurrLine:= 0;
   218     Variables:= nil;
   218     Variables:= nil;
   219     isDeveloperMode:= true;
   219     isDeveloperMode:= true;
   307     RegisterVariable('-cur_r'  , vtCommand, @chCurR_m       , true );
   307     RegisterVariable('-cur_r'  , vtCommand, @chCurR_m       , true );
   308     RegisterVariable('flag'    , vtCommand, @chFlag         , false);
   308     RegisterVariable('flag'    , vtCommand, @chFlag         , false);
   309     RegisterVariable('script'  , vtCommand, @chScript       , false);
   309     RegisterVariable('script'  , vtCommand, @chScript       , false);
   310 end;
   310 end;
   311 
   311 
   312 procedure free_uConsole;
   312 procedure freeModule;
   313 begin
   313 begin
   314     FreeVariablesList();
   314     FreeVariablesList();
   315 end;
   315 end;
   316 
   316 
   317 end.
   317 end.