mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
Fixes to horizontal scrollarea, improve charlist flexibility
This commit is contained in:
@@ -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>());
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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; }
|
||||
|
Reference in New Issue
Block a user