2011-08-14 04:09:11 +02:00
|
|
|
Label < UILabel
|
2011-11-01 03:35:50 +01:00
|
|
|
font: verdana-11px-antialised
|
2012-03-16 14:28:29 +01:00
|
|
|
color: #bbbbbb
|
2011-08-14 04:09:11 +02:00
|
|
|
|
2011-11-16 22:00:40 +01:00
|
|
|
$disabled:
|
2012-03-16 14:28:29 +01:00
|
|
|
color: #bbbbbb88
|
2011-11-16 22:00:40 +01:00
|
|
|
|
2012-05-01 04:00:07 +02:00
|
|
|
FlatLabel < UILabel
|
|
|
|
font: verdana-11px-antialised
|
|
|
|
color: #aaaaaa
|
|
|
|
size: 86 20
|
|
|
|
text-offset: 3 3
|
2013-01-18 23:39:11 +01:00
|
|
|
image-source: /images/ui/panel_flat
|
2012-05-01 04:00:07 +02:00
|
|
|
image-border: 1
|
|
|
|
|
|
|
|
$disabled:
|
|
|
|
color: #aaaaaa88
|
|
|
|
|
2012-08-05 20:26:08 +02:00
|
|
|
MenuLabel < Label
|
|
|
|
|
2012-01-03 02:52:26 +01:00
|
|
|
GameLabel < UILabel
|
|
|
|
font: verdana-11px-antialised
|
2012-03-16 14:28:29 +01:00
|
|
|
color: #bbbbbb
|
2012-08-24 10:18:15 +02:00
|
|
|
|
|
|
|
FrameCounterLabel < Label
|
2012-08-25 21:11:54 +02:00
|
|
|
font: verdana-11px-rounded
|
2012-08-24 10:18:15 +02:00
|
|
|
@onSetup: |
|
|
|
|
self.updateEvent = cycleEvent(function()
|
|
|
|
local text = 'FPS: ' .. g_app.getBackgroundPaneFps()
|
|
|
|
self:setText(text)
|
|
|
|
end, 1000)
|
|
|
|
@onDestroy: self.updateEvent:cancel()
|
2012-08-25 21:11:54 +02:00
|
|
|
|
|
|
|
PingLabel < Label
|
|
|
|
font: verdana-11px-rounded
|
|
|
|
@onSetup: |
|
|
|
|
self.updateEvent = cycleEvent(function()
|
2013-01-18 23:39:11 +01:00
|
|
|
if g_game.isOnline() and modules.client_options.getOption('showPing') then
|
2012-08-25 21:11:54 +02:00
|
|
|
local ping = -1
|
2013-01-18 23:39:11 +01:00
|
|
|
if g_game.getFeature(GameClientPing) or g_game.getFeature(GameExtendedClientPing) then
|
2012-08-25 21:11:54 +02:00
|
|
|
ping = g_game.getPing()
|
|
|
|
else
|
|
|
|
ping = g_game.getLocalPlayer():getWalkPing()
|
|
|
|
end
|
|
|
|
local text = 'Ping: '
|
|
|
|
if ping < 0 then
|
|
|
|
text = text .. "??"
|
|
|
|
self:setColor('yellow')
|
|
|
|
else
|
|
|
|
text = text .. ping .. ' ms'
|
|
|
|
if ping >= 500 then
|
|
|
|
self:setColor('red')
|
|
|
|
elseif ping >= 250 then
|
|
|
|
self:setColor('yellow')
|
|
|
|
else
|
|
|
|
self:setColor('green')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
self:setText(text)
|
|
|
|
self:show()
|
|
|
|
else
|
|
|
|
self:hide()
|
|
|
|
end
|
|
|
|
end, 1000)
|
|
|
|
@onDestroy: self.updateEvent:cancel()
|