mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
remove debug message, minor battle fix
This commit is contained in:
@@ -279,10 +279,7 @@ function Battle.removeCreature(creature)
|
||||
if lastBattleButtonSwitched == battleButtonsByCreaturesList[creatureId] then
|
||||
lastBattleButtonSwitched = nil
|
||||
end
|
||||
|
||||
if battleButtonsByCreaturesList[creatureId].isTarget then
|
||||
g_game.cancelAttack()
|
||||
end
|
||||
|
||||
battleButtonsByCreaturesList[creatureId].creature:hideStaticSquare()
|
||||
battleButtonsByCreaturesList[creatureId]:destroy()
|
||||
battleButtonsByCreaturesList[creatureId] = nil
|
||||
|
@@ -30,7 +30,7 @@ function HealthBar.init()
|
||||
connect(LocalPlayer, { onHealthChange = HealthBar.onHealthChange,
|
||||
onManaChange = HealthBar.onManaChange,
|
||||
onStatesChange = HealthBar.onStatesChange })
|
||||
|
||||
|
||||
connect(g_game, { onGameEnd = HealthBar.offline })
|
||||
|
||||
healthBarWindow = displayUI('healthbar.otui', GameInterface.getLeftPanel())
|
||||
@@ -52,7 +52,7 @@ function HealthBar.terminate()
|
||||
disconnect(LocalPlayer, { onHealthChange = HealthBar.onHealthChange,
|
||||
onManaChange = HealthBar.onManaChange,
|
||||
onStatesChange = HealthBar.onStatesChange })
|
||||
|
||||
|
||||
disconnect(g_game, { onGameEnd = HealthBar.offline })
|
||||
|
||||
healthBarWindow:destroy()
|
||||
@@ -71,6 +71,10 @@ function HealthBar.toggle()
|
||||
healthBarButton:setOn(visible)
|
||||
end
|
||||
|
||||
function HealthBar.offline()
|
||||
healthBarWindow:recursiveGetChildById('conditions_content'):destroyChildren()
|
||||
end
|
||||
|
||||
-- hooked events
|
||||
function HealthBar.onHealthChange(localPlayer, health, maxHealth)
|
||||
healthLabel:setText(health .. ' / ' .. maxHealth)
|
||||
@@ -115,9 +119,3 @@ function HealthBar.toggleIcon(bitChanged)
|
||||
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 |
@@ -237,7 +237,6 @@ void LocalPlayer::setLevel(double level, double levelPercent)
|
||||
m_level = level;
|
||||
m_levelPercent = levelPercent;
|
||||
|
||||
dump << "yeah";
|
||||
callLuaField("onLevelChange", level, levelPercent, oldLevel, oldLevelPercent);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user