mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 15:45:35 +00:00
Merge pull request #3036 from akortunov/tooltip
Enhance level-up tooltip
This commit is contained in:
commit
a7cbe0b497
2 changed files with 8 additions and 4 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <MyGUI_ProgressBar.h>
|
||||
#include <MyGUI_ImageBox.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
#include <MyGUI_LanguageManager.h>
|
||||
#include <MyGUI_Gui.h>
|
||||
|
||||
#include <components/settings/settings.hpp>
|
||||
|
@ -336,14 +337,16 @@ namespace MWGui
|
|||
int max = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iLevelUpTotal")->mValue.getInteger();
|
||||
getWidget(levelWidget, i==0 ? "Level_str" : "LevelText");
|
||||
|
||||
std::string detail;
|
||||
std::stringstream detail;
|
||||
for (int i = 0; i < ESM::Attribute::Length; ++i)
|
||||
{
|
||||
if (auto increase = PCstats.getLevelUpAttributeIncrease(i))
|
||||
detail += (detail.empty() ? "" : "\n") + ESM::Attribute::sAttributeNames[i] + " x" + MyGUI::utility::toString(increase);
|
||||
detail << (detail.str().empty() ? "" : "\n") << "#{"
|
||||
<< MyGUI::TextIterator::toTagsString(ESM::Attribute::sGmstAttributeIds[i])
|
||||
<< "} x" << MyGUI::utility::toString(increase);
|
||||
}
|
||||
if (!detail.empty())
|
||||
levelWidget->setUserString("Caption_LevelDetailText", detail);
|
||||
if (!detail.str().empty())
|
||||
levelWidget->setUserString("Caption_LevelDetailText", MyGUI::LanguageManager::getInstance().replaceTags(detail.str()));
|
||||
levelWidget->setUserString("RangePosition_LevelProgress", MyGUI::utility::toString(PCstats.getLevelProgress()));
|
||||
levelWidget->setUserString("Range_LevelProgress", MyGUI::utility::toString(max));
|
||||
levelWidget->setUserString("Caption_LevelProgressText", MyGUI::utility::toString(PCstats.getLevelProgress()) + "/"
|
||||
|
|
|
@ -272,6 +272,7 @@
|
|||
<Property key="AutoResize" value="true"/>
|
||||
<Property key="MultiLine" value="true"/>
|
||||
<Property key="Shrink" value="true"/>
|
||||
<Property key="TextAlign" value="HCenter Top"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
|
|
Loading…
Reference in a new issue