From 95e0a41b55e413ecf5222ab40d321f35e26e9b81 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Fri, 30 Mar 2012 07:06:33 -0300 Subject: [PATCH] remove debug message, minor battle fix --- modules/game_battle/battle.lua | 5 +---- modules/game_healthbar/healthbar.lua | 14 ++++++-------- .../icons/protection_zone_Block.png | Bin 1485 -> 0 bytes src/otclient/core/localplayer.cpp | 1 - 4 files changed, 7 insertions(+), 13 deletions(-) delete mode 100644 modules/game_healthbar/icons/protection_zone_Block.png diff --git a/modules/game_battle/battle.lua b/modules/game_battle/battle.lua index 5c25bdc7..d9dba2e8 100644 --- a/modules/game_battle/battle.lua +++ b/modules/game_battle/battle.lua @@ -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 diff --git a/modules/game_healthbar/healthbar.lua b/modules/game_healthbar/healthbar.lua index 7a0ce495..c4da7dee 100644 --- a/modules/game_healthbar/healthbar.lua +++ b/modules/game_healthbar/healthbar.lua @@ -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 - diff --git a/modules/game_healthbar/icons/protection_zone_Block.png b/modules/game_healthbar/icons/protection_zone_Block.png deleted file mode 100644 index 47bcade8ade2bff2af7a053b592ac55678506c67..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1485 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+3?vf;>QaFeV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1lA?!^yU(ueZ-h(p!o9_SGvDVZK|pZawPCRjkE0ckWy{9)>?xB2NTqZgXS_Q|7o3 zCY>9qesYdyO>vQ&sEDeZ)Xh^Th52|Jbs09t7_A9XGnL@Fn8m-$ncvmIczUV%+sBV) zmgF2=JYR^NafTW5ofAhNhU#n$RH)5Jn&}~{B_)|co?7GyDP@Qn4``x*MYw(A-+I|eUdfbh6;04 znInEOPa-TnzkcPVB%mxIVI;xJ&&k$e!g2M&c||_<-i)YPU552`EE)oAd;KI2uU@g( znq`fTRFy8r%_!aan4nwXhR?2F*&VL^;>nYFZsLIo?5`g_5D?%QulVlciP+kWlQg^ zuQ~hf+&OkBiR6}L8FuseFG?}2`gHQd!FgfTTjhjgKlY38-&m?GyYFey>gAUzOm0=H zD;!vL?pUVHh{%yPU+K=X{Bq;g^-P^_^y9yud>L&# zpK+7p8lKASu_g7pOKm>P`V!fuIB|C3?L*D(#`8BZt^3vfNwQDmw%VD?49xno8}eV* z)$jALIQNG`hdWyI!0x`!)oCU#O=dQPYDBzP{^VR6_j=Felerw03%v*rm$|u=sr)A2 zny9sA0gqxie{YsxS}Yjhd_AFCM=UaiWr0g}T#2fX*zPr9vss?TPf_t)6*7;-al!Lh iia+KHEWFlGawwj$$I(jQ_J#GJwCd^V=d#Wzp$Pyi1XDNw diff --git a/src/otclient/core/localplayer.cpp b/src/otclient/core/localplayer.cpp index 567e7fcb..4ef55c60 100644 --- a/src/otclient/core/localplayer.cpp +++ b/src/otclient/core/localplayer.cpp @@ -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); } }