hedgewars/uScript.pas
changeset 8366 67c7ba2b82a3
parent 8228 8cc5dc7f7ef9
child 8368 6feae8073965
equal deleted inserted replaced
8365:fbd799a1e95b 8366:67c7ba2b82a3
    35 procedure ScriptClearStack;
    35 procedure ScriptClearStack;
    36 
    36 
    37 procedure ScriptLoad(name : shortstring);
    37 procedure ScriptLoad(name : shortstring);
    38 procedure ScriptOnGameInit;
    38 procedure ScriptOnGameInit;
    39 procedure ScriptOnScreenResize;
    39 procedure ScriptOnScreenResize;
       
    40 procedure ScriptSetInteger(name : shortstring; value : LongInt);
    40 
    41 
    41 procedure ScriptCall(fname : shortstring);
    42 procedure ScriptCall(fname : shortstring);
    42 function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
    43 function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
    43 function ScriptCall(fname : shortstring; par1, par2: LongInt) : LongInt;
    44 function ScriptCall(fname : shortstring; par1, par2: LongInt) : LongInt;
    44 function ScriptCall(fname : shortstring; par1, par2, par3: LongInt) : LongInt;
    45 function ScriptCall(fname : shortstring; par1, par2, par3: LongInt) : LongInt;
   222     L:= L; // avoid compiler hint
   223     L:= L; // avoid compiler hint
   223     HideMission;
   224     HideMission;
   224     lc_hidemission:= 0;
   225     lc_hidemission:= 0;
   225 end;
   226 end;
   226 
   227 
       
   228 function lc_enablegameflags(L : Plua_State) : LongInt; Cdecl;
       
   229 var i : integer;
       
   230 begin
       
   231     for i:= 1 to lua_gettop(L) do
       
   232         if (GameFlags and lua_tointeger(L, i)) = 0 then
       
   233             GameFlags += lua_tointeger(L, i);
       
   234     ScriptSetInteger('GameFlags', GameFlags);
       
   235 end;
       
   236 
       
   237 function lc_disablegameflags(L : Plua_State) : LongInt; Cdecl;
       
   238 var i : integer;
       
   239 begin
       
   240     for i:= 1 to lua_gettop(L) do
       
   241         if (GameFlags and lua_tointeger(L, i)) <> 0 then
       
   242             GameFlags -= lua_tointeger(L, i);
       
   243     ScriptSetInteger('GameFlags', GameFlags);
       
   244 end;
       
   245 
       
   246 function lc_cleargameflags(L : Plua_State) : LongInt; Cdecl;
       
   247 begin
       
   248     GameFlags:= 0;
       
   249     ScriptSetInteger('GameFlags', GameFlags);
       
   250 end;
       
   251 
   227 function lc_addcaption(L : Plua_State) : LongInt; Cdecl;
   252 function lc_addcaption(L : Plua_State) : LongInt; Cdecl;
   228 begin
   253 begin
   229     if lua_gettop(L) = 1 then
   254     if lua_gettop(L) = 1 then
   230         AddCaption(lua_tostring(L, 1), cWhiteColor, capgrpMessage)
   255         AddCaption(lua_tostring(L, 1), cWhiteColor, capgrpMessage)
   231     else if lua_gettop(L) = 3 then
   256     else if lua_gettop(L) = 3 then
  2333 lua_register(luaState, _P'bnot', @lc_bnot);
  2358 lua_register(luaState, _P'bnot', @lc_bnot);
  2334 lua_register(luaState, _P'div', @lc_div);
  2359 lua_register(luaState, _P'div', @lc_div);
  2335 lua_register(luaState, _P'GetInputMask', @lc_getinputmask);
  2360 lua_register(luaState, _P'GetInputMask', @lc_getinputmask);
  2336 lua_register(luaState, _P'SetInputMask', @lc_setinputmask);
  2361 lua_register(luaState, _P'SetInputMask', @lc_setinputmask);
  2337 lua_register(luaState, _P'AddGear', @lc_addgear);
  2362 lua_register(luaState, _P'AddGear', @lc_addgear);
       
  2363 lua_register(luaState, _P'EnableGameFlags', @lc_enablegameflags);
       
  2364 lua_register(luaState, _P'DisableGameFlags', @lc_disablegameflags);
       
  2365 lua_register(luaState, _P'ClearGameFlags', @lc_cleargameflags);
  2338 lua_register(luaState, _P'DeleteGear', @lc_deletegear);
  2366 lua_register(luaState, _P'DeleteGear', @lc_deletegear);
  2339 lua_register(luaState, _P'AddVisualGear', @lc_addvisualgear);
  2367 lua_register(luaState, _P'AddVisualGear', @lc_addvisualgear);
  2340 lua_register(luaState, _P'DeleteVisualGear', @lc_deletevisualgear);
  2368 lua_register(luaState, _P'DeleteVisualGear', @lc_deletevisualgear);
  2341 lua_register(luaState, _P'GetVisualGearValues', @lc_getvisualgearvalues);
  2369 lua_register(luaState, _P'GetVisualGearValues', @lc_getvisualgearvalues);
  2342 lua_register(luaState, _P'SetVisualGearValues', @lc_setvisualgearvalues);
  2370 lua_register(luaState, _P'SetVisualGearValues', @lc_setvisualgearvalues);