diff -r 71f94af9d1a4 -r 9cfdb9bc6140 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Thu Apr 07 13:26:56 2011 +0200 +++ b/hedgewars/uScript.pas Thu Apr 07 11:30:56 2011 -0400 @@ -180,8 +180,10 @@ function lc_addcaption(L : Plua_State) : LongInt; Cdecl; begin if lua_gettop(L) = 1 then + AddCaption(lua_tostring(L, 1), cWhiteColor, capgrpMessage) + else if lua_gettop(L) = 3 then begin - AddCaption(lua_tostring(L, 1), cWhiteColor, capgrpMessage); + AddCaption(lua_tostring(L, 1), lua_tointeger(L, 2) shr 8, TCapGroup(lua_tointeger(L, 3))); end else LuaError('Lua: Wrong number of parameters passed to AddCaption!'); @@ -1555,7 +1557,8 @@ vgt: TVisualGearType; am : TAmmoType; st : TSound; - he: THogEffect; + he : THogEffect; + cg : TCapGroup; s, t : ansistring; begin // initialize lua @@ -1645,6 +1648,9 @@ for he:= Low(THogEffect) to High(THogEffect) do ScriptSetInteger(EnumToStr(he), ord(he)); +for cg:= Low(TCapGroup) to High(TCapGroup) do + ScriptSetInteger(EnumToStr(cg), ord(cg)); + // register functions lua_register(luaState, 'band', @lc_band); lua_register(luaState, 'bor', @lc_bor);