Replace sIconNames with ESM::Skill::mIcon

macos_ci
Evil Eye 2 years ago
parent ac49356bab
commit eea730768b

@ -514,8 +514,6 @@ namespace MWGui
const ESM::Skill* skill = esmStore.get<ESM::Skill>().find(skillId); const ESM::Skill* skill = esmStore.get<ESM::Skill>().find(skillId);
std::string icon = "icons\\k\\" + ESM::Skill::sIconNames[skillId];
const ESM::Attribute* attr = esmStore.get<ESM::Attribute>().find(skill->mData.mAttribute); const ESM::Attribute* attr = esmStore.get<ESM::Attribute>().find(skill->mData.mAttribute);
std::pair<MyGUI::TextBox*, MyGUI::TextBox*> widgets std::pair<MyGUI::TextBox*, MyGUI::TextBox*> widgets
@ -532,7 +530,7 @@ namespace MWGui
"Caption_SkillDescription", skill->mDescription); "Caption_SkillDescription", skill->mDescription);
mSkillWidgets[mSkillWidgets.size() - 1 - i]->setUserString( mSkillWidgets[mSkillWidgets.size() - 1 - i]->setUserString(
"Caption_SkillAttribute", "#{sGoverningAttribute}: #{" + attr->mName + "}"); "Caption_SkillAttribute", "#{sGoverningAttribute}: #{" + attr->mName + "}");
mSkillWidgets[mSkillWidgets.size() - 1 - i]->setUserString("ImageTexture_SkillImage", icon); mSkillWidgets[mSkillWidgets.size() - 1 - i]->setUserString("ImageTexture_SkillImage", skill->mIcon);
mSkillWidgets[mSkillWidgets.size() - 1 - i]->setUserString("Range_SkillProgress", "100"); mSkillWidgets[mSkillWidgets.size() - 1 - i]->setUserString("Range_SkillProgress", "100");
} }

@ -814,14 +814,12 @@ namespace MWGui
const ESM::Skill* skill = store.get<ESM::Skill>().find(skillId); const ESM::Skill* skill = store.get<ESM::Skill>().find(skillId);
const ESM::Attribute* attr = store.get<ESM::Attribute>().find(skill->mData.mAttribute); const ESM::Attribute* attr = store.get<ESM::Attribute>().find(skill->mData.mAttribute);
std::string icon = "icons\\k\\" + ESM::Skill::sIconNames[skillId];
widget->setUserString("ToolTipType", "Layout"); widget->setUserString("ToolTipType", "Layout");
widget->setUserString("ToolTipLayout", "SkillNoProgressToolTip"); widget->setUserString("ToolTipLayout", "SkillNoProgressToolTip");
widget->setUserString("Caption_SkillNoProgressName", MyGUI::TextIterator::toTagsString(skill->mName)); widget->setUserString("Caption_SkillNoProgressName", MyGUI::TextIterator::toTagsString(skill->mName));
widget->setUserString("Caption_SkillNoProgressDescription", skill->mDescription); widget->setUserString("Caption_SkillNoProgressDescription", skill->mDescription);
widget->setUserString("Caption_SkillNoProgressAttribute", "#{sGoverningAttribute}: #{" + attr->mName + "}"); widget->setUserString("Caption_SkillNoProgressAttribute", "#{sGoverningAttribute}: #{" + attr->mName + "}");
widget->setUserString("ImageTexture_SkillNoProgressImage", icon); widget->setUserString("ImageTexture_SkillNoProgressImage", skill->mIcon);
} }
void ToolTips::createAttributeToolTip(MyGUI::Widget* widget, int attributeId) void ToolTips::createAttributeToolTip(MyGUI::Widget* widget, int attributeId)

