mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 03:54:40 +00:00
Magic Effect Display improvement.
Related to Bug #794. Always show one decimal point precision for Fortify Max. Magicka effect.
This commit is contained in:
parent
6983a55a16
commit
707f45aa8e
@ -2,6 +2,9 @@
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
#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<std::string>(effectIt->mMagnitude / 10.0f) + timesInt;
|
||||
std::stringstream formatter;
|
||||
formatter << std::fixed << std::setprecision(1) << " " << (effectIt->mMagnitude / 10.0f) << timesInt;
|
||||
sourcesDescription += formatter.str();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
#include <MyGUI_ProgressBar.h>
|
||||
#include <MyGUI_ImageBox.h>
|
||||
#include <MyGUI_ControllerManager.h>
|
||||
@ -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<std::string>(mEffectParams.mMagnMin / 10.0f) + timesInt;
|
||||
else
|
||||
{
|
||||
spellLine += " " + boost::lexical_cast<std::string>(mEffectParams.mMagnMin / 10.0f) + times + " " + to + boost::lexical_cast<std::string>(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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user