Fix tooltip, minimap

master
Henrique Santiago 11 years ago
parent e370ffdb0f
commit 4c3c945bab

@ -67,7 +67,7 @@ function g_tooltip.terminate()
end end
function g_tooltip.display(text) function g_tooltip.display(text)
if text == nil then return end if text == nil or text:len() == 0 then return end
if not toolTipLabel then return end if not toolTipLabel then return end
toolTipLabel:setText(text) toolTipLabel:setText(text)

@ -11,7 +11,7 @@ function UIMinimap:onSetup()
self.allowFollowLocalPlayer = true self.allowFollowLocalPlayer = true
self.onPositionChange = function() self:followLocalPlayer() end self.onPositionChange = function() self:followLocalPlayer() end
self.onAddAutomapFlag = function(pos, icon, description) self:addFlag(pos, icon, description) end self.onAddAutomapFlag = function(pos, icon, description) self:addFlag(pos, icon, description) end
self.onRemoveAutomapFlag = function(pos, icon, description) self:addFlag(pos, icon, description) end self.onRemoveAutomapFlag = function(pos, icon, description) self:removeFlag(pos, icon, description) end
connect(g_game, { connect(g_game, {
onAddAutomapFlag = self.onAddAutomapFlag, onAddAutomapFlag = self.onAddAutomapFlag,
onRemoveAutomapFlag = self.onRemoveAutomapFlag, onRemoveAutomapFlag = self.onRemoveAutomapFlag,
@ -120,7 +120,7 @@ function UIMinimap:getFlag(pos, icon, description)
local children = self.flagsWidget:getChildren() local children = self.flagsWidget:getChildren()
for i=1,#children do for i=1,#children do
local flag = children[i] local flag = children[i]
if flag.pos.x == pos.x and flag.pos.y == pos.y and flag.pos.z == pos.z and flag.icon == icon and flag.description == description then if flag.pos.x == pos.x and flag.pos.y == pos.y and flag.pos.z == pos.z then
return flag return flag
end end
end end

Loading…
Cancel
Save