Fixes to horizontal scrollarea, improve charlist flexibility

This commit is contained in:
Henrique Santiago
2012-08-31 01:56:10 -03:00
parent c517f7b745
commit 18a0d7ab94
12 changed files with 133 additions and 60 deletions

View File

@@ -130,7 +130,7 @@ void UIWidget::parseBaseStyle(const OTMLNodePtr& styleNode)
setBorderWidth(stdext::safe_cast<int>(split[0]));
setBorderColor(stdext::safe_cast<Color>(split[1]));
} else
throw OTMLException(node, "border param must have its width followed by its color");
throw OTMLException(node, "border param must have its width followed by its color");
}
else if(node->tag() == "border-width")
setBorderWidth(node->value<int>());

View File

@@ -462,6 +462,7 @@ void OTClient::registerLuaFunctions()
g_lua.registerClass<UICreature, UIWidget>();
g_lua.bindClassStaticFunction<UICreature>("create", []{ return UICreaturePtr(new UICreature); } );
g_lua.bindClassMemberFunction<UICreature>("setCreature", &UICreature::setCreature);
g_lua.bindClassMemberFunction<UICreature>("setOutfit", &UICreature::setOutfit);
g_lua.bindClassMemberFunction<UICreature>("setFixedCreatureSize", &UICreature::setFixedCreatureSize);
g_lua.bindClassMemberFunction<UICreature>("getCreature", &UICreature::getCreature);
g_lua.bindClassMemberFunction<UICreature>("isFixedCreatureSize", &UICreature::isFixedCreatureSize);

View File

@@ -38,6 +38,14 @@ void UICreature::drawSelf(Fw::DrawPane drawPane)
}
}
void UICreature::setOutfit(const Outfit& outfit)
{
if(!m_creature)
m_creature = CreaturePtr(new Creature);
m_creature->setDirection(Otc::South);
m_creature->setOutfit(outfit);
}
void UICreature::onStyleApply(const std::string& styleName, const OTMLNodePtr& styleNode)
{
UIWidget::onStyleApply(styleName, styleNode);

View File

@@ -34,6 +34,7 @@ public:
void setCreature(const CreaturePtr& creature) { m_creature = creature; }
void setFixedCreatureSize(bool fixed) { m_fixedCreatureSize = fixed; }
void setOutfit(const Outfit& outfit);
CreaturePtr getCreature() { return m_creature; }
bool isFixedCreatureSize() { return m_fixedCreatureSize; }