mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +02:00
Fix #235 and other changes
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
CharacterWidget < UIWidget
|
||||
height: 14
|
||||
focusable: true
|
||||
background-color: alpha
|
||||
@onFocusChange: |
|
||||
local children = self:getChildren()
|
||||
for i=1,#children do
|
||||
children[i]:setOn(self:isFocused())
|
||||
&updateOnStates: |
|
||||
function(self)
|
||||
local children = self:getChildren()
|
||||
for i=1,#children do
|
||||
children[i]:setOn(self:isFocused())
|
||||
end
|
||||
end
|
||||
@onFocusChange: self:updateOnStates()
|
||||
@onSetup: self:updateOnStates()
|
||||
|
||||
$focus:
|
||||
background-color: #ffffff22
|
||||
@@ -60,6 +63,7 @@ MainWindow
|
||||
padding: 1
|
||||
focusable: false
|
||||
vertical-scrollbar: characterListScrollBar
|
||||
auto-focus: first
|
||||
|
||||
VerticalScrollBar
|
||||
id: characterListScrollBar
|
||||
|
@@ -4,8 +4,8 @@ contentsPanel = nil
|
||||
spellCooldownPanel = nil
|
||||
|
||||
function init()
|
||||
connect(g_game, { onGameStart = show,
|
||||
onGameEnd = hide,
|
||||
connect(g_game, { onGameStart = online,
|
||||
onGameEnd = offline,
|
||||
onSpellGroupCooldown = onSpellGroupCooldown,
|
||||
onSpellCooldown = onSpellCooldown })
|
||||
|
||||
@@ -19,15 +19,15 @@ function init()
|
||||
|
||||
contentsPanel = cooldownWindow:getChildById('contentsPanel')
|
||||
spellCooldownPanel = contentsPanel:getChildById('spellCooldownPanel')
|
||||
|
||||
|
||||
if g_game.isOnline() then
|
||||
show()
|
||||
online()
|
||||
end
|
||||
end
|
||||
|
||||
function terminate()
|
||||
disconnect(g_game, { onGameStart = show,
|
||||
onGameEnd = hide,
|
||||
disconnect(g_game, { onGameStart = online,
|
||||
onGameEnd = offline,
|
||||
onSpellGroupCooldown = onSpellGroupCooldown,
|
||||
onSpellCooldown = onSpellCooldown })
|
||||
|
||||
@@ -49,18 +49,16 @@ function toggle()
|
||||
end
|
||||
end
|
||||
|
||||
function show()
|
||||
function online()
|
||||
if g_game.getFeature(GameSpellList) then
|
||||
cooldownWindow:show()
|
||||
cooldownButton:show()
|
||||
else
|
||||
hide()
|
||||
cooldownButton:hide()
|
||||
cooldownWindow:close()
|
||||
end
|
||||
end
|
||||
|
||||
function hide()
|
||||
cooldownWindow:hide()
|
||||
cooldownButton:hide()
|
||||
function offline()
|
||||
end
|
||||
|
||||
function updateProgressRect(progressRect, interval, init)
|
||||
|
@@ -352,6 +352,8 @@ function refreshTradeItems()
|
||||
end
|
||||
|
||||
function refreshPlayerGoods()
|
||||
if not g_game.isOnline() then return end
|
||||
|
||||
moneyLabel:setText(playerMoney .. ' ' .. CURRENCY)
|
||||
capacityLabel:setText(string.format('%.2f', playerFreeCapacity) .. ' ' .. WEIGHT_UNIT)
|
||||
|
||||
|
@@ -80,10 +80,10 @@ function getIconImageClip(id)
|
||||
end
|
||||
|
||||
function online()
|
||||
if g_game.getProtocolVersion() < 870 then
|
||||
spelllistButton:setVisible(false)
|
||||
if g_game.getFeature(GameSpellList) then
|
||||
spelllistButton:show()
|
||||
else
|
||||
spelllistButton:setVisible(true)
|
||||
spelllistButton:hide()
|
||||
end
|
||||
if g_game.getProtocolVersion() >= 950 then -- Vocation is only send in newer clients
|
||||
spelllistWindow:getChildById('buttonFilterVocation'):setVisible(true)
|
||||
|
Reference in New Issue
Block a user