From 6331cc6ab92f6199038ba744bde2c1572260e508 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 30 Apr 2017 19:45:36 +0400 Subject: [PATCH 1/4] Tooltips: level, race, class, specialization layout fixes --- apps/openmw/mwgui/tooltips.cpp | 18 ++++++++--- files/mygui/openmw_stats_window.layout | 4 +-- files/mygui/openmw_tooltips.layout | 45 +++++++++++++++++++------- 3 files changed, 48 insertions(+), 19 deletions(-) diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 712caea39..9b6a3bb70 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -709,20 +709,28 @@ namespace MWGui void ToolTips::createSpecializationToolTip(MyGUI::Widget* widget, const std::string& name, int specId) { - widget->setUserString("Caption_CenteredCaption", name); + widget->setUserString("Caption_Caption", name); std::string specText; // get all skills of this specialisation const MWWorld::Store &skills = MWBase::Environment::get().getWorld()->getStore().get(); + bool isFirst = true; MWWorld::Store::iterator it = skills.begin(); for (; it != skills.end(); ++it) { if (it->second.mData.mSpecialization == specId) - specText += std::string("\n#{") + ESM::Skill::sSkillNameIds[it->first] + "}"; + { + if (isFirst) + isFirst = false; + else + specText += "\n"; + + specText += std::string("#{") + ESM::Skill::sSkillNameIds[it->first] + "}"; + } } - widget->setUserString("Caption_CenteredCaptionText", specText); - widget->setUserString("ToolTipLayout", "TextWithCenteredCaptionToolTip"); + widget->setUserString("Caption_ColumnText", specText); + widget->setUserString("ToolTipLayout", "SpecializationToolTip"); widget->setUserString("ToolTipType", "Layout"); } @@ -795,7 +803,7 @@ namespace MWGui widget->setUserString("Caption_CenteredCaption", playerRace->mName); widget->setUserString("Caption_CenteredCaptionText", playerRace->mDescription); widget->setUserString("ToolTipType", "Layout"); - widget->setUserString("ToolTipLayout", "TextWithCenteredCaptionToolTip"); + widget->setUserString("ToolTipLayout", "RaceToolTip"); } void ToolTips::createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playerClass) diff --git a/files/mygui/openmw_stats_window.layout b/files/mygui/openmw_stats_window.layout index d9860ae20..098b3c2d8 100644 --- a/files/mygui/openmw_stats_window.layout +++ b/files/mygui/openmw_stats_window.layout @@ -87,12 +87,12 @@ - + - + diff --git a/files/mygui/openmw_tooltips.layout b/files/mygui/openmw_tooltips.layout index 6d4421702..3a2bce94a 100644 --- a/files/mygui/openmw_tooltips.layout +++ b/files/mygui/openmw_tooltips.layout @@ -29,16 +29,33 @@ - - + + - + + - + + + + + + + + + + + + + + + + + @@ -46,15 +63,16 @@ - + - + + - + @@ -204,15 +222,18 @@ - - + + + + + - - - + + + From 27181367e29bb90e59c0a0d6c408a66341256c57 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 30 Apr 2017 21:26:13 +0400 Subject: [PATCH 2/4] Tooltips: skills and attributes layout fixes --- files/mygui/openmw_tooltips.layout | 41 ++++++++++++++++++------------ 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/files/mygui/openmw_tooltips.layout b/files/mygui/openmw_tooltips.layout index 3a2bce94a..2d7d514eb 100644 --- a/files/mygui/openmw_tooltips.layout +++ b/files/mygui/openmw_tooltips.layout @@ -123,20 +123,21 @@ - + - + + - + - + @@ -144,9 +145,9 @@ - + - + @@ -154,30 +155,35 @@ - + - + - + + + + - + + + - + @@ -191,9 +197,9 @@ - + - + @@ -202,22 +208,25 @@ - + - + - + + + + From 987677db75c6078207de48f52ca28182ff3b4a53 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 30 Apr 2017 22:39:05 +0400 Subject: [PATCH 3/4] Tooltips: dynamic stats, birthsign and hand-to-hand layout fixes --- apps/openmw/mwgui/hud.cpp | 2 +- apps/openmw/mwgui/review.cpp | 6 +++--- apps/openmw/mwgui/statswindow.cpp | 2 +- apps/openmw/mwgui/tooltips.cpp | 2 +- files/mygui/openmw_tooltips.layout | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 7ce2dfa8b..84e5794e3 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -183,7 +183,7 @@ namespace MWGui int modified = static_cast(value.getModified()); MyGUI::Widget* w; - std::string valStr = MyGUI::utility::toString(current) + "/" + MyGUI::utility::toString(modified); + std::string valStr = MyGUI::utility::toString(current) + " / " + MyGUI::utility::toString(modified); if (id == "HBar") { mHealth->setProgressRange(modified); diff --git a/apps/openmw/mwgui/review.cpp b/apps/openmw/mwgui/review.cpp index 11d79e307..1a680b801 100644 --- a/apps/openmw/mwgui/review.cpp +++ b/apps/openmw/mwgui/review.cpp @@ -164,7 +164,7 @@ namespace MWGui int modified = static_cast(value.getModified()); mHealth->setValue(current, modified); - std::string valStr = MyGUI::utility::toString(current) + "/" + MyGUI::utility::toString(modified); + std::string valStr = MyGUI::utility::toString(current) + " / " + MyGUI::utility::toString(modified); mHealth->setUserString("Caption_HealthDescription", "#{sHealthDesc}\n" + valStr); } @@ -174,7 +174,7 @@ namespace MWGui int modified = static_cast(value.getModified()); mMagicka->setValue(current, modified); - std::string valStr = MyGUI::utility::toString(current) + "/" + MyGUI::utility::toString(modified); + std::string valStr = MyGUI::utility::toString(current) + " / " + MyGUI::utility::toString(modified); mMagicka->setUserString("Caption_HealthDescription", "#{sMagDesc}\n" + valStr); } @@ -184,7 +184,7 @@ namespace MWGui int modified = static_cast(value.getModified()); mFatigue->setValue(current, modified); - std::string valStr = MyGUI::utility::toString(current) + "/" + MyGUI::utility::toString(modified); + std::string valStr = MyGUI::utility::toString(current) + " / " + MyGUI::utility::toString(modified); mFatigue->setUserString("Caption_HealthDescription", "#{sFatDesc}\n" + valStr); } diff --git a/apps/openmw/mwgui/statswindow.cpp b/apps/openmw/mwgui/statswindow.cpp index 780e4905e..ce7ac915c 100644 --- a/apps/openmw/mwgui/statswindow.cpp +++ b/apps/openmw/mwgui/statswindow.cpp @@ -154,7 +154,7 @@ namespace MWGui // health, magicka, fatigue tooltip MyGUI::Widget* w; - std::string valStr = MyGUI::utility::toString(current) + "/" + MyGUI::utility::toString(modified); + std::string valStr = MyGUI::utility::toString(current) + " / " + MyGUI::utility::toString(modified); if (id == "HBar") { getWidget(w, "Health"); diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 9b6a3bb70..fad78d9a6 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -785,7 +785,7 @@ namespace MWGui { if (it == categories[category].spells.begin()) { - text += std::string("\n#{fontcolourhtml=header}") + std::string("#{") + categories[category].label + "}"; + text += std::string("\n\n#{fontcolourhtml=header}") + std::string("#{") + categories[category].label + "}"; } const std::string &spellId = *it; diff --git a/files/mygui/openmw_tooltips.layout b/files/mygui/openmw_tooltips.layout index 2d7d514eb..3d40b3260 100644 --- a/files/mygui/openmw_tooltips.layout +++ b/files/mygui/openmw_tooltips.layout @@ -86,7 +86,7 @@ - + @@ -102,9 +102,9 @@ - + - + @@ -115,7 +115,7 @@ - + From 26ec467df07c060154e70460c451bf9acb783497 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 1 May 2017 10:00:51 +0400 Subject: [PATCH 4/4] Tooltips: faction, magic effects layout fixes --- apps/openmw/mwgui/statswindow.cpp | 6 +++--- files/mygui/openmw_tooltips.layout | 28 ++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/apps/openmw/mwgui/statswindow.cpp b/apps/openmw/mwgui/statswindow.cpp index ce7ac915c..22140b8b2 100644 --- a/apps/openmw/mwgui/statswindow.cpp +++ b/apps/openmw/mwgui/statswindow.cpp @@ -618,13 +618,13 @@ namespace MWGui if (rankData.mSkill1 > 0) text += "\n#{sNeedOneSkill} " + MyGUI::utility::toString(rankData.mSkill1); if (rankData.mSkill2 > 0) - text += "\n#{sNeedTwoSkills} " + MyGUI::utility::toString(rankData.mSkill2); + text += " #{sand} #{sNeedTwoSkills} " + MyGUI::utility::toString(rankData.mSkill2); } } w->setUserString("ToolTipType", "Layout"); - w->setUserString("ToolTipLayout", "TextToolTip"); - w->setUserString("Caption_Text", text); + w->setUserString("ToolTipLayout", "FactionToolTip"); + w->setUserString("Caption_FactionText", text); } } diff --git a/files/mygui/openmw_tooltips.layout b/files/mygui/openmw_tooltips.layout index 3d40b3260..a7eeabfa5 100644 --- a/files/mygui/openmw_tooltips.layout +++ b/files/mygui/openmw_tooltips.layout @@ -18,11 +18,23 @@ - + - + - + + + + + + + + + + + + + @@ -263,9 +275,9 @@ - + - + @@ -274,13 +286,13 @@ - + - + @@ -288,7 +300,7 @@ - +