addremove vip and look improvements

This commit is contained in:
Henrique Santiago
2012-01-04 12:30:28 -02:00
parent f16318e80a
commit a73908fbbe
11 changed files with 66 additions and 9 deletions

View File

@@ -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 })

View File

@@ -1,6 +1,7 @@
VipListLabel < GameLabel
font: verdana-11px-monochrome
margin-left: 5
&onMousePress: VipList.onVipListLabelMousePress
MiniWindow
id: vipWindow