From 9e0ddb08e3161be88723da66793120facbe0a404 Mon Sep 17 00:00:00 2001 From: BenDol Date: Mon, 14 Jul 2014 01:56:17 +1200 Subject: [PATCH] More debug prints and avoid null pointer. --- modules/gamelib/ui/uiminimap.lua | 1 - src/framework/ui/uimanager.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/gamelib/ui/uiminimap.lua b/modules/gamelib/ui/uiminimap.lua index 61eac68b..13b23d46 100644 --- a/modules/gamelib/ui/uiminimap.lua +++ b/modules/gamelib/ui/uiminimap.lua @@ -257,7 +257,6 @@ end function UIMinimap:onStyleApply(styleName, styleNode) for name,value in pairs(styleNode) do if name == 'autowalk' then - print(value) self.autowalk = value end end diff --git a/src/framework/ui/uimanager.cpp b/src/framework/ui/uimanager.cpp index c8e8a20a..1a2e0ecf 100644 --- a/src/framework/ui/uimanager.cpp +++ b/src/framework/ui/uimanager.cpp @@ -447,9 +447,9 @@ UIWidgetPtr UIManager::createWidgetFromOTML(const OTMLNodePtr& widgetNode, const if(parent) parent->addChild(widget); - widget->callLuaField("onCreate"); - if(widget) { + widget->callLuaField("onCreate"); + widget->setStyleFromNode(styleNode); for(const OTMLNodePtr& childNode : styleNode->children()) {