From 6331cc6ab92f6199038ba744bde2c1572260e508 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 30 Apr 2017 19:45:36 +0400 Subject: [PATCH 1/6] 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/6] 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/6] 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/6] 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 @@ - + From 46c88428088b3e2892c5e24a42bc8f3820cc664a Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 26 May 2017 23:42:11 +0400 Subject: [PATCH 5/6] Fixed enchant points calculations formula --- apps/openmw/mwmechanics/enchanting.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwmechanics/enchanting.cpp b/apps/openmw/mwmechanics/enchanting.cpp index 714b5a09c..a658c379a 100644 --- a/apps/openmw/mwmechanics/enchanting.cpp +++ b/apps/openmw/mwmechanics/enchanting.cpp @@ -172,14 +172,14 @@ namespace MWMechanics const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); std::vector mEffects = mEffectList.mList; - float enchantmentCost = 0; - int effectsLeftCnt = mEffects.size(); + int enchantmentCost = 0; + float cost = 0; for (std::vector::const_iterator it = mEffects.begin(); it != mEffects.end(); ++it) { float baseCost = (store.get().find(it->mEffectID))->mData.mBaseCost; - int magMin = (it->mMagnMin == 0) ? 1 : it->mMagnMin; - int magMax = (it->mMagnMax == 0) ? 1 : it->mMagnMax; - int area = (it->mArea == 0) ? 1 : it->mArea; + int magMin = std::max(1, it->mMagnMin); + int magMax = std::max(1, it->mMagnMax); + int area = std::max(1, it->mArea); float magnitudeCost = (magMin + magMax) * baseCost * 0.05f; if (mCastStyle == ESM::Enchantment::ConstantEffect) @@ -195,16 +195,17 @@ namespace MWMechanics const float fEffectCostMult = store.get().find("fEffectCostMult")->getFloat(); - float cost = (magnitudeCost + areaCost) * fEffectCostMult; + cost += (magnitudeCost + areaCost) * fEffectCostMult; + + cost = std::max(1.f, cost); + if (it->mRange == ESM::RT_Target) cost *= 1.5; - enchantmentCost += cost * effectsLeftCnt; - enchantmentCost = std::max(1.f, enchantmentCost); - --effectsLeftCnt; + enchantmentCost += static_cast(cost); } - return static_cast(enchantmentCost); + return enchantmentCost; } From 5d85fa922075a67a64bf7122dc5d21c2cda60410 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 28 May 2017 17:30:01 +0200 Subject: [PATCH 6/6] Fix build with osg >= 3.5.6 --- components/resource/bulletshapemanager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/resource/bulletshapemanager.cpp b/components/resource/bulletshapemanager.cpp index ef35b31ef..010917572 100644 --- a/components/resource/bulletshapemanager.cpp +++ b/components/resource/bulletshapemanager.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include @@ -42,7 +43,11 @@ struct GetTriangleFunctor return btVector3(vec.x(), vec.y(), vec.z()); } +#if OSG_MIN_VERSION_REQUIRED(3,5,6) + void inline operator()( const osg::Vec3 v1, const osg::Vec3 v2, const osg::Vec3 v3 ) +#else void inline operator()( const osg::Vec3 v1, const osg::Vec3 v2, const osg::Vec3 v3, bool _temp ) +#endif { if (mTriMesh) mTriMesh->addTriangle( toBullet(mMatrix.preMult(v1)), toBullet(mMatrix.preMult(v2)), toBullet(mMatrix.preMult(v3)));