|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
#include "widgets.hpp"
|
|
|
|
|
#include "window_manager.hpp"
|
|
|
|
|
#include "../mwworld/environment.hpp"
|
|
|
|
|
#include "../mwworld/world.hpp"
|
|
|
|
|
#include "components/esm_store/store.hpp"
|
|
|
|
|
|
|
|
|
|
//#include <boost/algorithm/string.hpp>
|
|
|
|
|
#include <boost/lexical_cast.hpp>
|
|
|
|
@ -7,6 +10,8 @@
|
|
|
|
|
using namespace MWGui;
|
|
|
|
|
using namespace MWGui::Widgets;
|
|
|
|
|
|
|
|
|
|
/* MWSkill */
|
|
|
|
|
|
|
|
|
|
MWSkill::MWSkill()
|
|
|
|
|
: manager(nullptr)
|
|
|
|
|
, skillId(ESM::Skill::Length)
|
|
|
|
@ -105,7 +110,7 @@ void MWSkill::shutdownWidgetSkin()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* MWSkill */
|
|
|
|
|
/* MWAttribute */
|
|
|
|
|
|
|
|
|
|
MWAttribute::MWAttribute()
|
|
|
|
|
: manager(nullptr)
|
|
|
|
@ -204,3 +209,66 @@ void MWAttribute::initialiseWidgetSkin(ResourceSkin* _info)
|
|
|
|
|
void MWAttribute::shutdownWidgetSkin()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* MWSpell */
|
|
|
|
|
|
|
|
|
|
MWSpell::MWSpell()
|
|
|
|
|
: env(nullptr)
|
|
|
|
|
, spellNameWidget(nullptr)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MWSpell::setSpellId(const std::string &spellId)
|
|
|
|
|
{
|
|
|
|
|
id = spellId;
|
|
|
|
|
updateWidgets();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MWSpell::updateWidgets()
|
|
|
|
|
{
|
|
|
|
|
if (spellNameWidget && env)
|
|
|
|
|
{
|
|
|
|
|
ESMS::ESMStore &store = env->mWorld->getStore();
|
|
|
|
|
const ESM::Spell *spell = store.spells.search(id);
|
|
|
|
|
if (spell)
|
|
|
|
|
spellNameWidget->setCaption(spell->name);
|
|
|
|
|
else
|
|
|
|
|
spellNameWidget->setCaption("");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MWSpell::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
|
|
|
|
{
|
|
|
|
|
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
|
|
|
|
|
|
|
|
|
initialiseWidgetSkin(_info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MWSpell::~MWSpell()
|
|
|
|
|
{
|
|
|
|
|
shutdownWidgetSkin();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MWSpell::baseChangeWidgetSkin(ResourceSkin* _info)
|
|
|
|
|
{
|
|
|
|
|
shutdownWidgetSkin();
|
|
|
|
|
Base::baseChangeWidgetSkin(_info);
|
|
|
|
|
initialiseWidgetSkin(_info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MWSpell::initialiseWidgetSkin(ResourceSkin* _info)
|
|
|
|
|
{
|
|
|
|
|
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
|
|
|
|
{
|
|
|
|
|
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
|
|
|
|
if (name == "StatName")
|
|
|
|
|
{
|
|
|
|
|
MYGUI_DEBUG_ASSERT( ! spellNameWidget, "widget already assigned");
|
|
|
|
|
spellNameWidget = (*iter)->castType<StaticText>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MWSpell::shutdownWidgetSkin()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|