diff --git a/apps/openmw/mwgui/map_window.cpp b/apps/openmw/mwgui/map_window.cpp index 78ca70798..a44571d0a 100644 --- a/apps/openmw/mwgui/map_window.cpp +++ b/apps/openmw/mwgui/map_window.cpp @@ -102,7 +102,7 @@ MapWindow::MapWindow(WindowManager& parWindowManager) : getWidget(mButton, "WorldButton"); mButton->eventMouseButtonClick += MyGUI::newDelegate(this, &MapWindow::onWorldButtonClicked); - mButton->setCaption(mWindowManager.getGameSettingString("sWorld", "")); + mButton->setCaptionWithReplacing("#{sWorld}"); int width = mButton->getTextSize().width + 24; mButton->setCoord(mMainWidget->getSize().width - width - 22, mMainWidget->getSize().height - 64, width, 22); @@ -172,8 +172,8 @@ void MapWindow::onWorldButtonClicked(MyGUI::Widget* _sender) mGlobalMap->setVisible(mGlobal); mLocalMap->setVisible(!mGlobal); - mButton->setCaption( mGlobal ? mWindowManager.getGameSettingString("sWorld", "") : - mWindowManager.getGameSettingString("sLocal", "")); + mButton->setCaptionWithReplacing( mGlobal ? "#{sLocal}" : + "#{sWorld}"); int width = mButton->getTextSize().width + 24; mButton->setCoord(mMainWidget->getSize().width - width - 22, mMainWidget->getSize().height - 64, width, 22); } diff --git a/apps/openmw/mwgui/stats_window.cpp b/apps/openmw/mwgui/stats_window.cpp index cdf6a5871..54d9d7d4e 100644 --- a/apps/openmw/mwgui/stats_window.cpp +++ b/apps/openmw/mwgui/stats_window.cpp @@ -77,8 +77,6 @@ StatsWindow::StatsWindow (WindowManager& parWindowManager) MyGUI::WindowPtr t = static_cast(mMainWidget); t->eventWindowChangeCoord += MyGUI::newDelegate(this, &StatsWindow::onWindowResize); - - setupToolTips(); } void StatsWindow::onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos) @@ -633,116 +631,3 @@ void StatsWindow::onPinToggled() { mWindowManager.setHMSVisibility(!mPinned); } - -void StatsWindow::setupToolTips() -{ - - const ESMS::ESMStore &store = mWindowManager.getStore(); - MyGUI::Widget* widget; - - /// \todo move this into the .layout file! - - getWidget(widget, "Attrib1"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeStrength")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sStrDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_strength.dds"); - getWidget(widget, "AttribVal1"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeStrength")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sStrDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_strength.dds"); - - getWidget(widget, "Attrib2"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeIntelligence")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sIntDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_int.dds"); - getWidget(widget, "AttribVal2"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeIntelligence")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sIntDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_int.dds"); - - getWidget(widget, "Attrib3"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeWillpower")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sWilDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_wilpower.dds"); - getWidget(widget, "AttribVal3"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeWillpower")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sWilDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_wilpower.dds"); - - getWidget(widget, "Attrib4"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeAgility")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sAgiDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_agility.dds"); - getWidget(widget, "AttribVal4"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeAgility")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sAgiDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_agility.dds"); - - getWidget(widget, "Attrib5"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeSpeed")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sSpdDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_speed.dds"); - getWidget(widget, "AttribVal5"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeSpeed")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sSpdDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_speed.dds"); - - getWidget(widget, "Attrib6"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeEndurance")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sEndDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_endurance.dds"); - getWidget(widget, "AttribVal6"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeEndurance")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sEndDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_endurance.dds"); - - getWidget(widget, "Attrib7"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributePersonality")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sPerDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_personality.dds"); - getWidget(widget, "AttribVal7"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributePersonality")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sPerDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_personality.dds"); - - getWidget(widget, "Attrib8"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeLuck")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sLucDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_luck.dds"); - getWidget(widget, "AttribVal8"); - widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "AttributeToolTip"); - widget->setUserString("Caption_AttributeName", store.gameSettings.find ("sAttributeLuck")->str); - widget->setUserString("Caption_AttributeDescription", store.gameSettings.find ("sLucDesc")->str); - widget->setUserString("ImageTexture_AttributeImage", "icons\\k\\attribute_luck.dds"); -} diff --git a/apps/openmw/mwgui/stats_window.hpp b/apps/openmw/mwgui/stats_window.hpp index 50a83bb29..bbd916585 100644 --- a/apps/openmw/mwgui/stats_window.hpp +++ b/apps/openmw/mwgui/stats_window.hpp @@ -50,8 +50,6 @@ namespace MWGui MyGUI::Widget* addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2); void updateScroller(); - void setupToolTips(); - void setFactions (const FactionList& factions); void setBirthSign (const std::string &signId); diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index 09ea6543a..6be712509 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -608,4 +608,6 @@ void WindowManager::onRetrieveTag(const MyGUI::UString& _tag, MyGUI::UString& _r const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.search(_tag); if (setting && setting->type == ESM::VT_String) _result = setting->str; + else + _result = _tag; } diff --git a/files/mygui/openmw_stats_window_layout.xml b/files/mygui/openmw_stats_window_layout.xml index 4729e3bca..81d70f704 100644 --- a/files/mygui/openmw_stats_window_layout.xml +++ b/files/mygui/openmw_stats_window_layout.xml @@ -99,29 +99,117 @@ - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + +