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

This commit is contained in:
Jan Borsodi 2010-09-15 13:44:24 +02:00
parent 869bc4d084
commit 30e0d713ed
3 changed files with 32 additions and 30 deletions

View file

@ -222,6 +222,7 @@ void RaceDialog::updateSkills()
MyGUI::IntCoord coord1(0, 0, skillList->getWidth() - (40 + 4), 18);
MyGUI::IntCoord coord2(coord1.left + coord1.width, 0, 40, 18);
WindowManager *wm = environment.mWindowManager;
ESMS::ESMStore &store = environment.mWorld->getStore();
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?
@ -234,7 +235,8 @@ void RaceDialog::updateSkills()
skillNameWidget = skillList->createWidget<MyGUI::StaticText>("SandText", coord1, MyGUI::Align::Default,
std::string("SkillName") + boost::lexical_cast<std::string>(i));
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,
std::string("SkillBonus") + boost::lexical_cast<std::string>(i));

View file

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

View file

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