remove debug message, minor battle fix

This commit is contained in:
Eduardo Bart 2012-03-30 07:06:33 -03:00
parent fa3d60a00a
commit 95e0a41b55
4 changed files with 7 additions and 13 deletions

View File

@ -279,10 +279,7 @@ function Battle.removeCreature(creature)
if lastBattleButtonSwitched == battleButtonsByCreaturesList[creatureId] then if lastBattleButtonSwitched == battleButtonsByCreaturesList[creatureId] then
lastBattleButtonSwitched = nil lastBattleButtonSwitched = nil
end end
if battleButtonsByCreaturesList[creatureId].isTarget then
g_game.cancelAttack()
end
battleButtonsByCreaturesList[creatureId].creature:hideStaticSquare() battleButtonsByCreaturesList[creatureId].creature:hideStaticSquare()
battleButtonsByCreaturesList[creatureId]:destroy() battleButtonsByCreaturesList[creatureId]:destroy()
battleButtonsByCreaturesList[creatureId] = nil battleButtonsByCreaturesList[creatureId] = nil

View File

@ -30,7 +30,7 @@ function HealthBar.init()
connect(LocalPlayer, { onHealthChange = HealthBar.onHealthChange, connect(LocalPlayer, { onHealthChange = HealthBar.onHealthChange,
onManaChange = HealthBar.onManaChange, onManaChange = HealthBar.onManaChange,
onStatesChange = HealthBar.onStatesChange }) onStatesChange = HealthBar.onStatesChange })
connect(g_game, { onGameEnd = HealthBar.offline }) connect(g_game, { onGameEnd = HealthBar.offline })
healthBarWindow = displayUI('healthbar.otui', GameInterface.getLeftPanel()) healthBarWindow = displayUI('healthbar.otui', GameInterface.getLeftPanel())
@ -52,7 +52,7 @@ function HealthBar.terminate()
disconnect(LocalPlayer, { onHealthChange = HealthBar.onHealthChange, disconnect(LocalPlayer, { onHealthChange = HealthBar.onHealthChange,
onManaChange = HealthBar.onManaChange, onManaChange = HealthBar.onManaChange,
onStatesChange = HealthBar.onStatesChange }) onStatesChange = HealthBar.onStatesChange })
disconnect(g_game, { onGameEnd = HealthBar.offline }) disconnect(g_game, { onGameEnd = HealthBar.offline })
healthBarWindow:destroy() healthBarWindow:destroy()
@ -71,6 +71,10 @@ function HealthBar.toggle()
healthBarButton:setOn(visible) healthBarButton:setOn(visible)
end end
function HealthBar.offline()
healthBarWindow:recursiveGetChildById('conditions_content'):destroyChildren()
end
-- hooked events -- hooked events
function HealthBar.onHealthChange(localPlayer, health, maxHealth) function HealthBar.onHealthChange(localPlayer, health, maxHealth)
healthLabel:setText(health .. ' / ' .. maxHealth) healthLabel:setText(health .. ' / ' .. maxHealth)
@ -115,9 +119,3 @@ function HealthBar.toggleIcon(bitChanged)
end end
end end
function HealthBar.offline()
local conditionsContent = healthBarWindow:recursiveGetChildById('conditions_content')
local count = conditionsContent:getChildCount()
for i = count, 1, -1 do conditionsContent:getChildByIndex(i):destroy() end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -237,7 +237,6 @@ void LocalPlayer::setLevel(double level, double levelPercent)
m_level = level; m_level = level;
m_levelPercent = levelPercent; m_levelPercent = levelPercent;
dump << "yeah";
callLuaField("onLevelChange", level, levelPercent, oldLevel, oldLevelPercent); callLuaField("onLevelChange", level, levelPercent, oldLevel, oldLevelPercent);
} }
} }