@ -903,34 +903,34 @@ namespace MWWorld
void Store<ESM::Skill>::setUp(const MWWorld::Store<ESM::GameSetting> settings) void Store<ESM::Skill>::setUp(const MWWorld::Store<ESM::GameSetting> settings)
{ {
constexpr std::string_view skillNameIds[ESM::Skill::Length] = { constexpr std::string_view skillNameIdsAndIcons[ESM::Skill::Length][2] = {
"sSkillBlock", { "sSkillBlock", "icons\\k\\combat_block.dds" },
"sSkillArmorer", { "sSkillArmorer", "icons\\k\\combat_armor.dds" },
"sSkillMediumarmor", { "sSkillMediumarmor", "icons\\k\\combat_mediumarmor.dds" },
"sSkillHeavyarmor", { "sSkillHeavyarmor", "icons\\k\\combat_heavyarmor.dds" },
"sSkillBluntweapon", { "sSkillBluntweapon", "icons\\k\\combat_blunt.dds" },
"sSkillLongblade", { "sSkillLongblade", "icons\\k\\combat_longblade.dds" },
"sSkillAxe", { "sSkillAxe", "icons\\k\\combat_axe.dds" },
"sSkillSpear", { "sSkillSpear", "icons\\k\\combat_spear.dds" },
"sSkillAthletics", { "sSkillAthletics", "icons\\k\\combat_athletics.dds" },
"sSkillEnchant", { "sSkillEnchant", "icons\\k\\magic_enchant.dds" },
"sSkillDestruction", { "sSkillDestruction", "icons\\k\\magic_destruction.dds" },
"sSkillAlteration", { "sSkillAlteration", "icons\\k\\magic_alteration.dds" },
"sSkillIllusion", { "sSkillIllusion", "icons\\k\\magic_illusion.dds" },
"sSkillConjuration", { "sSkillConjuration", "icons\\k\\magic_conjuration.dds" },
"sSkillMysticism", { "sSkillMysticism", "icons\\k\\magic_mysticism.dds" },
"sSkillRestoration", { "sSkillRestoration", "icons\\k\\magic_restoration.dds" },
"sSkillAlchemy", { "sSkillAlchemy", "icons\\k\\magic_alchemy.dds" },
"sSkillUnarmored", { "sSkillUnarmored", "icons\\k\\magic_unarmored.dds" },
"sSkillSecurity", { "sSkillSecurity", "icons\\k\\stealth_security.dds" },
"sSkillSneak", { "sSkillSneak", "icons\\k\\stealth_sneak.dds" },
"sSkillAcrobatics", { "sSkillAcrobatics", "icons\\k\\stealth_acrobatics.dds" },
"sSkillLightarmor", { "sSkillLightarmor", "icons\\k\\stealth_lightarmor.dds" },
"sSkillShortblade", { "sSkillShortblade", "icons\\k\\stealth_shortblade.dds" },
"sSkillMarksman", { "sSkillMarksman", "icons\\k\\stealth_marksman.dds" },
"sSkillMercantile", { "sSkillMercantile", "icons\\k\\stealth_mercantile.dds" },
"sSkillSpeechcraft", { "sSkillSpeechcraft", "icons\\k\\stealth_speechcraft.dds" },
"sSkillHandtohand", { "sSkillHandtohand", "icons\\k\\stealth_handtohand.dds" },
}; };
for (int i = 0; i < ESM::Skill::Length; ++i) for (int i = 0; i < ESM::Skill::Length; ++i)
{ {
@ -938,7 +938,8 @@ namespace MWWorld
if (found != mStatic.end()) if (found != mStatic.end())
{ {
ESM::Skill& skill = found->second; ESM::Skill& skill = found->second;
std::string_view id = skillNameIds[i]; std::string_view id = skillNameIdsAndIcons[i][0];
skill.mIcon = skillNameIdsAndIcons[i][1];
const ESM::GameSetting* setting = settings.search(id); const ESM::GameSetting* setting = settings.search(id);
if (setting && setting->mValue.getType() == ESM::VT_String) if (setting && setting->mValue.getType() == ESM::VT_String)
skill.mName = setting->mValue.getString(); skill.mName = setting->mValue.getString();

@ -36,35 +36,6 @@ namespace ESM
"Speechcraft", "Speechcraft",
"Handtohand", "Handtohand",
}; };
const std::string Skill::sIconNames[Length] = {
"combat_block.dds",
"combat_armor.dds",
"combat_mediumarmor.dds",
"combat_heavyarmor.dds",
"combat_blunt.dds",
"combat_longblade.dds",
"combat_axe.dds",
"combat_spear.dds",
"combat_athletics.dds",
"magic_enchant.dds",
"magic_destruction.dds",
"magic_alteration.dds",
"magic_illusion.dds",
"magic_conjuration.dds",
"magic_mysticism.dds",
"magic_restoration.dds",
"magic_alchemy.dds",
"magic_unarmored.dds",
"stealth_security.dds",
"stealth_sneak.dds",
"stealth_acrobatics.dds",
"stealth_lightarmor.dds",
"stealth_shortblade.dds",
"stealth_marksman.dds",
"stealth_mercantile.dds",
"stealth_speechcraft.dds",
"stealth_handtohand.dds",
};
Skill::SkillEnum Skill::stringToSkillId(std::string_view skill) Skill::SkillEnum Skill::stringToSkillId(std::string_view skill)
{ {

@ -45,6 +45,7 @@ namespace ESM
std::string mDescription; std::string mDescription;
std::string mName; std::string mName;
std::string mIcon;
enum SkillEnum enum SkillEnum
{ {
@ -78,7 +79,6 @@ namespace ESM
Length Length
}; };
static const std::string sSkillNames[Length]; static const std::string sSkillNames[Length];
static const std::string sIconNames[Length];
static SkillEnum stringToSkillId(std::string_view skill); static SkillEnum stringToSkillId(std::string_view skill);

Loading…
Cancel
Save