mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 21:13:26 +02:00
restore old modules
* partially restore vip, battle, healthbar, skills and inventory modules * more fixes on UIWidgets * implement UIMiniWindow close/minimize functionality * allow drag and drop miniwindows beteween game panels
This commit is contained in:
@@ -12,13 +12,13 @@ function HealthBar.init()
|
||||
connect(LocalPlayer, { onHealthChange = HealthBar.onHealthChange,
|
||||
onManaChange = HealthBar.onManaChange })
|
||||
|
||||
healthBarWindow = displayUI('healthbar.otui', GameInterface.getRightPanel())
|
||||
healthBarWindow = displayUI('healthbar.otui', GameInterface.getLeftPanel())
|
||||
healthBarButton = TopMenu.addGameToggleButton('healthBarButton', 'Healh Bar', 'healthbar.png', HealthBar.toggle)
|
||||
healthBarButton:setOn(true)
|
||||
healthBar = healthBarWindow:getChildById('healthBar')
|
||||
manaBar = healthBarWindow:getChildById('manaBar')
|
||||
healthLabel = healthBarWindow:getChildById('healthLabel')
|
||||
manaLabel = healthBarWindow:getChildById('manaLabel')
|
||||
healthBar = healthBarWindow:recursiveGetChildById('healthBar')
|
||||
manaBar = healthBarWindow:recursiveGetChildById('manaBar')
|
||||
healthLabel = healthBarWindow:recursiveGetChildById('healthLabel')
|
||||
manaLabel = healthBarWindow:recursiveGetChildById('manaLabel')
|
||||
|
||||
if g_game.isOnline() then
|
||||
local localPlayer = g_game.getLocalPlayer()
|
||||
@@ -32,8 +32,8 @@ function HealthBar.terminate()
|
||||
onManaChange = HealthBar.onManaChange })
|
||||
|
||||
healthBarWindow:destroy()
|
||||
healthBarWindow = nil
|
||||
healthBarButton:destroy()
|
||||
healthBarWindow = nil
|
||||
healthBarButton = nil
|
||||
healthBar = nil
|
||||
manaBar = nil
|
||||
|
@@ -10,9 +10,10 @@ ManaBar < ProgressBar
|
||||
id: manaBar
|
||||
height: 15
|
||||
background-color: #4444ff
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
margin-top: 4
|
||||
|
||||
HealthLabel < GameLabel
|
||||
id: healthLabel
|
||||
@@ -32,16 +33,15 @@ ManaLabel < GameLabel
|
||||
margin-top: 2
|
||||
text: 0 / 0
|
||||
|
||||
BorderlessGameWindow
|
||||
id: healthManaPanel
|
||||
width: 192
|
||||
height: 34
|
||||
margin-top: 10
|
||||
margin-left: 6
|
||||
margin-right: 6
|
||||
move-policy: free updated
|
||||
MiniWindow
|
||||
icon: healthbar.png
|
||||
id: healthBarWindow
|
||||
text: Health Bar
|
||||
height: 64
|
||||
@onClose: HealthBar.toggle()
|
||||
|
||||
HealthBar
|
||||
HealthLabel
|
||||
ManaBar
|
||||
ManaLabel
|
||||
MiniWindowContents
|
||||
HealthBar
|
||||
HealthLabel
|
||||
ManaBar
|
||||
ManaLabel
|
||||
|
Reference in New Issue
Block a user