mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 22:23:28 +02:00
Version 2.2 - retro layout + bug fixes
This commit is contained in:
@@ -45,11 +45,14 @@ function init()
|
||||
|
||||
connect(g_game, { onGameEnd = offline })
|
||||
|
||||
healthInfoButton = modules.client_topmenu.addRightGameToggleButton('healthInfoButton', tr('Health Information'), '/images/topbuttons/healthinfo', toggle)
|
||||
healthInfoButton:setOn(true)
|
||||
|
||||
healthInfoWindow = g_ui.loadUI('healthinfo', modules.game_interface.getRightPanel())
|
||||
healthInfoWindow:disableResize()
|
||||
|
||||
if not healthInfoWindow.forceOpen then
|
||||
healthInfoButton = modules.client_topmenu.addRightGameToggleButton('healthInfoButton', tr('Health Information'), '/images/topbuttons/healthinfo', toggle)
|
||||
healthInfoButton:setOn(true)
|
||||
end
|
||||
|
||||
healthBar = healthInfoWindow:recursiveGetChildById('healthBar')
|
||||
manaBar = healthInfoWindow:recursiveGetChildById('manaBar')
|
||||
experienceBar = healthInfoWindow:recursiveGetChildById('experienceBar')
|
||||
@@ -100,11 +103,14 @@ function terminate()
|
||||
disconnect(overlay, { onGeometryChange = onOverlayGeometryChange })
|
||||
|
||||
healthInfoWindow:destroy()
|
||||
healthInfoButton:destroy()
|
||||
if healthInfoButton then
|
||||
healthInfoButton:destroy()
|
||||
end
|
||||
overlay:destroy()
|
||||
end
|
||||
|
||||
function toggle()
|
||||
if not healthInfoButton then return end
|
||||
if healthInfoButton:isOn() then
|
||||
healthInfoWindow:close()
|
||||
healthInfoButton:setOn(false)
|
||||
@@ -140,7 +146,9 @@ end
|
||||
|
||||
-- hooked events
|
||||
function onMiniWindowClose()
|
||||
healthInfoButton:setOn(false)
|
||||
if healthInfoButton then
|
||||
healthInfoButton:setOn(false)
|
||||
end
|
||||
end
|
||||
|
||||
function onHealthChange(localPlayer, health, maxHealth)
|
||||
|
@@ -1,158 +1,5 @@
|
||||
HealthBar < ProgressBar
|
||||
id: healthBar
|
||||
background-color: #ff4444
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
margin: 1
|
||||
|
||||
ManaBar < ProgressBar
|
||||
id: manaBar
|
||||
background-color: #4444ff
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
margin: 1
|
||||
margin-top: 3
|
||||
|
||||
ExperienceBar < ProgressBar
|
||||
id: experienceBar
|
||||
background-color: #B6E866
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
margin: 1
|
||||
margin-top: 3
|
||||
|
||||
SoulLabel < GameLabel
|
||||
id: soulLabel
|
||||
text-align: right
|
||||
color: white
|
||||
font: verdana-11px-rounded
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.horizontalCenter
|
||||
margin-top: 5
|
||||
margin-right: 3
|
||||
on: true
|
||||
|
||||
$!on:
|
||||
visible: false
|
||||
margin-top: 0
|
||||
height: 0
|
||||
|
||||
CapLabel < GameLabel
|
||||
id: capLabel
|
||||
color: white
|
||||
font: verdana-11px-rounded
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.horizontalCenter
|
||||
margin-top: 5
|
||||
margin-left: 3
|
||||
on: true
|
||||
|
||||
$!on:
|
||||
visible: false
|
||||
margin-top: 0
|
||||
height: 0
|
||||
|
||||
ConditionWidget < UIWidget
|
||||
size: 18 18
|
||||
|
||||
$!first:
|
||||
margin-left: 2
|
||||
|
||||
HealthOverlay < UIWidget
|
||||
id: healthOverlay
|
||||
anchors.fill: parent
|
||||
phantom: true
|
||||
|
||||
ProgressBar
|
||||
id: topHealthBar
|
||||
background-color: #ff4444
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.horizontalCenter
|
||||
height: 16
|
||||
phantom: true
|
||||
|
||||
ProgressBar
|
||||
id: topManaBar
|
||||
background-color: #4444ff
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.horizontalCenter
|
||||
height: 16
|
||||
phantom: true
|
||||
|
||||
UIProgressBar
|
||||
id: healthCircle
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
image-source: /images/game/circle/left_empty
|
||||
margin-right: 169
|
||||
margin-bottom: 16
|
||||
opacity: 0.5
|
||||
phantom: true
|
||||
|
||||
UIProgressBar
|
||||
id: healthCircleFront
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
image-source: /images/game/circle/left_full
|
||||
margin-right: 169
|
||||
margin-bottom: 16
|
||||
opacity: 0.5
|
||||
phantom: true
|
||||
|
||||
UIProgressBar
|
||||
id: manaCircle
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
image-source: /images/game/circle/right_empty
|
||||
margin-left: 130
|
||||
margin-bottom: 16
|
||||
opacity: 0.5
|
||||
phantom: true
|
||||
|
||||
UIProgressBar
|
||||
id: manaCircleFront
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
image-source: /images/game/circle/right_full
|
||||
margin-left: 130
|
||||
margin-bottom: 16
|
||||
opacity: 0.4
|
||||
image-color: #0000FFFF
|
||||
phantom: true
|
||||
|
||||
MiniWindow
|
||||
icon: /images/topbuttons/healthinfo
|
||||
HealthInfoWindow
|
||||
id: healthInfoWindow
|
||||
!text: tr('Health Info')
|
||||
height: 123
|
||||
@onClose: modules.game_healthinfo.onMiniWindowClose()
|
||||
&save: true
|
||||
&autoOpen: 2
|
||||
|
||||
MiniWindowContents
|
||||
HealthBar
|
||||
ManaBar
|
||||
ExperienceBar
|
||||
Panel
|
||||
id: conditionPanel
|
||||
layout:
|
||||
type: horizontalBox
|
||||
height: 22
|
||||
margin-top: 4
|
||||
padding: 2
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
border-width: 1
|
||||
border-color: #00000077
|
||||
background-color: #ffffff11
|
||||
SoulLabel
|
||||
CapLabel
|
||||
|
||||
|
Reference in New Issue
Block a user