aboutsummaryrefslogtreecommitdiff
path: root/games/openmw/files/patch-apps_openmw_mwgui_tooltips.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'games/openmw/files/patch-apps_openmw_mwgui_tooltips.cpp')
-rw-r--r--games/openmw/files/patch-apps_openmw_mwgui_tooltips.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/games/openmw/files/patch-apps_openmw_mwgui_tooltips.cpp b/games/openmw/files/patch-apps_openmw_mwgui_tooltips.cpp
new file mode 100644
index 000000000000..ccc614df8923
--- /dev/null
+++ b/games/openmw/files/patch-apps_openmw_mwgui_tooltips.cpp
@@ -0,0 +1,38 @@
+--- apps/openmw/mwgui/tooltips.cpp.orig 2023-08-08 09:23:20 UTC
++++ apps/openmw/mwgui/tooltips.cpp
+@@ -168,7 +168,7 @@ namespace MWGui
+ return;
+ }
+
+- std::string type = focus->getUserString("ToolTipType");
++ auto type = focus->getUserString("ToolTipType");
+
+ if (type == "")
+ {
+@@ -224,7 +224,7 @@ namespace MWGui
+ ToolTipInfo info;
+
+ const ESM::Spell *spell =
+- MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(focus->getUserString("Spell"));
++ MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(std::string{focus->getUserString("Spell")});
+ info.caption = spell->mName;
+ Widgets::SpellEffectList effects;
+ for (const ESM::ENAMstruct& spellEffect : spell->mEffects.mList)
+@@ -248,7 +248,7 @@ namespace MWGui
+ int school = MWMechanics::getSpellSchool(spell, player);
+ info.text = "#{sSchool}: " + sSchoolNames[school];
+ }
+- std::string cost = focus->getUserString("SpellCost");
++ auto cost = focus->getUserString("SpellCost");
+ if (cost != "" && cost != "0")
+ info.text += MWGui::ToolTips::getValueString(MWMechanics::calcSpellCost(*spell), "#{sCastCost}");
+ info.effects = effects;
+@@ -262,7 +262,7 @@ namespace MWGui
+
+ tooltip->setVisible(true);
+
+- std::map<std::string, std::string> userStrings = focus->getUserStrings();
++ auto userStrings = focus->getUserStrings();
+ for (auto& userStringPair : userStrings)
+ {
+ size_t underscorePos = userStringPair.first.find('_');