hedgewars/uScript.pas
changeset 13976 2828ec67c47c
parent 13954 cc312e22592b
child 14037 bf8b7c166b3c
equal deleted inserted replaced
13975:350adfa0e896 13976:2828ec67c47c
  2192                 end;
  2192                 end;
  2193             end;
  2193             end;
  2194         end;
  2194         end;
  2195     lc_playsound:= 0;
  2195     lc_playsound:= 0;
  2196 end;
  2196 end;
       
  2197 
       
  2198 function lc_playmusicsound(L : Plua_State) : LongInt; Cdecl;
       
  2199 var s: LongInt;
       
  2200 const
       
  2201     call = 'PlayMusicSound';
       
  2202     params = 'soundId';
       
  2203 begin
       
  2204     if CheckLuaParamCount(L, 1, call, params) then
       
  2205         begin
       
  2206         s:= LuaToSoundOrd(L, 1, call, params);
       
  2207         if s >= 0 then
       
  2208             PlayMusicSound(TSound(s))
       
  2209         end;
       
  2210     lc_playmusicsound:= 0;
       
  2211 end;
       
  2212 
       
  2213 function lc_stopmusicsound(L : Plua_State) : LongInt; Cdecl;
       
  2214 var s: LongInt;
       
  2215 const
       
  2216     call = 'StopMusicSound';
       
  2217     params = 'soundId';
       
  2218 begin
       
  2219     if CheckLuaParamCount(L, 1, call, params) then
       
  2220         begin
       
  2221         s:= LuaToSoundOrd(L, 1, call, params);
       
  2222         if s >= 0 then
       
  2223             StopMusicSound(TSound(s))
       
  2224         end;
       
  2225     lc_stopmusicsound:= 0;
       
  2226 end;
       
  2227 
  2197 
  2228 
  2198 function lc_setsoundmask(L : Plua_State) : LongInt; Cdecl;
  2229 function lc_setsoundmask(L : Plua_State) : LongInt; Cdecl;
  2199 var s: LongInt;
  2230 var s: LongInt;
  2200     soundState: boolean;
  2231     soundState: boolean;
  2201 const
  2232 const
  4187 lua_register(luaState, _P'AddCaption', @lc_addcaption);
  4218 lua_register(luaState, _P'AddCaption', @lc_addcaption);
  4188 lua_register(luaState, _P'SetAmmo', @lc_setammo);
  4219 lua_register(luaState, _P'SetAmmo', @lc_setammo);
  4189 lua_register(luaState, _P'GetAmmo', @lc_getammo);
  4220 lua_register(luaState, _P'GetAmmo', @lc_getammo);
  4190 lua_register(luaState, _P'SetAmmoDelay', @lc_setammodelay);
  4221 lua_register(luaState, _P'SetAmmoDelay', @lc_setammodelay);
  4191 lua_register(luaState, _P'PlaySound', @lc_playsound);
  4222 lua_register(luaState, _P'PlaySound', @lc_playsound);
       
  4223 lua_register(luaState, _P'PlayMusicSound', @lc_playmusicsound);
       
  4224 lua_register(luaState, _P'StopMusicSound', @lc_stopmusicsound);
  4192 lua_register(luaState, _P'SetSoundMask', @lc_setsoundmask);
  4225 lua_register(luaState, _P'SetSoundMask', @lc_setsoundmask);
  4193 lua_register(luaState, _P'GetTeamName', @lc_getteamname);
  4226 lua_register(luaState, _P'GetTeamName', @lc_getteamname);
  4194 lua_register(luaState, _P'GetTeamIndex', @lc_getteamindex);
  4227 lua_register(luaState, _P'GetTeamIndex', @lc_getteamindex);
  4195 lua_register(luaState, _P'GetTeamClan', @lc_getteamclan);
  4228 lua_register(luaState, _P'GetTeamClan', @lc_getteamclan);
  4196 lua_register(luaState, _P'AddTeam', @lc_addteam);
  4229 lua_register(luaState, _P'AddTeam', @lc_addteam);