mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
outfit looktype change
This commit is contained in:
@@ -77,6 +77,8 @@ void OTClient::registerLuaFunctions()
|
||||
g_lua.bindClassStaticFunction<UICreature>("create", &UICreature::create<UICreature>);
|
||||
g_lua.bindClassMemberFunction<UICreature>("getCreature", &UICreature::getCreature);
|
||||
g_lua.bindClassMemberFunction<UICreature>("setCreature", &UICreature::setCreature);
|
||||
g_lua.bindClassMemberFunction<UICreature>("setOutfitType", &UICreature::setOutfitType);
|
||||
|
||||
|
||||
g_lua.registerClass<UIMap, UIWidget>();
|
||||
g_lua.bindClassStaticFunction<UIMap>("create", &UIWidget::create<UIMap>);
|
||||
|
@@ -50,3 +50,12 @@ void UICreature::onStyleApply(const OTMLNodePtr& styleNode)
|
||||
|
||||
UIWidget::onStyleApply(styleNode);
|
||||
}
|
||||
|
||||
void UICreature::setOutfitType(int outfitType)
|
||||
{
|
||||
if(m_creature) {
|
||||
Outfit outfit = m_creature->getOutfit();
|
||||
outfit.setType(outfitType);
|
||||
m_creature->setOutfit(outfit);
|
||||
}
|
||||
}
|
||||
|
@@ -34,6 +34,8 @@ public:
|
||||
void render();
|
||||
|
||||
void setCreature(const CreaturePtr& creature) { m_creature = creature; }
|
||||
void setOutfitType(int outfitType);
|
||||
|
||||
CreaturePtr getCreature() { return m_creature; }
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user