hedgewars/uScript.pas
changeset 11944 c7ec309cd685
parent 11885 2eac7a96b342
child 11946 7ece39a537bd
--- a/hedgewars/uScript.pas	Sat Nov 19 21:17:48 2016 +0100
+++ b/hedgewars/uScript.pas	Mon May 09 22:49:31 2016 +0200
@@ -550,6 +550,16 @@
     lc_hidemission:= 0;
 end;
 
+function lc_setammotexts(L : Plua_State) : LongInt; Cdecl;
+const
+    call = 'SetAmmoTexts';
+    params = 'ammoType, name, caption, description';
+begin
+    if CheckLuaParamCount(L, 4, call, params) then
+        SetAmmoTexts(TAmmoType(LuaToAmmoTypeOrd(L, 1, call, params)), lua_tostringA(L, 2), lua_tostringA(L, 3), lua_tostringA(L, 4));
+    lc_setammotexts:= 0;
+end;
+
 function lc_enablegameflags(L : Plua_State) : LongInt; Cdecl;
 var i, n : integer;
 begin
@@ -3349,6 +3359,7 @@
 lua_register(luaState, _P'ParseCommand', @lc_parsecommand);
 lua_register(luaState, _P'ShowMission', @lc_showmission);
 lua_register(luaState, _P'HideMission', @lc_hidemission);
+lua_register(luaState, _P'SetAmmoTexts', @lc_setammotexts);
 lua_register(luaState, _P'AddCaption', @lc_addcaption);
 lua_register(luaState, _P'SetAmmo', @lc_setammo);
 lua_register(luaState, _P'SetAmmoDelay', @lc_setammodelay);