diff --git a/apps/openmw/mwgui/statswindow.cpp b/apps/openmw/mwgui/statswindow.cpp index 2a07a16241..edc85e8dfb 100644 --- a/apps/openmw/mwgui/statswindow.cpp +++ b/apps/openmw/mwgui/statswindow.cpp @@ -403,9 +403,24 @@ namespace MWGui mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillDescription", skill->mDescription); mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillAttribute", "#{sGoverningAttribute}: #{" + attr->mName + "}"); mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("ImageTexture_SkillImage", icon); - mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillProgressText", boost::lexical_cast(progressPercent)+"/100"); - mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Range_SkillProgress", "100"); - mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("RangePosition_SkillProgress", boost::lexical_cast(progressPercent)); + if (base < 100) + { + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Visible_SkillMaxed", "false"); + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("UserData^Hidden_SkillMaxed", "true"); + + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Visible_SkillProgressVBox", "true"); + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("UserData^Hidden_SkillProgressVBox", "false"); + + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillProgressText", boost::lexical_cast(progressPercent)+"/100"); + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Range_SkillProgress", "100"); + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("RangePosition_SkillProgress", boost::lexical_cast(progressPercent)); + } else { + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Visible_SkillMaxed", "true"); + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("UserData^Hidden_SkillMaxed", "false"); + + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Visible_SkillProgressVBox", "false"); + mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("UserData^Hidden_SkillProgressVBox", "true"); + } } mSkillWidgetMap[skillId] = widget; diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 2cd86c7b79..154d33d528 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -238,12 +238,23 @@ namespace MWGui size_t underscorePos = it->first.find("_"); if (underscorePos == std::string::npos) continue; - std::string propertyKey = it->first.substr(0, underscorePos); + std::string key = it->first.substr(0, underscorePos); std::string widgetName = it->first.substr(underscorePos+1, it->first.size()-(underscorePos+1)); + std::string type = "Property"; + size_t caretPos = key.find("^"); + if (caretPos != std::string::npos) + { + type = key.substr(0, caretPos); + key.erase(key.begin(), key.begin() + caretPos + 1); + } + MyGUI::Widget* w; getWidget(w, widgetName); - w->setProperty(propertyKey, it->second); + if (type == "Property") + w->setProperty(key, it->second); + else if (type == "UserData") + w->setUserString(key, it->second); } tooltipSize = tooltip->getSize(); diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index de48a9d3e8..41714a9bbd 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -670,7 +670,7 @@ namespace MWGui align(); } - void Box::_setPropertyImpl(const std::string& _key, const std::string& _value) + bool Box::_setPropertyImpl(const std::string& _key, const std::string& _value) { if (_key == "Spacing") mSpacing = MyGUI::utility::parseValue(_value); @@ -678,6 +678,10 @@ namespace MWGui mPadding = MyGUI::utility::parseValue(_value); else if (_key == "AutoResize") mAutoResize = MyGUI::utility::parseValue(_value); + else + return false; + + return true; } void HBox::align () @@ -756,7 +760,8 @@ namespace MWGui void HBox::setPropertyOverride(const std::string& _key, const std::string& _value) { - Box::_setPropertyImpl (_key, _value); + if (!Box::_setPropertyImpl (_key, _value)) + MyGUI::Widget::setPropertyOverride(_key, _value); } void HBox::setSize (const MyGUI::IntSize& _value) @@ -892,7 +897,8 @@ namespace MWGui void VBox::setPropertyOverride(const std::string& _key, const std::string& _value) { - Box::_setPropertyImpl (_key, _value); + if (!Box::_setPropertyImpl (_key, _value)) + MyGUI::Widget::setPropertyOverride(_key, _value); } void VBox::setSize (const MyGUI::IntSize& _value) diff --git a/apps/openmw/mwgui/widgets.hpp b/apps/openmw/mwgui/widgets.hpp index adc56f423f..dad49eb45a 100644 --- a/apps/openmw/mwgui/widgets.hpp +++ b/apps/openmw/mwgui/widgets.hpp @@ -367,7 +367,7 @@ namespace MWGui protected: virtual void align() = 0; - virtual void _setPropertyImpl(const std::string& _key, const std::string& _value); + virtual bool _setPropertyImpl(const std::string& _key, const std::string& _value); int mSpacing; // how much space to put between elements diff --git a/files/mygui/openmw_tooltips.layout b/files/mygui/openmw_tooltips.layout index 3f4fec59f3..d761d90b7e 100644 --- a/files/mygui/openmw_tooltips.layout +++ b/files/mygui/openmw_tooltips.layout @@ -134,15 +134,21 @@ - - + + - - - + + + + + + + + +