diff --git a/source/glest_game/facilities/components.cpp b/source/glest_game/facilities/components.cpp index cc719596..48514707 100644 --- a/source/glest_game/facilities/components.cpp +++ b/source/glest_game/facilities/components.cpp @@ -538,6 +538,7 @@ const int GraphicMessageBox::defW= 350; GraphicMessageBox::GraphicMessageBox(std::string containerName, std::string objName) : GraphicComponent(containerName, objName){ header= ""; + autoWordWrap=true; } GraphicMessageBox::~GraphicMessageBox(){ diff --git a/source/glest_game/facilities/components.h b/source/glest_game/facilities/components.h index 327bde31..31905876 100644 --- a/source/glest_game/facilities/components.h +++ b/source/glest_game/facilities/components.h @@ -276,6 +276,7 @@ public: private: GraphicButtons buttons; string header; + bool autoWordWrap; private: void alignButtons(); @@ -288,6 +289,9 @@ public: void removeButtons(); void addButton(const string &buttonStr, int width=-1,int height=-1); + bool getAutoWordWrap() const { return autoWordWrap; } + void setAutoWordWrap(bool value) { autoWordWrap = value; } + int getButtonCount() const {return buttons.size();} GraphicButton *getButton(int index) {return buttons[index];} string getHeader() const {return header;} diff --git a/source/glest_game/game/script_manager.cpp b/source/glest_game/game/script_manager.cpp index b34bd7e7..79de8173 100644 --- a/source/glest_game/game/script_manager.cpp +++ b/source/glest_game/game/script_manager.cpp @@ -408,6 +408,7 @@ void ScriptManager::init(World* world, GameCamera *gameCamera, const XmlNode *ro //setup message box messageBox.init( Lang::getInstance().get("Ok") ); messageBox.setEnabled(false); + messageBox.setAutoWordWrap(false); //last created unit lastCreatedUnitId= -1; diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index 02cff239..c4863efc 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -3531,11 +3531,13 @@ void Renderer::renderMessageBox(GraphicMessageBox *messageBox) { } string wrappedText = messageBox->getText(); - if(renderText3DEnabled == false) { - wrappedText = messageBox->getFont()->getMetrics()->wordWrapText(wrappedText,messageBox->getW() * 0.90); - } - else { - wrappedText = messageBox->getFont3D()->getMetrics()->wordWrapText(wrappedText,messageBox->getW() * 0.90); + if(messageBox->getAutoWordWrap() == true) { + if(renderText3DEnabled == false) { + wrappedText = messageBox->getFont()->getMetrics()->wordWrapText(wrappedText,messageBox->getW() * 0.90); + } + else { + wrappedText = messageBox->getFont3D()->getMetrics()->wordWrapText(wrappedText,messageBox->getW() * 0.90); + } } //background