--- 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);
--- a/hedgewars/uTypes.pas Thu Apr 07 13:26:56 2011 +0200
+++ b/hedgewars/uTypes.pas Thu Apr 07 11:30:56 2011 -0400
@@ -141,7 +141,7 @@
THWFont = (fnt16, fntBig, fntSmall {$IFNDEF IPHONEOS}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF});
TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume,
- capgrpMessage, capgrpAmmostate);
+ capgrpMessage, capgrpMessage2, capgrpAmmostate);
TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs,
siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage,
--- a/hedgewars/uUtils.pas Thu Apr 07 13:26:56 2011 +0200
+++ b/hedgewars/uUtils.pas Thu Apr 07 11:30:56 2011 -0400
@@ -31,6 +31,7 @@
function EnumToStr(const en : TSound) : shortstring; overload;
function EnumToStr(const en : TAmmoType) : shortstring; overload;
function EnumToStr(const en : THogEffect) : shortstring; overload;
+function EnumToStr(const en : TCapGroup) : shortstring; overload;
function Min(a, b: LongInt): LongInt; inline;
function Max(a, b: LongInt): LongInt; inline;
@@ -118,7 +119,12 @@
function EnumToStr(const en: THogEffect) : shortstring; overload;
begin
- EnumToStr := GetEnumName(TypeInfo(THogEffect), ord(en))
+EnumToStr := GetEnumName(TypeInfo(THogEffect), ord(en))
+end;
+
+function EnumToStr(const en: TCapGroup) : shortstring; overload;
+begin
+EnumToStr := GetEnumName(TypeInfo(TCapGroup), ord(en))
end;