mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
addremove vip and look improvements
This commit is contained in:
@@ -43,5 +43,16 @@ function Game.onVipStateChange(id, online)
|
||||
label.vipOnline = online
|
||||
end
|
||||
|
||||
function VipList.onVipListLabelMousePress(widget, mousePos, mouseButton)
|
||||
if mouseButton ~= MouseRightButton then return end
|
||||
|
||||
local vipList = vipWindow:getChildById('vipList')
|
||||
|
||||
local menu = createWidget('PopupMenu')
|
||||
menu:addOption('Remove from VIP list', function() if widget then Game.removeVip(widget:getId():sub(4)) vipList:removeChild(widget) end end)
|
||||
menu:display(mousePos)
|
||||
end
|
||||
|
||||
|
||||
connect(Game, { onLogin = VipList.create,
|
||||
onLogout = VipList.destroy })
|
||||
|
@@ -1,6 +1,7 @@
|
||||
VipListLabel < GameLabel
|
||||
font: verdana-11px-monochrome
|
||||
margin-left: 5
|
||||
&onMousePress: VipList.onVipListLabelMousePress
|
||||
|
||||
MiniWindow
|
||||
id: vipWindow
|
||||
|
Reference in New Issue
Block a user