mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 13:36: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 changed files with 17 additions and 7 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
@ -174,7 +177,9 @@ namespace MWGui
|
||||||
if (it->first == 84) // special handling for fortify maximum magicka
|
if (it->first == 84) // special handling for fortify maximum magicka
|
||||||
{
|
{
|
||||||
std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", "");
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
#include <MyGUI_ProgressBar.h>
|
#include <MyGUI_ProgressBar.h>
|
||||||
#include <MyGUI_ImageBox.h>
|
#include <MyGUI_ImageBox.h>
|
||||||
#include <MyGUI_ControllerManager.h>
|
#include <MyGUI_ControllerManager.h>
|
||||||
|
@ -429,12 +432,14 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", "");
|
std::string timesInt = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimesINT", "");
|
||||||
std::string times = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimes", "");
|
std::string times = MWBase::Environment::get().getWindowManager()->getGameSettingString("sXTimes", "");
|
||||||
if (mEffectParams.mMagnMin == mEffectParams.mMagnMax)
|
std::stringstream formatter;
|
||||||
spellLine += " " + boost::lexical_cast<std::string>(mEffectParams.mMagnMin / 10.0f) + timesInt;
|
|
||||||
else
|
formatter << std::fixed << std::setprecision(1) << " " << (mEffectParams.mMagnMin / 10.0f);
|
||||||
{
|
if (mEffectParams.mMagnMin != mEffectParams.mMagnMax)
|
||||||
spellLine += " " + boost::lexical_cast<std::string>(mEffectParams.mMagnMin / 10.0f) + times + " " + to + boost::lexical_cast<std::string>(mEffectParams.mMagnMax / 10.0f) + timesInt;
|
formatter << times << " " << to << " " << (mEffectParams.mMagnMax / 10.0f);
|
||||||
}
|
formatter << timesInt;
|
||||||
|
|
||||||
|
spellLine += formatter.str();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue