Skip to content

Commit

Permalink
Change constant value to height of topmenu
Browse files Browse the repository at this point in the history
Add changes who avoid problem with change size of client topmenu.
  • Loading branch information
EgzoT authored Feb 17, 2018
1 parent 5946879 commit 735a650
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions game_healthcircle/game_healthcircle.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mapPanel = modules.game_interface.getMapPanel()
gameRootPanel = modules.game_interface.gameBottomPanel
gameLeftPanel = modules.game_interface.getLeftPanel()
gameTopMenu = modules.client_topmenu.getTopMenu()

function currentViewMode()
return modules.game_interface.currentViewMode
Expand Down Expand Up @@ -90,7 +91,7 @@ function whenHealthChange()
end

if currentViewMode() ~= 2 then
healthCircleFront:setY(mapPanel:getHeight() / 2 - healthCircle:getHeight() / 2 + 30 + Yhppc)
healthCircleFront:setY(mapPanel:getHeight() / 2 - healthCircle:getHeight() / 2 + gameTopMenu:getHeight() + Yhppc)
else
healthCircleFront:setY(mapPanel:getHeight() / 2 - healthCircle:getHeight() / 2 + 0 + Yhppc)
end
Expand All @@ -103,7 +104,7 @@ function whenManaChange()
local rect = { x = 0, y = Ymppc, width = 63, height = 208 }
manaCircleFront:setImageClip(rect)
if currentViewMode() ~= 2 then
manaCircleFront:setY(mapPanel:getHeight() / 2 - manaCircle:getHeight() / 2 + 30 + Ymppc)
manaCircleFront:setY(mapPanel:getHeight() / 2 - manaCircle:getHeight() / 2 + gameTopMenu:getHeight() + Ymppc)
else
manaCircleFront:setY(mapPanel:getHeight() / 2 - manaCircle:getHeight() / 2 + 0 + Ymppc)
end
Expand Down Expand Up @@ -131,17 +132,17 @@ function whenMapResizeChange()
healthCircle:setX(math.floor((mapPanel:getWidth() / 2 + healthCircle:getWidth() / 2 - 150 + gameLeftPanel:getWidth())) * 0.92)
manaCircle:setX(math.floor((mapPanel:getWidth() / 2 + manaCircle:getWidth() / 2 + gameLeftPanel:getWidth())) * 1.08)

healthCircle:setY(mapPanel:getHeight() / 2 - healthCircle:getHeight() / 2 + 30)
manaCircle:setY(mapPanel:getHeight() / 2 - manaCircle:getHeight() / 2 + 30)
healthCircle:setY(mapPanel:getHeight() / 2 - healthCircle:getHeight() / 2 + gameTopMenu:getHeight())
manaCircle:setY(mapPanel:getHeight() / 2 - manaCircle:getHeight() / 2 + gameTopMenu:getHeight())
else
healthCircleFront:setX(math.floor((mapPanel:getWidth() / 2 + healthCircle:getWidth() / 2 - 150)) * 0.92)
manaCircleFront:setX(math.floor((mapPanel:getWidth() / 2 + manaCircle:getWidth() / 2 + 0)) * 1.08)

healthCircle:setX(math.floor((mapPanel:getWidth() / 2 + healthCircle:getWidth() / 2 - 150)) * 0.92)
manaCircle:setX(math.floor((mapPanel:getWidth() / 2 + manaCircle:getWidth() / 2 + 0)) * 1.08)

healthCircle:setY(mapPanel:getHeight() / 2 - healthCircle:getHeight() / 2 + 30)
manaCircle:setY(mapPanel:getHeight() / 2 - manaCircle:getHeight() / 2 + 30)
healthCircle:setY(mapPanel:getHeight() / 2 - healthCircle:getHeight() / 2 + gameTopMenu:getHeight())
manaCircle:setY(mapPanel:getHeight() / 2 - manaCircle:getHeight() / 2 + gameTopMenu:getHeight())
end
end
end
2 changes: 1 addition & 1 deletion game_healthcircle/game_healthcircle.otmod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Module
description: Draw health circle and mana circle in game map.
author: EgzoT, GustavoBlaze, Tekadon58
website: https://github.com/EgzoT/-OTClient-Mod-health_and_mana_circle
version: 1.1
version: 1.1.1

autoload: true
autoload-priority: 1000
Expand Down

0 comments on commit 735a650

Please sign in to comment.