forked from mirror/openmw-tes3mp
applying new interface vol.7, inconsistent
This commit is contained in:
parent
4637503680
commit
a9c1ce412a
8 changed files with 115 additions and 47 deletions
|
@ -29,8 +29,11 @@ namespace
|
||||||
|
|
||||||
bool sortSpells(const std::string& left, const std::string& right)
|
bool sortSpells(const std::string& left, const std::string& right)
|
||||||
{
|
{
|
||||||
const ESM::Spell* a = MWBase::Environment::get().getWorld()->getStore().spells.find(left);
|
const MWWorld::Store<ESM::Spell> &spells =
|
||||||
const ESM::Spell* b = MWBase::Environment::get().getWorld()->getStore().spells.find(right);
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>();
|
||||||
|
|
||||||
|
const ESM::Spell* a = spells.find(left);
|
||||||
|
const ESM::Spell* b = spells.find(right);
|
||||||
|
|
||||||
int cmp = a->mName.compare(b->mName);
|
int cmp = a->mName.compare(b->mName);
|
||||||
return cmp < 0;
|
return cmp < 0;
|
||||||
|
@ -234,9 +237,15 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::ImageBox* image = frame->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(5, 5, 32, 32), MyGUI::Align::Default);
|
MyGUI::ImageBox* image = frame->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(5, 5, 32, 32), MyGUI::Align::Default);
|
||||||
|
|
||||||
|
const MWWorld::ESMStore &esmStore =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
|
||||||
// use the icon of the first effect
|
// use the icon of the first effect
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
|
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(spellId);
|
||||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().magicEffects.find(spell->mEffects.mList.front().mEffectID);
|
|
||||||
|
const ESM::MagicEffect* effect =
|
||||||
|
esmStore.get<ESM::MagicEffect>().find(spell->mEffects.mList.front().mEffectID);
|
||||||
|
|
||||||
std::string path = effect->mIcon;
|
std::string path = effect->mIcon;
|
||||||
int slashPos = path.find("\\");
|
int slashPos = path.find("\\");
|
||||||
path.insert(slashPos+1, "b_");
|
path.insert(slashPos+1, "b_");
|
||||||
|
@ -434,11 +443,14 @@ namespace MWGui
|
||||||
spellList.push_back(*it);
|
spellList.push_back(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MWWorld::ESMStore &esmStore =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
|
||||||
std::vector<std::string> powers;
|
std::vector<std::string> powers;
|
||||||
std::vector<std::string>::iterator it = spellList.begin();
|
std::vector<std::string>::iterator it = spellList.begin();
|
||||||
while (it != spellList.end())
|
while (it != spellList.end())
|
||||||
{
|
{
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||||
if (spell->mData.mType == ESM::Spell::ST_Power)
|
if (spell->mData.mType == ESM::Spell::ST_Power)
|
||||||
{
|
{
|
||||||
powers.push_back(*it);
|
powers.push_back(*it);
|
||||||
|
@ -465,7 +477,9 @@ namespace MWGui
|
||||||
if (enchantId != "")
|
if (enchantId != "")
|
||||||
{
|
{
|
||||||
// only add items with "Cast once" or "Cast on use"
|
// only add items with "Cast once" or "Cast on use"
|
||||||
const ESM::Enchantment* enchant = MWBase::Environment::get().getWorld()->getStore().enchants.find(enchantId);
|
const ESM::Enchantment* enchant =
|
||||||
|
esmStore.get<ESM::Enchantment>().find(enchantId);
|
||||||
|
|
||||||
int type = enchant->mData.mType;
|
int type = enchant->mData.mType;
|
||||||
if (type != ESM::Enchantment::CastOnce
|
if (type != ESM::Enchantment::CastOnce
|
||||||
&& type != ESM::Enchantment::WhenUsed)
|
&& type != ESM::Enchantment::WhenUsed)
|
||||||
|
@ -487,7 +501,7 @@ namespace MWGui
|
||||||
|
|
||||||
for (std::vector<std::string>::const_iterator it = powers.begin(); it != powers.end(); ++it)
|
for (std::vector<std::string>::const_iterator it = powers.begin(); it != powers.end(); ++it)
|
||||||
{
|
{
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||||
MyGUI::Button* t = mMagicList->createWidget<MyGUI::Button>("SpellText",
|
MyGUI::Button* t = mMagicList->createWidget<MyGUI::Button>("SpellText",
|
||||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||||
t->setCaption(spell->mName);
|
t->setCaption(spell->mName);
|
||||||
|
@ -504,7 +518,7 @@ namespace MWGui
|
||||||
addGroup("#{sSpells}", "");
|
addGroup("#{sSpells}", "");
|
||||||
for (std::vector<std::string>::const_iterator it = spellList.begin(); it != spellList.end(); ++it)
|
for (std::vector<std::string>::const_iterator it = spellList.begin(); it != spellList.end(); ++it)
|
||||||
{
|
{
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||||
MyGUI::Button* t = mMagicList->createWidget<MyGUI::Button>("SpellText",
|
MyGUI::Button* t = mMagicList->createWidget<MyGUI::Button>("SpellText",
|
||||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||||
t->setCaption(spell->mName);
|
t->setCaption(spell->mName);
|
||||||
|
|
|
@ -26,8 +26,11 @@ namespace
|
||||||
{
|
{
|
||||||
bool sortSpells(const std::string& left, const std::string& right)
|
bool sortSpells(const std::string& left, const std::string& right)
|
||||||
{
|
{
|
||||||
const ESM::Spell* a = MWBase::Environment::get().getWorld()->getStore().spells.find(left);
|
const MWWorld::Store<ESM::Spell> &spells =
|
||||||
const ESM::Spell* b = MWBase::Environment::get().getWorld()->getStore().spells.find(right);
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>();
|
||||||
|
|
||||||
|
const ESM::Spell* a = spells.find(left);
|
||||||
|
const ESM::Spell* b = spells.find(right);
|
||||||
|
|
||||||
int cmp = a->mName.compare(b->mName);
|
int cmp = a->mName.compare(b->mName);
|
||||||
return cmp < 0;
|
return cmp < 0;
|
||||||
|
@ -139,11 +142,15 @@ namespace MWGui
|
||||||
spellList.push_back(*it);
|
spellList.push_back(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MWWorld::ESMStore &esmStore =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
|
||||||
std::vector<std::string> powers;
|
std::vector<std::string> powers;
|
||||||
std::vector<std::string>::iterator it = spellList.begin();
|
std::vector<std::string>::iterator it = spellList.begin();
|
||||||
while (it != spellList.end())
|
while (it != spellList.end())
|
||||||
{
|
{
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||||
|
|
||||||
if (spell->mData.mType == ESM::Spell::ST_Power)
|
if (spell->mData.mType == ESM::Spell::ST_Power)
|
||||||
{
|
{
|
||||||
powers.push_back(*it);
|
powers.push_back(*it);
|
||||||
|
@ -170,7 +177,9 @@ namespace MWGui
|
||||||
if (enchantId != "")
|
if (enchantId != "")
|
||||||
{
|
{
|
||||||
// only add items with "Cast once" or "Cast on use"
|
// only add items with "Cast once" or "Cast on use"
|
||||||
const ESM::Enchantment* enchant = MWBase::Environment::get().getWorld()->getStore().enchants.find(enchantId);
|
const ESM::Enchantment* enchant =
|
||||||
|
esmStore.get<ESM::Enchantment>().find(enchantId);
|
||||||
|
|
||||||
int type = enchant->mData.mType;
|
int type = enchant->mData.mType;
|
||||||
if (type != ESM::Enchantment::CastOnce
|
if (type != ESM::Enchantment::CastOnce
|
||||||
&& type != ESM::Enchantment::WhenUsed)
|
&& type != ESM::Enchantment::WhenUsed)
|
||||||
|
@ -191,7 +200,7 @@ namespace MWGui
|
||||||
|
|
||||||
for (std::vector<std::string>::const_iterator it = powers.begin(); it != powers.end(); ++it)
|
for (std::vector<std::string>::const_iterator it = powers.begin(); it != powers.end(); ++it)
|
||||||
{
|
{
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||||
MyGUI::Button* t = mSpellView->createWidget<MyGUI::Button>("SpellText",
|
MyGUI::Button* t = mSpellView->createWidget<MyGUI::Button>("SpellText",
|
||||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||||
t->setCaption(spell->mName);
|
t->setCaption(spell->mName);
|
||||||
|
@ -211,7 +220,7 @@ namespace MWGui
|
||||||
addGroup("#{sSpells}", "#{sCostChance}");
|
addGroup("#{sSpells}", "#{sCostChance}");
|
||||||
for (std::vector<std::string>::const_iterator it = spellList.begin(); it != spellList.end(); ++it)
|
for (std::vector<std::string>::const_iterator it = spellList.begin(); it != spellList.end(); ++it)
|
||||||
{
|
{
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||||
MyGUI::Button* t = mSpellView->createWidget<MyGUI::Button>("SpellText",
|
MyGUI::Button* t = mSpellView->createWidget<MyGUI::Button>("SpellText",
|
||||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||||
t->setCaption(spell->mName);
|
t->setCaption(spell->mName);
|
||||||
|
@ -244,7 +253,8 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
MWWorld::Ptr item = *it;
|
MWWorld::Ptr item = *it;
|
||||||
|
|
||||||
const ESM::Enchantment* enchant = MWBase::Environment::get().getWorld()->getStore().enchants.find(MWWorld::Class::get(item).getEnchantment(item));
|
const ESM::Enchantment* enchant =
|
||||||
|
esmStore.get<ESM::Enchantment>().find(MWWorld::Class::get(item).getEnchantment(item));
|
||||||
|
|
||||||
// check if the item is currently equipped (will display in a different color)
|
// check if the item is currently equipped (will display in a different color)
|
||||||
bool equipped = false;
|
bool equipped = false;
|
||||||
|
@ -378,7 +388,9 @@ namespace MWGui
|
||||||
if (MyGUI::InputManager::getInstance().isShiftPressed())
|
if (MyGUI::InputManager::getInstance().isShiftPressed())
|
||||||
{
|
{
|
||||||
// delete spell, if allowed
|
// delete spell, if allowed
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
|
const ESM::Spell* spell =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(spellId);
|
||||||
|
|
||||||
if (spell->mData.mFlags & ESM::Spell::F_Always
|
if (spell->mData.mFlags & ESM::Spell::F_Always
|
||||||
|| spell->mData.mType == ESM::Spell::ST_Power)
|
|| spell->mData.mType == ESM::Spell::ST_Power)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,7 @@ StatsWindow::StatsWindow (MWBase::WindowManager& parWindowManager)
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
for (int i=0; names[i][0]; ++i)
|
for (int i=0; names[i][0]; ++i)
|
||||||
{
|
{
|
||||||
setText (names[i][0], store.gameSettings.find (names[i][1])->getString());
|
setText (names[i][0], store.get<ESM::GameSetting>().find (names[i][1])->getString());
|
||||||
}
|
}
|
||||||
|
|
||||||
getWidget(mSkillView, "SkillView");
|
getWidget(mSkillView, "SkillView");
|
||||||
|
@ -363,12 +363,16 @@ void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId,
|
||||||
float modified = stat.getModified();
|
float modified = stat.getModified();
|
||||||
int progressPercent = (modified - float(static_cast<int>(modified))) * 100;
|
int progressPercent = (modified - float(static_cast<int>(modified))) * 100;
|
||||||
|
|
||||||
const ESM::Skill* skill = MWBase::Environment::get().getWorld()->getStore().skills.search(skillId);
|
const MWWorld::ESMStore &esmStore =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
|
||||||
|
const ESM::Skill* skill = esmStore.get<ESM::Skill>().find(skillId);
|
||||||
assert(skill);
|
assert(skill);
|
||||||
|
|
||||||
std::string icon = "icons\\k\\" + ESM::Skill::sIconNames[skillId];
|
std::string icon = "icons\\k\\" + ESM::Skill::sIconNames[skillId];
|
||||||
|
|
||||||
const ESM::Attribute* attr = MWBase::Environment::get().getWorld()->getStore().attributes.search(skill->mData.mAttribute);
|
const ESM::Attribute* attr =
|
||||||
|
esmStore.get<ESM::Attribute>().find(skill->mData.mAttribute);
|
||||||
assert(attr);
|
assert(attr);
|
||||||
|
|
||||||
std::string state = "normal";
|
std::string state = "normal";
|
||||||
|
@ -425,7 +429,9 @@ void StatsWindow::updateSkillArea()
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
|
||||||
// race tooltip
|
// race tooltip
|
||||||
const ESM::Race* playerRace = store.races.find (MWBase::Environment::get().getWorld()->getPlayer().getRace());
|
const ESM::Race* playerRace =
|
||||||
|
store.get<ESM::Race>().find (MWBase::Environment::get().getWorld()->getPlayer().getRace());
|
||||||
|
|
||||||
MyGUI::Widget* raceWidget;
|
MyGUI::Widget* raceWidget;
|
||||||
getWidget(raceWidget, "RaceText");
|
getWidget(raceWidget, "RaceText");
|
||||||
ToolTips::createRaceToolTip(raceWidget, playerRace);
|
ToolTips::createRaceToolTip(raceWidget, playerRace);
|
||||||
|
@ -464,8 +470,8 @@ void StatsWindow::updateSkillArea()
|
||||||
text += std::string("\n\n#DDC79E#{sNextRank} ") + faction->mRanks[it->second+1];
|
text += std::string("\n\n#DDC79E#{sNextRank} ") + faction->mRanks[it->second+1];
|
||||||
|
|
||||||
ESM::RankData rankData = faction->mData.mRankData[it->second+1];
|
ESM::RankData rankData = faction->mData.mRankData[it->second+1];
|
||||||
const ESM::Attribute* attr1 = MWBase::Environment::get().getWorld()->getStore().attributes.search(faction->mData.mAttribute1);
|
const ESM::Attribute* attr1 = store.get<ESM::Attribute>().find(faction->mData.mAttribute1);
|
||||||
const ESM::Attribute* attr2 = MWBase::Environment::get().getWorld()->getStore().attributes.search(faction->mData.mAttribute2);
|
const ESM::Attribute* attr2 = store.get<ESM::Attribute>().find(faction->mData.mAttribute2);
|
||||||
assert(attr1 && attr2);
|
assert(attr1 && attr2);
|
||||||
|
|
||||||
text += "\n#BF9959#{" + attr1->mName + "}: " + boost::lexical_cast<std::string>(rankData.mAttribute1)
|
text += "\n#BF9959#{" + attr1->mName + "}: " + boost::lexical_cast<std::string>(rankData.mAttribute1)
|
||||||
|
|
|
@ -179,7 +179,9 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
else if (type == "Spell")
|
else if (type == "Spell")
|
||||||
{
|
{
|
||||||
ToolTipInfo info;
|
ToolTipInfo info;
|
||||||
const ESM::Spell *spell = MWBase::Environment::get().getWorld()->getStore().spells.find(focus->getUserString("Spell"));
|
|
||||||
|
const ESM::Spell *spell =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(focus->getUserString("Spell"));
|
||||||
info.caption = spell->mName;
|
info.caption = spell->mName;
|
||||||
Widgets::SpellEffectList effects;
|
Widgets::SpellEffectList effects;
|
||||||
std::vector<ESM::ENAMstruct>::const_iterator end = spell->mEffects.mList.end();
|
std::vector<ESM::ENAMstruct>::const_iterator end = spell->mEffects.mList.end();
|
||||||
|
@ -368,7 +370,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
||||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
if (info.enchant != "")
|
if (info.enchant != "")
|
||||||
{
|
{
|
||||||
enchant = store.enchants.search(info.enchant);
|
enchant = store.get<ESM::Enchantment>().find(info.enchant);
|
||||||
if (enchant->mData.mType == ESM::Enchantment::CastOnce)
|
if (enchant->mData.mType == ESM::Enchantment::CastOnce)
|
||||||
text += "\n#{sItemCastOnce}";
|
text += "\n#{sItemCastOnce}";
|
||||||
else if (enchant->mData.mType == ESM::Enchantment::WhenStrikes)
|
else if (enchant->mData.mType == ESM::Enchantment::WhenStrikes)
|
||||||
|
@ -571,10 +573,15 @@ void ToolTips::createSkillToolTip(MyGUI::Widget* widget, int skillId)
|
||||||
if (skillId == -1)
|
if (skillId == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const MWWorld::ESMStore &store =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
|
||||||
const std::string &skillNameId = ESM::Skill::sSkillNameIds[skillId];
|
const std::string &skillNameId = ESM::Skill::sSkillNameIds[skillId];
|
||||||
const ESM::Skill* skill = MWBase::Environment::get().getWorld()->getStore().skills.search(skillId);
|
const ESM::Skill* skill = store.get<ESM::Skill>().find(skillId);
|
||||||
assert(skill);
|
assert(skill);
|
||||||
const ESM::Attribute* attr = MWBase::Environment::get().getWorld()->getStore().attributes.search(skill->mData.mAttribute);
|
|
||||||
|
const ESM::Attribute* attr =
|
||||||
|
store.get<ESM::Attribute>().find(skill->mData.mAttribute);
|
||||||
assert(attr);
|
assert(attr);
|
||||||
std::string icon = "icons\\k\\" + ESM::Skill::sIconNames[skillId];
|
std::string icon = "icons\\k\\" + ESM::Skill::sIconNames[skillId];
|
||||||
|
|
||||||
|
@ -607,12 +614,14 @@ void ToolTips::createSpecializationToolTip(MyGUI::Widget* widget, const std::str
|
||||||
widget->setUserString("Caption_CenteredCaption", name);
|
widget->setUserString("Caption_CenteredCaption", name);
|
||||||
std::string specText;
|
std::string specText;
|
||||||
// get all skills of this specialisation
|
// get all skills of this specialisation
|
||||||
std::map<int, ESM::Skill> skills = MWBase::Environment::get().getWorld()->getStore().skills.list;
|
const MWWorld::Store<ESM::Skill> &skills =
|
||||||
for (std::map<int, ESM::Skill>::const_iterator it = skills.begin();
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Skill>();
|
||||||
it != skills.end(); ++it)
|
|
||||||
|
MWWorld::Store<ESM::Skill>::iterator it = skills.begin();
|
||||||
|
for (; it != skills.end(); ++it)
|
||||||
{
|
{
|
||||||
if (it->second.mData.mSpecialization == specId)
|
if (it->mData.mSpecialization == specId)
|
||||||
specText += std::string("\n#{") + ESM::Skill::sSkillNameIds[it->second.mIndex] + "}";
|
specText += std::string("\n#{") + ESM::Skill::sSkillNameIds[it->mIndex] + "}";
|
||||||
}
|
}
|
||||||
widget->setUserString("Caption_CenteredCaptionText", specText);
|
widget->setUserString("Caption_CenteredCaptionText", specText);
|
||||||
widget->setUserString("ToolTipLayout", "TextWithCenteredCaptionToolTip");
|
widget->setUserString("ToolTipLayout", "TextWithCenteredCaptionToolTip");
|
||||||
|
@ -621,7 +630,10 @@ void ToolTips::createSpecializationToolTip(MyGUI::Widget* widget, const std::str
|
||||||
|
|
||||||
void ToolTips::createBirthsignToolTip(MyGUI::Widget* widget, const std::string& birthsignId)
|
void ToolTips::createBirthsignToolTip(MyGUI::Widget* widget, const std::string& birthsignId)
|
||||||
{
|
{
|
||||||
const ESM::BirthSign *sign = MWBase::Environment::get().getWorld()->getStore().birthSigns.find(birthsignId);
|
const MWWorld::ESMStore &store =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
|
||||||
|
const ESM::BirthSign *sign = store.get<ESM::BirthSign>().find(birthsignId);
|
||||||
|
|
||||||
widget->setUserString("ToolTipType", "Layout");
|
widget->setUserString("ToolTipType", "Layout");
|
||||||
widget->setUserString("ToolTipLayout", "BirthSignToolTip");
|
widget->setUserString("ToolTipLayout", "BirthSignToolTip");
|
||||||
|
@ -640,7 +652,7 @@ void ToolTips::createBirthsignToolTip(MyGUI::Widget* widget, const std::string&
|
||||||
for (; it != end; ++it)
|
for (; it != end; ++it)
|
||||||
{
|
{
|
||||||
const std::string &spellId = *it;
|
const std::string &spellId = *it;
|
||||||
const ESM::Spell *spell = MWBase::Environment::get().getWorld()->getStore().spells.search(spellId);
|
const ESM::Spell *spell = store.get<ESM::Spell>().search(spellId);
|
||||||
if (!spell)
|
if (!spell)
|
||||||
continue; // Skip spells which cannot be found
|
continue; // Skip spells which cannot be found
|
||||||
ESM::Spell::SpellType type = static_cast<ESM::Spell::SpellType>(spell->mData.mType);
|
ESM::Spell::SpellType type = static_cast<ESM::Spell::SpellType>(spell->mData.mType);
|
||||||
|
@ -655,7 +667,11 @@ void ToolTips::createBirthsignToolTip(MyGUI::Widget* widget, const std::string&
|
||||||
spells.push_back(spellId);
|
spells.push_back(spellId);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct{ const std::vector<std::string> &spells; std::string label; } categories[3] = {
|
struct {
|
||||||
|
const std::vector<std::string> &spells;
|
||||||
|
std::string label;
|
||||||
|
}
|
||||||
|
categories[3] = {
|
||||||
{abilities, "sBirthsignmenu1"},
|
{abilities, "sBirthsignmenu1"},
|
||||||
{powers, "sPowers"},
|
{powers, "sPowers"},
|
||||||
{spells, "sBirthsignmenu2"}
|
{spells, "sBirthsignmenu2"}
|
||||||
|
@ -672,7 +688,7 @@ void ToolTips::createBirthsignToolTip(MyGUI::Widget* widget, const std::string&
|
||||||
|
|
||||||
const std::string &spellId = *it;
|
const std::string &spellId = *it;
|
||||||
|
|
||||||
const ESM::Spell *spell = MWBase::Environment::get().getWorld()->getStore().spells.search(spellId);
|
const ESM::Spell *spell = store.get<ESM::Spell>().find(spellId);
|
||||||
text += "\n#BF9959" + spell->mName;
|
text += "\n#BF9959" + spell->mName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -711,7 +727,8 @@ void ToolTips::createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playe
|
||||||
|
|
||||||
void ToolTips::createMagicEffectToolTip(MyGUI::Widget* widget, short id)
|
void ToolTips::createMagicEffectToolTip(MyGUI::Widget* widget, short id)
|
||||||
{
|
{
|
||||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld ()->getStore ().magicEffects.find(id);
|
const ESM::MagicEffect* effect =
|
||||||
|
MWBase::Environment::get().getWorld ()->getStore ().get<ESM::MagicEffect>().find(id);
|
||||||
const std::string &name = ESM::MagicEffect::effectIdToString (id);
|
const std::string &name = ESM::MagicEffect::effectIdToString (id);
|
||||||
|
|
||||||
std::string icon = effect->mIcon;
|
std::string icon = effect->mIcon;
|
||||||
|
|
|
@ -107,10 +107,14 @@ namespace MWGui
|
||||||
bool goldFound = false;
|
bool goldFound = false;
|
||||||
MWWorld::Ptr gold;
|
MWWorld::Ptr gold;
|
||||||
MWWorld::ContainerStore& playerStore = mWindowManager.getInventoryWindow()->getContainerStore();
|
MWWorld::ContainerStore& playerStore = mWindowManager.getInventoryWindow()->getContainerStore();
|
||||||
|
|
||||||
|
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
|
|
||||||
for (MWWorld::ContainerStoreIterator it = playerStore.begin();
|
for (MWWorld::ContainerStoreIterator it = playerStore.begin();
|
||||||
it != playerStore.end(); ++it)
|
it != playerStore.end(); ++it)
|
||||||
{
|
{
|
||||||
if (MWWorld::Class::get(*it).getName(*it) == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
|
if (MWWorld::Class::get(*it).getName(*it) == gmst.find("sGold")->getString())
|
||||||
{
|
{
|
||||||
goldFound = true;
|
goldFound = true;
|
||||||
gold = *it;
|
gold = *it;
|
||||||
|
|
|
@ -113,8 +113,11 @@ namespace MWGui
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ();
|
||||||
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
||||||
|
|
||||||
|
const MWWorld::ESMStore &store =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
|
||||||
/// \todo mercantile skill
|
/// \todo mercantile skill
|
||||||
int price = pcStats.getSkill (skillId).getBase() * MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find("iTrainingMod")->getInt ();
|
int price = pcStats.getSkill (skillId).getBase() * store.get<ESM::GameSetting>().find("iTrainingMod")->getInt ();
|
||||||
|
|
||||||
if (mWindowManager.getInventoryWindow()->getPlayerGold()<price)
|
if (mWindowManager.getInventoryWindow()->getPlayerGold()<price)
|
||||||
return;
|
return;
|
||||||
|
@ -128,8 +131,9 @@ namespace MWGui
|
||||||
|
|
||||||
// increase skill
|
// increase skill
|
||||||
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();
|
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();
|
||||||
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
|
|
||||||
playerRef->mBase->mClass);
|
const ESM::Class *class_ =
|
||||||
|
store.get<ESM::Class>().find(playerRef->mBase->mClass);
|
||||||
pcStats.increaseSkill (skillId, *class_, true);
|
pcStats.increaseSkill (skillId, *class_, true);
|
||||||
|
|
||||||
// remove gold
|
// remove gold
|
||||||
|
|
|
@ -54,16 +54,19 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
int price = 0;
|
int price = 0;
|
||||||
|
|
||||||
|
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
|
|
||||||
if(interior)
|
if(interior)
|
||||||
{
|
{
|
||||||
price = MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fMagesGuildTravel")->getFloat();
|
price = gmst.find("fMagesGuildTravel")->getFloat();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||||
ESM::Position PlayerPos = player.getRefData().getPosition();
|
ESM::Position PlayerPos = player.getRefData().getPosition();
|
||||||
float d = sqrt( pow(pos.pos[0] - PlayerPos.pos[0],2) + pow(pos.pos[1] - PlayerPos.pos[1],2) + pow(pos.pos[2] - PlayerPos.pos[2],2) );
|
float d = sqrt( pow(pos.pos[0] - PlayerPos.pos[0],2) + pow(pos.pos[1] - PlayerPos.pos[1],2) + pow(pos.pos[2] - PlayerPos.pos[2],2) );
|
||||||
price = d/MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fTravelMult")->getFloat();
|
price = d/gmst.find("fTravelMult")->getFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGUI::Button* toAdd = mDestinationsView->createWidget<MyGUI::Button>((price>mWindowManager.getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton", 0, mCurrentY, 200, sLineHeight, MyGUI::Align::Default);
|
MyGUI::Button* toAdd = mDestinationsView->createWidget<MyGUI::Button>((price>mWindowManager.getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton", 0, mCurrentY, 200, sLineHeight, MyGUI::Align::Default);
|
||||||
|
@ -142,7 +145,7 @@ namespace MWGui
|
||||||
cell = MWBase::Environment::get().getWorld()->getExterior(x,y);
|
cell = MWBase::Environment::get().getWorld()->getExterior(x,y);
|
||||||
ESM::Position PlayerPos = player.getRefData().getPosition();
|
ESM::Position PlayerPos = player.getRefData().getPosition();
|
||||||
float d = sqrt( pow(pos.pos[0] - PlayerPos.pos[0],2) + pow(pos.pos[1] - PlayerPos.pos[1],2) + pow(pos.pos[2] - PlayerPos.pos[2],2) );
|
float d = sqrt( pow(pos.pos[0] - PlayerPos.pos[0],2) + pow(pos.pos[1] - PlayerPos.pos[1],2) + pow(pos.pos[2] - PlayerPos.pos[2],2) );
|
||||||
int time = int(d /MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fTravelTimeMult")->getFloat());
|
int time = int(d /MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fTravelTimeMult")->getFloat());
|
||||||
for(int i = 0;i < time;i++)
|
for(int i = 0;i < time;i++)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getMechanicsManager ()->restoreDynamicStats ();
|
MWBase::Environment::get().getMechanicsManager ()->restoreDynamicStats ();
|
||||||
|
|
|
@ -554,7 +554,9 @@ int WindowManager::readPressedButton ()
|
||||||
|
|
||||||
std::string WindowManager::getGameSettingString(const std::string &id, const std::string &default_)
|
std::string WindowManager::getGameSettingString(const std::string &id, const std::string &default_)
|
||||||
{
|
{
|
||||||
const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.search(id);
|
const ESM::GameSetting *setting =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().search(id);
|
||||||
|
|
||||||
if (setting && setting->mType == ESM::VT_String)
|
if (setting && setting->mType == ESM::VT_String)
|
||||||
return setting->getString();
|
return setting->getString();
|
||||||
return default_;
|
return default_;
|
||||||
|
@ -614,7 +616,8 @@ void WindowManager::changeCell(MWWorld::Ptr::CellStore* cell)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const ESM::Region* region = MWBase::Environment::get().getWorld()->getStore().regions.search(cell->mCell->mRegion);
|
const ESM::Region* region =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Region>().search(cell->mCell->mRegion);
|
||||||
if (region)
|
if (region)
|
||||||
name = region->mName;
|
name = region->mName;
|
||||||
else
|
else
|
||||||
|
@ -717,7 +720,9 @@ void WindowManager::setDragDrop(bool dragDrop)
|
||||||
|
|
||||||
void WindowManager::onRetrieveTag(const MyGUI::UString& _tag, MyGUI::UString& _result)
|
void WindowManager::onRetrieveTag(const MyGUI::UString& _tag, MyGUI::UString& _result)
|
||||||
{
|
{
|
||||||
const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.find(_tag);
|
const ESM::GameSetting *setting =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(_tag);
|
||||||
|
|
||||||
if (setting && setting->mType == ESM::VT_String)
|
if (setting && setting->mType == ESM::VT_String)
|
||||||
_result = setting->getString();
|
_result = setting->getString();
|
||||||
else
|
else
|
||||||
|
@ -808,7 +813,10 @@ void WindowManager::removeGuiMode(GuiMode mode)
|
||||||
void WindowManager::setSelectedSpell(const std::string& spellId, int successChancePercent)
|
void WindowManager::setSelectedSpell(const std::string& spellId, int successChancePercent)
|
||||||
{
|
{
|
||||||
mHud->setSelectedSpell(spellId, successChancePercent);
|
mHud->setSelectedSpell(spellId, successChancePercent);
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
|
|
||||||
|
const ESM::Spell* spell =
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(spellId);
|
||||||
|
|
||||||
mSpellWindow->setTitle(spell->mName);
|
mSpellWindow->setTitle(spell->mName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue