Lua: Fix incorrect values for capcolDefault, capcolSetting
authorWuzzy <Wuzzy2@mail.ru>
Mon, 17 Jun 2019 21:43:05 +0200
changeset 15182 a22013a817e4
parent 15181 f6115638aa92
child 15183 d3998dcc076f
Lua: Fix incorrect values for capcolDefault, capcolSetting
hedgewars/uConsts.pas
hedgewars/uScript.pas
--- a/hedgewars/uConsts.pas	Wed Jun 19 02:40:00 2019 +0300
+++ b/hedgewars/uConsts.pas	Mon Jun 17 21:43:05 2019 +0200
@@ -78,6 +78,8 @@
 
     capcolDefault         : Longword = $FFFFFFFF; // default caption color
     capcolSetting         : Longword = $FFCCCCCC; // caption color for changing client setting like volume or auto camera
+    capcolDefaultLua      : Longword = $FFFFFFFF; // capcolDefault for Lua
+    capcolSettingLua      : Longword = $CCCCCCFF; // capcolSetting for Lua
 
     cCentralMessageColor  : Longword = $FFFFFF00; // color of message in center of screen like quit or pause
 
--- a/hedgewars/uScript.pas	Wed Jun 19 02:40:00 2019 +0300
+++ b/hedgewars/uScript.pas	Mon Jun 17 21:43:05 2019 +0200
@@ -3660,6 +3660,12 @@
     lua_setglobal(luaState, Str2PChar(name));
 end;
 
+procedure ScriptSetLongWord(name : shortstring; value : LongWord);
+begin
+    lua_pushnumber(luaState, value);
+    lua_setglobal(luaState, Str2PChar(name));
+end;
+
 procedure ScriptSetString(name : shortstring; value : shortstring);
 begin
     lua_pushstring(luaState, Str2PChar(value));
@@ -4369,8 +4375,8 @@
 for we:= Low(TWorldEdge) to High(TWorldEdge) do
     ScriptSetInteger(EnumToStr(we), ord(we));
 
-ScriptSetInteger('capcolDefault'    , capcolDefault);
-ScriptSetInteger('capcolSetting'    , capcolSetting);
+ScriptSetLongWord('capcolDefault'   , capcolDefaultLua);
+ScriptSetLongWord('capcolSetting'   , capcolSettingLua);
 
 ScriptSetInteger('gstDrowning'      , gstDrowning);
 ScriptSetInteger('gstHHDriven'      , gstHHDriven);