From 6983a55a16db58c882c654766006ac98a83bc7b3 Mon Sep 17 00:00:00 2001 From: Jordan Ayers Date: Sun, 6 Oct 2013 19:32:40 -0500 Subject: [PATCH 1/7] Magic effect display improvement. Related to Bug #794. Show the "x INT" notation for Fortify Max. Magicka. Show "%" notation for weakness / resistance effects. --- apps/openmw/mwgui/spellicons.cpp | 25 ++++++++++++++++++++----- apps/openmw/mwgui/widgets.cpp | 29 ++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 8 deletions(-) diff --git a/apps/openmw/mwgui/spellicons.cpp b/apps/openmw/mwgui/spellicons.cpp index 9812c0f8a9..e7a1f32a4d 100644 --- a/apps/openmw/mwgui/spellicons.cpp +++ b/apps/openmw/mwgui/spellicons.cpp @@ -171,11 +171,26 @@ namespace MWGui if (!(effect->mData.mFlags & ESM::MagicEffect::NoMagnitude)) { - std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", ""); - std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", ""); - - sourcesDescription += ": " + boost::lexical_cast(effectIt->mMagnitude); - sourcesDescription += " " + ((effectIt->mMagnitude > 1) ? pts : pt); + if (it->first == 84) // special handling for fortify maximum magicka + { + std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", ""); + sourcesDescription += " " + boost::lexical_cast(effectIt->mMagnitude / 10.0f) + timesInt; + } + else + { + std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", ""); + std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", ""); + std::string pct = MWBase::Environment::get().getWindowManager()->getGameSettingString("spercent", ""); + const bool usePct = ( + (it->first >= 28 && it->first <= 36) || // Weakness effects + (it->first >= 90 && it->first <= 99) ); // Resistance effects + + sourcesDescription += ": " + boost::lexical_cast(effectIt->mMagnitude) + " "; + if ( usePct ) + sourcesDescription += pct; + else + sourcesDescription += ((effectIt->mMagnitude > 1) ? pts : pt); + } } } diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index dea64ae8cf..d435dd6f93 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -405,6 +405,7 @@ namespace MWGui std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", ""); std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", ""); + std::string pct = MWBase::Environment::get().getWindowManager()->getGameSettingString("spercent", ""); std::string to = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sTo", "") + " "; std::string sec = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("ssecond", ""); std::string secs = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sseconds", ""); @@ -423,11 +424,33 @@ namespace MWGui if ((mEffectParams.mMagnMin >= 0 || mEffectParams.mMagnMax >= 0) && !(magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude)) { - if (mEffectParams.mMagnMin == mEffectParams.mMagnMax) - spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin) + " " + ((mEffectParams.mMagnMin == 1) ? pt : pts); + // Fortify Maximum Magicka display rules: + if ( mEffectParams.mEffectID == 84 ) + { + std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", ""); + std::string times = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimes", ""); + if (mEffectParams.mMagnMin == mEffectParams.mMagnMax) + spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin / 10.0f) + timesInt; + else + { + spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin / 10.0f) + times + " " + to + boost::lexical_cast(mEffectParams.mMagnMax / 10.0f) + timesInt; + } + } else { - spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin) + to + boost::lexical_cast(mEffectParams.mMagnMax) + " " + pts; + const bool usePct = ( + (mEffectParams.mEffectID >= 28 && mEffectParams.mEffectID <= 36) || // Weakness effects + (mEffectParams.mEffectID >= 90 && mEffectParams.mEffectID <= 99) ); // Resistance effects + if (mEffectParams.mMagnMin == mEffectParams.mMagnMax) + spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin) + " "; + else + { + spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin) + to + boost::lexical_cast(mEffectParams.mMagnMax) + " "; + } + if ( usePct ) + spellLine += pct; + else + spellLine += ((mEffectParams.mMagnMin == 1 && mEffectParams.mMagnMax == 1) ? pt : pts ); } } From 707f45aa8e758ef34da14cffc83dbf6c992f4008 Mon Sep 17 00:00:00 2001 From: Jordan Ayers Date: Sun, 6 Oct 2013 19:46:04 -0500 Subject: [PATCH 2/7] Magic Effect Display improvement. Related to Bug #794. Always show one decimal point precision for Fortify Max. Magicka effect. --- apps/openmw/mwgui/spellicons.cpp | 7 ++++++- apps/openmw/mwgui/widgets.cpp | 17 +++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwgui/spellicons.cpp b/apps/openmw/mwgui/spellicons.cpp index e7a1f32a4d..93727ed7fa 100644 --- a/apps/openmw/mwgui/spellicons.cpp +++ b/apps/openmw/mwgui/spellicons.cpp @@ -2,6 +2,9 @@ #include +#include +#include + #include "../mwbase/world.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/windowmanager.hpp" @@ -174,7 +177,9 @@ namespace MWGui if (it->first == 84) // special handling for fortify maximum magicka { std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", ""); - sourcesDescription += " " + boost::lexical_cast(effectIt->mMagnitude / 10.0f) + timesInt; + std::stringstream formatter; + formatter << std::fixed << std::setprecision(1) << " " << (effectIt->mMagnitude / 10.0f) << timesInt; + sourcesDescription += formatter.str(); } else { diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index d435dd6f93..e46838a647 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -2,6 +2,9 @@ #include +#include +#include + #include #include #include @@ -429,12 +432,14 @@ namespace MWGui { std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", ""); std::string times = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimes", ""); - if (mEffectParams.mMagnMin == mEffectParams.mMagnMax) - spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin / 10.0f) + timesInt; - else - { - spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin / 10.0f) + times + " " + to + boost::lexical_cast(mEffectParams.mMagnMax / 10.0f) + timesInt; - } + std::stringstream formatter; + + formatter << std::fixed << std::setprecision(1) << " " << (mEffectParams.mMagnMin / 10.0f); + if (mEffectParams.mMagnMin != mEffectParams.mMagnMax) + formatter << times << " " << to << " " << (mEffectParams.mMagnMax / 10.0f); + formatter << timesInt; + + spellLine += formatter.str(); } else { From 6303e56ce4521fda92bc25dc6bc32b8ad4bdfcbb Mon Sep 17 00:00:00 2001 From: Jordan Ayers Date: Sun, 6 Oct 2013 20:35:59 -0500 Subject: [PATCH 3/7] Magic Effect Display cleanup: Don't put spaces in percentages. --- apps/openmw/mwgui/spellicons.cpp | 4 ++-- apps/openmw/mwgui/widgets.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwgui/spellicons.cpp b/apps/openmw/mwgui/spellicons.cpp index 93727ed7fa..3b30572485 100644 --- a/apps/openmw/mwgui/spellicons.cpp +++ b/apps/openmw/mwgui/spellicons.cpp @@ -190,11 +190,11 @@ namespace MWGui (it->first >= 28 && it->first <= 36) || // Weakness effects (it->first >= 90 && it->first <= 99) ); // Resistance effects - sourcesDescription += ": " + boost::lexical_cast(effectIt->mMagnitude) + " "; + sourcesDescription += ": " + boost::lexical_cast(effectIt->mMagnitude); if ( usePct ) sourcesDescription += pct; else - sourcesDescription += ((effectIt->mMagnitude > 1) ? pts : pt); + sourcesDescription += " " + ((effectIt->mMagnitude > 1) ? pts : pt); } } } diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index e46838a647..e942aa703e 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -447,15 +447,15 @@ namespace MWGui (mEffectParams.mEffectID >= 28 && mEffectParams.mEffectID <= 36) || // Weakness effects (mEffectParams.mEffectID >= 90 && mEffectParams.mEffectID <= 99) ); // Resistance effects if (mEffectParams.mMagnMin == mEffectParams.mMagnMax) - spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin) + " "; + spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin); else { - spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin) + to + boost::lexical_cast(mEffectParams.mMagnMax) + " "; + spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin) + to + boost::lexical_cast(mEffectParams.mMagnMax); } if ( usePct ) spellLine += pct; else - spellLine += ((mEffectParams.mMagnMin == 1 && mEffectParams.mMagnMax == 1) ? pt : pts ); + spellLine += " " + ((mEffectParams.mMagnMin == 1 && mEffectParams.mMagnMax == 1) ? pt : pts ); } } From 065f435225c66bb9b51dd4eb0660d8f081b1b6a4 Mon Sep 17 00:00:00 2001 From: Jordan Ayers Date: Mon, 7 Oct 2013 20:02:20 -0500 Subject: [PATCH 4/7] Format fix: remove extra spaces from ranged TimesINT formatting. --- apps/openmw/mwgui/widgets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index e942aa703e..9278c1a564 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -436,7 +436,7 @@ namespace MWGui formatter << std::fixed << std::setprecision(1) << " " << (mEffectParams.mMagnMin / 10.0f); if (mEffectParams.mMagnMin != mEffectParams.mMagnMax) - formatter << times << " " << to << " " << (mEffectParams.mMagnMax / 10.0f); + formatter << times << to << (mEffectParams.mMagnMax / 10.0f); formatter << timesInt; spellLine += formatter.str(); From 6ab7002908b66098afc260d6ef3a8f235f58ce17 Mon Sep 17 00:00:00 2001 From: Jordan Ayers Date: Mon, 7 Oct 2013 22:28:55 -0500 Subject: [PATCH 5/7] MagicEffect: Put magnitude type into ESM::MagicEffect helper. --- apps/openmw/mwgui/spellicons.cpp | 41 ++++++++++++++------------------ apps/openmw/mwgui/widgets.cpp | 28 ++++++++-------------- components/esm/loadmgef.cpp | 11 +++++++++ components/esm/loadmgef.hpp | 8 +++++++ 4 files changed, 47 insertions(+), 41 deletions(-) diff --git a/apps/openmw/mwgui/spellicons.cpp b/apps/openmw/mwgui/spellicons.cpp index 3b30572485..0e59230c73 100644 --- a/apps/openmw/mwgui/spellicons.cpp +++ b/apps/openmw/mwgui/spellicons.cpp @@ -172,30 +172,25 @@ namespace MWGui MWBase::Environment::get().getWindowManager()->getGameSettingString( ESM::Attribute::sGmstAttributeIds[effectIt->mKey.mArg], "") + ")"; - if (!(effect->mData.mFlags & ESM::MagicEffect::NoMagnitude)) + int displayType = effect->getMagnitudeDisplayType(); + if (displayType == ESM::MagicEffect::MDT_TimesInt) { - if (it->first == 84) // special handling for fortify maximum magicka - { - std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", ""); - std::stringstream formatter; - formatter << std::fixed << std::setprecision(1) << " " << (effectIt->mMagnitude / 10.0f) << timesInt; - sourcesDescription += formatter.str(); - } - else - { - std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", ""); - std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", ""); - std::string pct = MWBase::Environment::get().getWindowManager()->getGameSettingString("spercent", ""); - const bool usePct = ( - (it->first >= 28 && it->first <= 36) || // Weakness effects - (it->first >= 90 && it->first <= 99) ); // Resistance effects - - sourcesDescription += ": " + boost::lexical_cast(effectIt->mMagnitude); - if ( usePct ) - sourcesDescription += pct; - else - sourcesDescription += " " + ((effectIt->mMagnitude > 1) ? pts : pt); - } + std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", ""); + std::stringstream formatter; + formatter << std::fixed << std::setprecision(1) << " " << (effectIt->mMagnitude / 10.0f) << timesInt; + sourcesDescription += formatter.str(); + } + else if ( displayType != ESM::MagicEffect::MDT_None ) + { + std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", ""); + std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", ""); + std::string pct = MWBase::Environment::get().getWindowManager()->getGameSettingString("spercent", ""); + + sourcesDescription += ": " + boost::lexical_cast(effectIt->mMagnitude); + if ( displayType == ESM::MagicEffect::MDT_Percentage ) + sourcesDescription += pct; + else // ESM::MagicEffect::MDT_Points + sourcesDescription += " " + ((effectIt->mMagnitude > 1) ? pts : pt); } } diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index 9278c1a564..f3eda4b226 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -425,11 +425,9 @@ namespace MWGui spellLine += " " + MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Attribute::sGmstAttributeIds[mEffectParams.mAttribute], ""); } - if ((mEffectParams.mMagnMin >= 0 || mEffectParams.mMagnMax >= 0) && !(magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude)) - { - // Fortify Maximum Magicka display rules: - if ( mEffectParams.mEffectID == 84 ) - { + if (mEffectParams.mMagnMin >= 0 || mEffectParams.mMagnMax >= 0) { + int displayType = magicEffect->getMagnitudeDisplayType(); + if ( displayType == ESM::MagicEffect::MDT_TimesInt ) { std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", ""); std::string times = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimes", ""); std::stringstream formatter; @@ -441,20 +439,14 @@ namespace MWGui spellLine += formatter.str(); } - else - { - const bool usePct = ( - (mEffectParams.mEffectID >= 28 && mEffectParams.mEffectID <= 36) || // Weakness effects - (mEffectParams.mEffectID >= 90 && mEffectParams.mEffectID <= 99) ); // Resistance effects - if (mEffectParams.mMagnMin == mEffectParams.mMagnMax) - spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin); - else - { - spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin) + to + boost::lexical_cast(mEffectParams.mMagnMax); - } - if ( usePct ) + else if ( displayType != ESM::MagicEffect::MDT_None ) { + spellLine += " " + boost::lexical_cast(mEffectParams.mMagnMin); + if (mEffectParams.mMagnMin != mEffectParams.mMagnMax) + spellLine += to + boost::lexical_cast(mEffectParams.mMagnMax); + + if ( displayType == ESM::MagicEffect::MDT_Percentage ) spellLine += pct; - else + else // ESM::MagicEffect::MDT_Points spellLine += " " + ((mEffectParams.mMagnMin == 1 && mEffectParams.mMagnMax == 1) ? pt : pts ); } } diff --git a/components/esm/loadmgef.cpp b/components/esm/loadmgef.cpp index 060645b5f4..0dfc2be9c7 100644 --- a/components/esm/loadmgef.cpp +++ b/components/esm/loadmgef.cpp @@ -274,5 +274,16 @@ short MagicEffect::effectStringToId(const std::string &effect) return name->first; } +MagicEffect::MagnitudeDisplayType MagicEffect::getMagnitudeDisplayType() const { + if ( mData.mFlags & NoMagnitude ) + return MDT_None; + if ( mIndex == 84 ) + return MDT_TimesInt; + if ( ( mIndex >= 28 && mIndex <= 36 ) + || ( mIndex >= 90 && mIndex <= 99 ) ) + return MDT_Percentage; + + return MDT_Points; +} } diff --git a/components/esm/loadmgef.hpp b/components/esm/loadmgef.hpp index b74efb4662..c3af56e3af 100644 --- a/components/esm/loadmgef.hpp +++ b/components/esm/loadmgef.hpp @@ -32,6 +32,13 @@ struct MagicEffect Negative = 0x0800 // A harmful effect. Will determine whether // eg. NPCs regard this spell as an attack. (same as 0x10?) }; + enum MagnitudeDisplayType + { + MDT_None, + MDT_Points, + MDT_Percentage, + MDT_TimesInt + }; struct MEDTstruct { @@ -47,6 +54,7 @@ struct MagicEffect static const std::string &effectIdToString(short effectID); static short effectStringToId(const std::string &effect); + MagnitudeDisplayType getMagnitudeDisplayType() const; MEDTstruct mData; From 296b2ab87025c0d26d5010dd38a8b3cb01e2ecda Mon Sep 17 00:00:00 2001 From: Jordan Ayers Date: Tue, 8 Oct 2013 23:55:14 -0500 Subject: [PATCH 6/7] Magic Effect: Recognize other display types. Fill out the list of effects which use percentage formatting. Add in types which use Feet and level labels. --- components/esm/loadmgef.cpp | 9 ++++++++- components/esm/loadmgef.hpp | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/components/esm/loadmgef.cpp b/components/esm/loadmgef.cpp index 0dfc2be9c7..19d535600b 100644 --- a/components/esm/loadmgef.cpp +++ b/components/esm/loadmgef.cpp @@ -279,8 +279,15 @@ MagicEffect::MagnitudeDisplayType MagicEffect::getMagnitudeDisplayType() const { return MDT_None; if ( mIndex == 84 ) return MDT_TimesInt; + if ( mIndex == 59 || + ( mIndex >= 64 && mIndex <= 66) ) + return MDT_Feet; + if ( mIndex == 118 || mIndex == 119 ) + return MDT_Level; if ( ( mIndex >= 28 && mIndex <= 36 ) - || ( mIndex >= 90 && mIndex <= 99 ) ) + || ( mIndex >= 90 && mIndex <= 99 ) + || mIndex == 40 || mIndex == 47 + || mIndex == 57 || mIndex == 68 ) return MDT_Percentage; return MDT_Points; diff --git a/components/esm/loadmgef.hpp b/components/esm/loadmgef.hpp index c3af56e3af..f139fa32c7 100644 --- a/components/esm/loadmgef.hpp +++ b/components/esm/loadmgef.hpp @@ -35,8 +35,10 @@ struct MagicEffect enum MagnitudeDisplayType { MDT_None, - MDT_Points, + MDT_Feet, + MDT_Level, MDT_Percentage, + MDT_Points, MDT_TimesInt }; From 6e4978643c7e209e0b2a82af0fdf04aa44c50bf4 Mon Sep 17 00:00:00 2001 From: Jordan Ayers Date: Wed, 9 Oct 2013 00:08:11 -0500 Subject: [PATCH 7/7] Magic Effect descriptions: support feet / level modes. Show proper suffixes for all magnitudes. Drop extra 'times' symbol in 'timesInt format (not consistent with other magnitude displays). --- apps/openmw/mwgui/spellicons.cpp | 23 ++++++++++++++++------- apps/openmw/mwgui/widgets.cpp | 12 +++++++++--- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwgui/spellicons.cpp b/apps/openmw/mwgui/spellicons.cpp index 0e59230c73..0c303485af 100644 --- a/apps/openmw/mwgui/spellicons.cpp +++ b/apps/openmw/mwgui/spellicons.cpp @@ -172,7 +172,7 @@ namespace MWGui MWBase::Environment::get().getWindowManager()->getGameSettingString( ESM::Attribute::sGmstAttributeIds[effectIt->mKey.mArg], "") + ")"; - int displayType = effect->getMagnitudeDisplayType(); + ESM::MagicEffect::MagnitudeDisplayType displayType = effect->getMagnitudeDisplayType(); if (displayType == ESM::MagicEffect::MDT_TimesInt) { std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", ""); @@ -182,15 +182,24 @@ namespace MWGui } else if ( displayType != ESM::MagicEffect::MDT_None ) { - std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", ""); - std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", ""); - std::string pct = MWBase::Environment::get().getWindowManager()->getGameSettingString("spercent", ""); - sourcesDescription += ": " + boost::lexical_cast(effectIt->mMagnitude); + if ( displayType == ESM::MagicEffect::MDT_Percentage ) - sourcesDescription += pct; + sourcesDescription += MWBase::Environment::get().getWindowManager()->getGameSettingString("spercent", ""); + else if ( displayType == ESM::MagicEffect::MDT_Feet ) + sourcesDescription += " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sfeet", ""); + else if ( displayType == ESM::MagicEffect::MDT_Level ) + { + sourcesDescription += " " + ((effectIt->mMagnitude > 1) ? + MWBase::Environment::get().getWindowManager()->getGameSettingString("sLevels", "") : + MWBase::Environment::get().getWindowManager()->getGameSettingString("sLevel", "") ); + } else // ESM::MagicEffect::MDT_Points - sourcesDescription += " " + ((effectIt->mMagnitude > 1) ? pts : pt); + { + sourcesDescription += " " + ((effectIt->mMagnitude > 1) ? + MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", "") : + MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", "") ); + } } } diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index f3eda4b226..3fc3187e80 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -409,6 +409,9 @@ namespace MWGui std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", ""); std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", ""); std::string pct = MWBase::Environment::get().getWindowManager()->getGameSettingString("spercent", ""); + std::string ft = MWBase::Environment::get().getWindowManager()->getGameSettingString("sfeet", ""); + std::string lvl = MWBase::Environment::get().getWindowManager()->getGameSettingString("sLevel", ""); + std::string lvls = MWBase::Environment::get().getWindowManager()->getGameSettingString("sLevels", ""); std::string to = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sTo", "") + " "; std::string sec = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("ssecond", ""); std::string secs = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sseconds", ""); @@ -426,15 +429,14 @@ namespace MWGui } if (mEffectParams.mMagnMin >= 0 || mEffectParams.mMagnMax >= 0) { - int displayType = magicEffect->getMagnitudeDisplayType(); + ESM::MagicEffect::MagnitudeDisplayType displayType = magicEffect->getMagnitudeDisplayType(); if ( displayType == ESM::MagicEffect::MDT_TimesInt ) { std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", ""); - std::string times = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimes", ""); std::stringstream formatter; formatter << std::fixed << std::setprecision(1) << " " << (mEffectParams.mMagnMin / 10.0f); if (mEffectParams.mMagnMin != mEffectParams.mMagnMax) - formatter << times << to << (mEffectParams.mMagnMax / 10.0f); + formatter << to << (mEffectParams.mMagnMax / 10.0f); formatter << timesInt; spellLine += formatter.str(); @@ -446,6 +448,10 @@ namespace MWGui if ( displayType == ESM::MagicEffect::MDT_Percentage ) spellLine += pct; + else if ( displayType == ESM::MagicEffect::MDT_Feet ) + spellLine += " " + ft; + else if ( displayType == ESM::MagicEffect::MDT_Level ) + spellLine += " " + ((mEffectParams.mMagnMin == 1 && mEffectParams.mMagnMax == 1) ? lvl : lvls ); else // ESM::MagicEffect::MDT_Points spellLine += " " + ((mEffectParams.mMagnMin == 1 && mEffectParams.mMagnMax == 1) ? pt : pts ); }