hedgewars/uScript.pas
changeset 2905 f3c79f7193a9
parent 2862 1d15ca7b7f64
child 2924 908851e59958
--- a/hedgewars/uScript.pas	Mon Mar 01 19:20:43 2010 +0000
+++ b/hedgewars/uScript.pas	Mon Mar 01 19:54:33 2010 +0000
@@ -24,14 +24,14 @@
 procedure ScriptPrintStack;
 procedure ScriptClearStack;
 
-procedure ScriptLoad(name : string);
+procedure ScriptLoad(name : shortstring);
 procedure ScriptOnGameInit;
 
-procedure ScriptCall(fname : string);
-function ScriptCall(fname : string; par1: LongInt) : LongInt;
-function ScriptCall(fname : string; par1, par2: LongInt) : LongInt;
-function ScriptCall(fname : string; par1, par2, par3: LongInt) : LongInt;
-function ScriptCall(fname : string; par1, par2, par3, par4 : LongInt) : LongInt;
+procedure ScriptCall(fname : shortstring);
+function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1, par2: LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1, par2, par3: LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1, par2, par3, par4 : LongInt) : LongInt;
 
 procedure init_uScript;
 procedure free_uScript;
@@ -52,7 +52,7 @@
 	typinfo;
 	
 var luaState : Plua_State;
-	ScriptAmmoStore : string;
+	ScriptAmmoStore : shortstring;
 	ScriptLoaded : boolean;
 	
 procedure ScriptPrepareAmmoStore; forward;
@@ -306,26 +306,26 @@
 lua_settop(luaState, 0)
 end;
 
-procedure ScriptSetInteger(name : string; value : LongInt);
+procedure ScriptSetInteger(name : shortstring; value : LongInt);
 begin
 lua_pushinteger(luaState, value);
 lua_setglobal(luaState, Str2PChar(name));
 end;
 
-procedure ScriptSetString(name : string; value : string);
+procedure ScriptSetString(name : shortstring; value : shortstring);
 begin
 lua_pushstring(luaState, Str2PChar(value));
 lua_setglobal(luaState, Str2PChar(name));
 end;
 
-function ScriptGetInteger(name : string) : LongInt;
+function ScriptGetInteger(name : shortstring) : LongInt;
 begin
 lua_getglobal(luaState, Str2PChar(name));
 ScriptGetInteger:= lua_tointeger(luaState, -1);
 lua_pop(luaState, 1);
 end;
 
-function ScriptGetString(name : string) : string;
+function ScriptGetString(name : shortstring) : shortstring;
 begin
 lua_getglobal(luaState, Str2PChar(name));
 ScriptGetString:= lua_tostring(luaState, -1);
@@ -367,7 +367,7 @@
 	ScriptApplyAmmoStore;
 end;
 
-procedure ScriptLoad(name : string);
+procedure ScriptLoad(name : shortstring);
 var ret : LongInt;
 begin
 	ret:= luaL_loadfile(luaState, Str2PChar(name));
@@ -392,7 +392,7 @@
 	TurnTimeLeft:= ScriptGetInteger('TurnTimeLeft');
 end;
 
-procedure ScriptCall(fname : string);
+procedure ScriptCall(fname : shortstring);
 begin
 	if not ScriptLoaded then
 		exit;
@@ -406,22 +406,22 @@
 	GetGlobals;
 end;
 
-function ScriptCall(fname : string; par1: LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
 begin
 ScriptCall:= ScriptCall(fname, par1, 0, 0, 0)
 end;
 
-function ScriptCall(fname : string; par1, par2: LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1, par2: LongInt) : LongInt;
 begin
 ScriptCall:= ScriptCall(fname, par1, par2, 0, 0)
 end;
 
-function ScriptCall(fname : string; par1, par2, par3: LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1, par2, par3: LongInt) : LongInt;
 begin
 ScriptCall:= ScriptCall(fname, par1, par2, par3, 0)
 end;
 
-function ScriptCall(fname : string; par1, par2, par3, par4 : LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1, par2, par3, par4 : LongInt) : LongInt;
 begin
 	if not ScriptLoaded then
 		exit;
@@ -467,17 +467,17 @@
 end;
 
 // small helper functions making registering enums a lot easier
-function str(const en : TGearType) : string; overload;
+function str(const en : TGearType) : shortstring; overload;
 begin
 str:= GetEnumName(TypeInfo(TGearType), ord(en))
 end;
 
-function str(const en : TSound) : string; overload;
+function str(const en : TSound) : shortstring; overload;
 begin
 str:= GetEnumName(TypeInfo(TSound), ord(en))
 end;
 
-function str(const en : TAmmoType) : string; overload;
+function str(const en : TAmmoType) : shortstring; overload;
 begin
 str:= GetEnumName(TypeInfo(TAmmoType), ord(en))
 end;
@@ -564,7 +564,7 @@
 begin
 end;
 
-procedure ScriptLoad(name : string);
+procedure ScriptLoad(name : shortstring);
 begin
 end;
 
@@ -572,26 +572,26 @@
 begin
 end;
 
-procedure ScriptCall(fname : string);
+procedure ScriptCall(fname : shortstring);
 begin
 end;
 
-function ScriptCall(fname : string; par1, par2, par3, par4 : LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1, par2, par3, par4 : LongInt) : LongInt;
 begin
 ScriptCall:= 0
 end;
 
-function ScriptCall(fname : string; par1: LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
 begin
 ScriptCall:= 0
 end;
 
-function ScriptCall(fname : string; par1, par2: LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1, par2: LongInt) : LongInt;
 begin
 ScriptCall:= 0
 end;
 
-function ScriptCall(fname : string; par1, par2, par3: LongInt) : LongInt;
+function ScriptCall(fname : shortstring; par1, par2, par3: LongInt) : LongInt;
 begin
 ScriptCall:= 0
 end;