|
|
|
@ -113,17 +113,6 @@ void StatsWindow::setPlayerName(const std::string& playerName)
|
|
|
|
|
static_cast<MyGUI::Window*>(mMainWidget)->setCaption(playerName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsWindow::setStyledText(MyGUI::TextBox* widget, ColorStyle style, const std::string &value)
|
|
|
|
|
{
|
|
|
|
|
widget->setCaption(value);
|
|
|
|
|
if (style == CS_Super)
|
|
|
|
|
widget->setTextColour(MyGUI::Colour(0, 1, 0));
|
|
|
|
|
else if (style == CS_Sub)
|
|
|
|
|
widget->setTextColour(MyGUI::Colour(1, 0, 0));
|
|
|
|
|
else
|
|
|
|
|
widget->setTextColour(MyGUI::Colour(1, 1, 1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsWindow::setValue (const std::string& id, const MWMechanics::Stat<int>& value)
|
|
|
|
|
{
|
|
|
|
|
static const char *ids[] =
|
|
|
|
@ -140,12 +129,15 @@ void StatsWindow::setValue (const std::string& id, const MWMechanics::Stat<int>&
|
|
|
|
|
valueString << value.getModified();
|
|
|
|
|
setText (id, valueString.str());
|
|
|
|
|
|
|
|
|
|
MyGUI::TextBox* box;
|
|
|
|
|
getWidget(box, id);
|
|
|
|
|
|
|
|
|
|
if (value.getModified()>value.getBase())
|
|
|
|
|
setTextColor (id, 0, 1, 0);
|
|
|
|
|
box->_setWidgetState("increased");
|
|
|
|
|
else if (value.getModified()<value.getBase())
|
|
|
|
|
setTextColor (id, 1, 0, 0);
|
|
|
|
|
box->_setWidgetState("decreased");
|
|
|
|
|
else
|
|
|
|
|
setTextColor (id, 1, 1, 1);
|
|
|
|
|
box->_setWidgetState("normal");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -195,13 +187,14 @@ void StatsWindow::setValue(const ESM::Skill::SkillEnum parSkill, const MWMechani
|
|
|
|
|
{
|
|
|
|
|
float modified = value.getModified(), base = value.getBase();
|
|
|
|
|
std::string text = boost::lexical_cast<std::string>(std::floor(modified));
|
|
|
|
|
ColorStyle style = CS_Normal;
|
|
|
|
|
std::string state = "normal";
|
|
|
|
|
if (modified > base)
|
|
|
|
|
style = CS_Super;
|
|
|
|
|
state = "increased";
|
|
|
|
|
else if (modified < base)
|
|
|
|
|
style = CS_Sub;
|
|
|
|
|
state = "decreased";
|
|
|
|
|
|
|
|
|
|
setStyledText(widget, style, text);
|
|
|
|
|
widget->setCaption(text);
|
|
|
|
|
widget->_setWidgetState(state);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -253,7 +246,7 @@ void StatsWindow::addGroup(const std::string &label, MyGUI::IntCoord &coord1, My
|
|
|
|
|
coord2.top += lineHeight;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MyGUI::TextBox* StatsWindow::addValueItem(const std::string& text, const std::string& tooltip, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
|
|
|
|
MyGUI::TextBox* StatsWindow::addValueItem(const std::string& text, const std::string& tooltip, const std::string &value, const std::string& state, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
|
|
|
|
{
|
|
|
|
|
MyGUI::TextBox *skillNameWidget, *skillValueWidget;
|
|
|
|
|
|
|
|
|
@ -265,7 +258,8 @@ MyGUI::TextBox* StatsWindow::addValueItem(const std::string& text, const std::st
|
|
|
|
|
skillValueWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandTextRight", coord2, MyGUI::Align::Default);
|
|
|
|
|
skillValueWidget->setUserString("ToolTipType", "Text");
|
|
|
|
|
skillValueWidget->setUserString("ToolTipText", tooltip);
|
|
|
|
|
setStyledText(skillValueWidget, style, value);
|
|
|
|
|
skillValueWidget->setCaption(value);
|
|
|
|
|
skillValueWidget->_setWidgetState(state);
|
|
|
|
|
|
|
|
|
|
skillWidgets.push_back(skillNameWidget);
|
|
|
|
|
skillWidgets.push_back(skillValueWidget);
|
|
|
|
@ -311,12 +305,13 @@ void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId,
|
|
|
|
|
float base = stat.getBase();
|
|
|
|
|
float modified = stat.getModified();
|
|
|
|
|
|
|
|
|
|
ColorStyle style = CS_Normal;
|
|
|
|
|
std::string state = "normal";
|
|
|
|
|
if (modified > base)
|
|
|
|
|
style = CS_Super;
|
|
|
|
|
state = "increased";
|
|
|
|
|
else if (modified < base)
|
|
|
|
|
style = CS_Sub;
|
|
|
|
|
MyGUI::TextBox* widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), "", boost::lexical_cast<std::string>(static_cast<int>(modified)), style, coord1, coord2);
|
|
|
|
|
state = "decreased";
|
|
|
|
|
MyGUI::TextBox* widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), "",
|
|
|
|
|
boost::lexical_cast<std::string>(static_cast<int>(modified)), state, coord1, coord2);
|
|
|
|
|
skillWidgetMap[skillId] = widget;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -377,10 +372,10 @@ void StatsWindow::updateSkillArea()
|
|
|
|
|
|
|
|
|
|
addValueItem(mWindowManager.getGameSettingString("sReputation", "Reputation"),
|
|
|
|
|
mWindowManager.getGameSettingString("sSkillsMenuReputationHelp", ""),
|
|
|
|
|
boost::lexical_cast<std::string>(static_cast<int>(reputation)), CS_Normal, coord1, coord2);
|
|
|
|
|
boost::lexical_cast<std::string>(static_cast<int>(reputation)), "normal", coord1, coord2);
|
|
|
|
|
addValueItem(mWindowManager.getGameSettingString("sBounty", "Bounty"),
|
|
|
|
|
mWindowManager.getGameSettingString("sCrimeHelp", ""),
|
|
|
|
|
boost::lexical_cast<std::string>(static_cast<int>(bounty)), CS_Normal, coord1, coord2);
|
|
|
|
|
boost::lexical_cast<std::string>(static_cast<int>(bounty)), "normal", coord1, coord2);
|
|
|
|
|
|
|
|
|
|
clientHeight = coord1.top;
|
|
|
|
|
updateScroller();
|
|
|
|
|