@ -71,7 +71,7 @@ function addVip()
destroyAddWindow ( )
end
function onAddVip ( id , name , onlin e)
function onAddVip ( id , name , stat e)
local vipList = vipWindow : getChildById ( ' contentsPanel ' )
local label = g_ui.createWidget ( ' VipListLabel ' )
@ -79,13 +79,15 @@ function onAddVip(id, name, online)
label : setId ( ' vip ' .. id )
label : setText ( name )
if o nline then
if state == VipState.O nline then
label : setColor ( ' #00ff00 ' )
elseif state == VipState.Pending then
label : setColor ( ' #ffca38 ' )
else
label : setColor ( ' #ff0000 ' )
end
label.vip Online = onlin e
label.vip State = stat e
label : setPhantom ( false )
connect ( label , { onDoubleClick = function ( ) g_game.openPrivateChannel ( label : getText ( ) ) return true end } )
@ -95,12 +97,13 @@ function onAddVip(id, name, online)
for i = 1 , childrenCount do
local child = vipList : getChildByIndex ( i )
if online and not child.vip Online then
if state == VipState.Online and not child.vipState == VipState. Online then
vipList : insertChild ( i , label )
return
end
if ( not online and not child.vipOnline ) or ( online and child.vipOnline ) then
if ( not state == VipState.Online and not child.vipState == VipState.Online )
or ( state == VipState.Online and child.vipState == VipState.Online ) then
local childText = child : getText ( ) : lower ( )
local length = math.min ( childText : len ( ) , nameLower : len ( ) )
@ -118,13 +121,13 @@ function onAddVip(id, name, online)
vipList : insertChild ( childrenCount + 1 , label )
end
function onVipStateChange ( id , onlin e)
function onVipStateChange ( id , stat e)
local vipList = vipWindow : getChildById ( ' contentsPanel ' )
local label = vipList : getChildById ( ' vip ' .. id )
local text = label : getText ( )
label : destroy ( )
onAddVip ( id , text , onlin e)
onAddVip ( id , text , stat e)
end
function onVipListMousePress ( widget , mousePos , mouseButton )