forked from teamnwah/openmw-tes3coop
Spellpower list is now fetched from the ESM store.
This commit is contained in:
parent
8f6d24bea4
commit
cb98bd1a79
1 changed files with 16 additions and 13 deletions
|
@ -215,26 +215,29 @@ void RaceDialog::updateSpellPowers()
|
||||||
}
|
}
|
||||||
spellPowerItems.clear();
|
spellPowerItems.clear();
|
||||||
|
|
||||||
MyGUI::StaticTextPtr spellPowerName;
|
if (currentRace.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
MyGUI::StaticTextPtr spellPowerWidget;
|
||||||
const int lineHeight = 18;
|
const int lineHeight = 18;
|
||||||
MyGUI::IntCoord coord(0, 0, spellPowerList->getWidth(), 18);
|
MyGUI::IntCoord coord(0, 0, spellPowerList->getWidth(), 18);
|
||||||
|
|
||||||
const char *inputList[] = {
|
ESMS::ESMStore &store = environment.mWorld->getStore();
|
||||||
"Depth Perception",
|
const ESM::Race *race = store.races.find(currentRace);
|
||||||
"Resist Fire",
|
|
||||||
"Ancestor Guardian",
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
for (int i = 0; inputList[i]; ++i)
|
std::vector<std::string>::const_iterator it = race->powers.list.begin();
|
||||||
|
std::vector<std::string>::const_iterator end = race->powers.list.end();
|
||||||
|
for (int i = 0; it != end; ++it)
|
||||||
{
|
{
|
||||||
std::ostringstream name;
|
const std::string &spellpower = *it;
|
||||||
name << std::string("SpellPowerName") << i;
|
const ESM::Spell *spell = store.spells.find(spellpower);
|
||||||
spellPowerName = spellPowerList->createWidget<MyGUI::StaticText>("SandText", coord, MyGUI::Align::Default, name.str());
|
assert(spell);
|
||||||
spellPowerName->setCaption(inputList[i]);
|
spellPowerWidget = spellPowerList->createWidget<MyGUI::StaticText>("SandText", coord, MyGUI::Align::Default, std::string("SpellPowerName") + boost::lexical_cast<std::string>(i));
|
||||||
|
spellPowerWidget->setCaption(spell->name);
|
||||||
|
|
||||||
spellPowerItems.push_back(spellPowerName);
|
spellPowerItems.push_back(spellPowerWidget);
|
||||||
|
|
||||||
coord.top += lineHeight;
|
coord.top += lineHeight;
|
||||||
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue