mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:15:32 +00:00
Magic effect display improvement.
Related to Bug #794. Show the "x INT" notation for Fortify Max. Magicka. Show "%" notation for weakness / resistance effects.
This commit is contained in:
parent
1363e86828
commit
6983a55a16
2 changed files with 45 additions and 7 deletions
|
@ -170,12 +170,27 @@ namespace MWGui
|
||||||
ESM::Attribute::sGmstAttributeIds[effectIt->mKey.mArg], "") + ")";
|
ESM::Attribute::sGmstAttributeIds[effectIt->mKey.mArg], "") + ")";
|
||||||
|
|
||||||
if (!(effect->mData.mFlags & ESM::MagicEffect::NoMagnitude))
|
if (!(effect->mData.mFlags & ESM::MagicEffect::NoMagnitude))
|
||||||
|
{
|
||||||
|
if (it->first == 84) // special handling for fortify maximum magicka
|
||||||
|
{
|
||||||
|
std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", "");
|
||||||
|
sourcesDescription += " " + boost::lexical_cast<std::string>(effectIt->mMagnitude / 10.0f) + timesInt;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", "");
|
std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", "");
|
||||||
std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", "");
|
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<std::string>(effectIt->mMagnitude);
|
sourcesDescription += ": " + boost::lexical_cast<std::string>(effectIt->mMagnitude) + " ";
|
||||||
sourcesDescription += " " + ((effectIt->mMagnitude > 1) ? pts : pt);
|
if ( usePct )
|
||||||
|
sourcesDescription += pct;
|
||||||
|
else
|
||||||
|
sourcesDescription += ((effectIt->mMagnitude > 1) ? pts : pt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -405,6 +405,7 @@ namespace MWGui
|
||||||
|
|
||||||
std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", "");
|
std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", "");
|
||||||
std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", "");
|
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 to = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sTo", "") + " ";
|
||||||
std::string sec = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("ssecond", "");
|
std::string sec = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("ssecond", "");
|
||||||
std::string secs = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sseconds", "");
|
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 >= 0 || mEffectParams.mMagnMax >= 0) && !(magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude))
|
||||||
{
|
{
|
||||||
|
// 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)
|
if (mEffectParams.mMagnMin == mEffectParams.mMagnMax)
|
||||||
spellLine += " " + boost::lexical_cast<std::string>(mEffectParams.mMagnMin) + " " + ((mEffectParams.mMagnMin == 1) ? pt : pts);
|
spellLine += " " + boost::lexical_cast<std::string>(mEffectParams.mMagnMin / 10.0f) + timesInt;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spellLine += " " + boost::lexical_cast<std::string>(mEffectParams.mMagnMin) + to + boost::lexical_cast<std::string>(mEffectParams.mMagnMax) + " " + pts;
|
spellLine += " " + boost::lexical_cast<std::string>(mEffectParams.mMagnMin / 10.0f) + times + " " + to + boost::lexical_cast<std::string>(mEffectParams.mMagnMax / 10.0f) + timesInt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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<std::string>(mEffectParams.mMagnMin) + " ";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spellLine += " " + boost::lexical_cast<std::string>(mEffectParams.mMagnMin) + to + boost::lexical_cast<std::string>(mEffectParams.mMagnMax) + " ";
|
||||||
|
}
|
||||||
|
if ( usePct )
|
||||||
|
spellLine += pct;
|
||||||
|
else
|
||||||
|
spellLine += ((mEffectParams.mMagnMin == 1 && mEffectParams.mMagnMax == 1) ? pt : pts );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue