Changed list of skill names to contain the ID of the names instead, the actual names are then fetched from GMST.

actorid
Jan Borsodi 15 years ago
parent 869bc4d084
commit 30e0d713ed

@ -222,6 +222,7 @@ void RaceDialog::updateSkills()
MyGUI::IntCoord coord1(0, 0, skillList->getWidth() - (40 + 4), 18); MyGUI::IntCoord coord1(0, 0, skillList->getWidth() - (40 + 4), 18);
MyGUI::IntCoord coord2(coord1.left + coord1.width, 0, 40, 18); MyGUI::IntCoord coord2(coord1.left + coord1.width, 0, 40, 18);
WindowManager *wm = environment.mWindowManager;
ESMS::ESMStore &store = environment.mWorld->getStore(); ESMS::ESMStore &store = environment.mWorld->getStore();
const ESM::Race *race = store.races.find(currentRaceId); const ESM::Race *race = store.races.find(currentRaceId);
int count = sizeof(race->data.bonus)/sizeof(race->data.bonus[0]); // TODO: Find a portable macro for this ARRAYSIZE? int count = sizeof(race->data.bonus)/sizeof(race->data.bonus[0]); // TODO: Find a portable macro for this ARRAYSIZE?
@ -234,7 +235,8 @@ void RaceDialog::updateSkills()
skillNameWidget = skillList->createWidget<MyGUI::StaticText>("SandText", coord1, MyGUI::Align::Default, skillNameWidget = skillList->createWidget<MyGUI::StaticText>("SandText", coord1, MyGUI::Align::Default,
std::string("SkillName") + boost::lexical_cast<std::string>(i)); std::string("SkillName") + boost::lexical_cast<std::string>(i));
assert(skillId >= 0 && skillId < ESM::Skill::Length); assert(skillId >= 0 && skillId < ESM::Skill::Length);
skillNameWidget->setCaption(ESMS::Skill::sSkillNames[skillId]); const std::string &skillNameId = ESMS::Skill::sSkillNameIds[skillId];
skillNameWidget->setCaption(wm->getGameSettingString(skillNameId, skillNameId));
skillBonusWidget = skillList->createWidget<MyGUI::StaticText>("SandTextRight", coord2, MyGUI::Align::Default, skillBonusWidget = skillList->createWidget<MyGUI::StaticText>("SandTextRight", coord2, MyGUI::Align::Default,
std::string("SkillBonus") + boost::lexical_cast<std::string>(i)); std::string("SkillBonus") + boost::lexical_cast<std::string>(i));

@ -61,7 +61,7 @@ struct Skill
HandToHand = 26, HandToHand = 26,
Length Length
}; };
static const std::string sSkillNames[Length]; static const std::string sSkillNameIds[Length];
void load(ESMReader &esm) void load(ESMReader &esm)
{ {

@ -2,33 +2,33 @@
namespace ESM namespace ESM
{ {
const std::string Skill::sSkillNames[Length] = { const std::string Skill::sSkillNameIds[Length] = {
"Block", "sSkillBlock",
"Armorer", "sSkillArmorer",
"Medium Armor", "sSkillMediumarmor",
"Heavy Armor", "sSkillHeavyarmor",
"Blunt Weapon", "sSkillBluntweapon",
"Long Blade", "sSkillLongblade",
"Axe", "sSkillAxe",
"Spear", "sSkillSpear",
"Athletics", "sSkillAthletics",
"Enchant", "sSkillEnchant",
"Destruction", "sSkillDestruction",
"Alteration", "sSkillAlteration",
"Illusion", "sSkillIllusion",
"Conjuration", "sSkillConjuration",
"Mysticism", "sSkillMysticism",
"Restoration", "sSkillRestoration",
"Alchemy", "sSkillAlchemy",
"Unarmored", "sSkillUnarmored",
"Security", "sSkillSecurity",
"Sneak", "sSkillSneak",
"Acrobatics", "sSkillAcrobatics",
"Light Armor", "sSkillLightarmor",
"Short Blade", "sSkillShortblade",
"Marksman", "sSkillMarksman",
"Mercantile", "sSkillMercantile",
"Speechcraft", "sSkillSpeechcraft",
"Hand To Hand", "sSkillHandtohand",
}; };
} }

Loading…
Cancel
Save