From f7423608ce3c5d77f7301a13040a5d7a2b2a3328 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 30 Mar 2012 01:48:41 +0000 Subject: [PATCH] - bugfix for lua strings --- source/glest_game/game/script_manager.cpp | 6 +++--- source/shared_lib/sources/lua/lua_script.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/glest_game/game/script_manager.cpp b/source/glest_game/game/script_manager.cpp index d3aa04d6..33b4ba66 100644 --- a/source/glest_game/game/script_manager.cpp +++ b/source/glest_game/game/script_manager.cpp @@ -680,7 +680,6 @@ void ScriptManager::addConsoleLangText(const char *fmt, ...){ char szBuf[max_debug_buffer_size]=""; vsnprintf(szBuf,max_debug_buffer_size-1,fmt, argList); - //displayText= wrapString(Lang::getInstance().getScenarioString(text), displayTextWrapCount); world->addConsoleTextWoLang(szBuf); va_end(argList); @@ -698,7 +697,6 @@ void ScriptManager::DisplayFormattedText(const char *fmt, ...) { char szBuf[max_debug_buffer_size]=""; vsnprintf(szBuf,max_debug_buffer_size-1,fmt, argList); - //displayText= wrapString(Lang::getInstance().getScenarioString(text), displayTextWrapCount); displayText=szBuf; va_end(argList); @@ -716,7 +714,6 @@ void ScriptManager::DisplayFormattedLangText(const char *fmt, ...) { char szBuf[max_debug_buffer_size]=""; vsnprintf(szBuf,max_debug_buffer_size-1,fmt, argList); - //displayText= wrapString(Lang::getInstance().getScenarioString(text), displayTextWrapCount); displayText=szBuf; va_end(argList); @@ -2062,6 +2059,9 @@ void ScriptManager::saveGame(XmlNode *rootNode) { for(std::list::iterator it = messageQueue.begin(); it != messageQueue.end(); ++it) { (*it).saveGame(scriptManagerNode); } + + //printf("==== ScriptManager Savegame messageBox [%d][%s][%s] displayText [%s]\n",messageBox.getEnabled(),messageBox.getText().c_str(),messageBox.getHeader().c_str(),displayText.c_str()); + // GraphicMessageBox messageBox; scriptManagerNode->addAttribute("messageBox_enabled",intToStr(messageBox.getEnabled()), mapTagReplacements); scriptManagerNode->addAttribute("messageBox_text",messageBox.getText(), mapTagReplacements); diff --git a/source/shared_lib/sources/lua/lua_script.cpp b/source/shared_lib/sources/lua/lua_script.cpp index 3e1fb98a..916aa0c7 100644 --- a/source/shared_lib/sources/lua/lua_script.cpp +++ b/source/shared_lib/sources/lua/lua_script.cpp @@ -283,9 +283,9 @@ void LuaScript::saveGame(XmlNode *rootNode) { } // enclose the value in "" if it is a string - if (value_type == LUA_TSTRING) { - value_string = "\"" + value_string + "\""; - } + //if (value_type == LUA_TSTRING) { + //value_string = "\"" + value_string + "\""; + //} if(skipTable == true) { if(debugLuaDump == true) printf("#2 SKIPPING TABLE\n");