|
|
|
@ -173,59 +173,21 @@ void StatsWindow::setValue (const std::string& id, int value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsWindow::setValue (const std::string& id, const MWMechanics::Stat<float>& value)
|
|
|
|
|
void StatsWindow::setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat<float>& value)
|
|
|
|
|
{
|
|
|
|
|
static struct {const char *id; ESM::Skill::SkillEnum skillId; } skillMap[] =
|
|
|
|
|
skillValues[parSkill] = value;
|
|
|
|
|
MyGUI::StaticTextPtr widget = skillWidgetMap[(int)parSkill];
|
|
|
|
|
if (widget)
|
|
|
|
|
{
|
|
|
|
|
{"SkillBlock", ESM::Skill::Block},
|
|
|
|
|
{"SkillArmorer", ESM::Skill::Armorer},
|
|
|
|
|
{"SkillMediumArmor", ESM::Skill::MediumArmor},
|
|
|
|
|
{"SkillHeavyArmor", ESM::Skill::HeavyArmor},
|
|
|
|
|
{"SkillBluntWeapon", ESM::Skill::BluntWeapon},
|
|
|
|
|
{"SkillLongBlade", ESM::Skill::LongBlade},
|
|
|
|
|
{"SkillAxe", ESM::Skill::Axe},
|
|
|
|
|
{"SkillSpear", ESM::Skill::Spear},
|
|
|
|
|
{"SkillAthletics", ESM::Skill::Athletics},
|
|
|
|
|
{"SkillEnchant", ESM::Skill::Armorer},
|
|
|
|
|
{"SkillDestruction", ESM::Skill::Destruction},
|
|
|
|
|
{"SkillAlteration", ESM::Skill::Alteration},
|
|
|
|
|
{"SkillIllusion", ESM::Skill::Illusion},
|
|
|
|
|
{"SkillConjuration", ESM::Skill::Conjuration},
|
|
|
|
|
{"SkillMysticism", ESM::Skill::Mysticism},
|
|
|
|
|
{"SkillRestoration", ESM::Skill::Restoration},
|
|
|
|
|
{"SkillAlchemy", ESM::Skill::Alchemy},
|
|
|
|
|
{"SkillUnarmored", ESM::Skill::Unarmored},
|
|
|
|
|
{"SkillSecurity", ESM::Skill::Security},
|
|
|
|
|
{"SkillSneak", ESM::Skill::Sneak},
|
|
|
|
|
{"SkillAcrobatics", ESM::Skill::Acrobatics},
|
|
|
|
|
{"SkillLightArmor", ESM::Skill::LightArmor},
|
|
|
|
|
{"SkillShortBlade", ESM::Skill::ShortBlade},
|
|
|
|
|
{"SkillMarksman", ESM::Skill::Marksman},
|
|
|
|
|
{"SkillMercantile", ESM::Skill::Mercantile},
|
|
|
|
|
{"SkillSpeechcraft", ESM::Skill::Speechcraft},
|
|
|
|
|
{"SkillHandToHand", ESM::Skill::HandToHand},
|
|
|
|
|
};
|
|
|
|
|
for (size_t i = 0; i < sizeof(skillMap)/sizeof(skillMap[0]); ++i)
|
|
|
|
|
{
|
|
|
|
|
if (skillMap[i].id == id)
|
|
|
|
|
{
|
|
|
|
|
int skillId = skillMap[i].skillId;
|
|
|
|
|
skillValues[skillId] = value;
|
|
|
|
|
MyGUI::StaticTextPtr widget = skillWidgetMap[skillId];
|
|
|
|
|
if (widget)
|
|
|
|
|
{
|
|
|
|
|
float modified = value.getModified(), base = value.getBase();
|
|
|
|
|
std::string text = boost::lexical_cast<std::string>(std::floor(modified));
|
|
|
|
|
ColorStyle style = CS_Normal;
|
|
|
|
|
if (modified > base)
|
|
|
|
|
style = CS_Super;
|
|
|
|
|
else if (modified < base)
|
|
|
|
|
style = CS_Sub;
|
|
|
|
|
|
|
|
|
|
setStyledText(widget, style, text);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
float modified = value.getModified(), base = value.getBase();
|
|
|
|
|
std::string text = boost::lexical_cast<std::string>(std::floor(modified));
|
|
|
|
|
ColorStyle style = CS_Normal;
|
|
|
|
|
if (modified > base)
|
|
|
|
|
style = CS_Super;
|
|
|
|
|
else if (modified < base)
|
|
|
|
|
style = CS_Sub;
|
|
|
|
|
|
|
|
|
|
setStyledText(widget, style, text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|