fix viplist sort, shared exp blink

This commit is contained in:
Henrique Santiago
2012-01-11 20:31:23 -02:00
parent a7865e26e3
commit 5bc939a091
5 changed files with 59 additions and 24 deletions

View File

@@ -41,25 +41,25 @@ end
function Creature:onShieldChange(shieldId)
if shieldId == ShieldWhiteYellow then
self:setShieldTexture(resolvepath('images/shield_yellow_white.png'))
self:setShieldTexture(resolvepath('images/shield_yellow_white.png'), false)
elseif shieldId == ShieldWhiteBlue then
self:setShieldTexture(resolvepath('images/shield_blue_white.png'))
self:setShieldTexture(resolvepath('images/shield_blue_white.png'), false)
elseif shieldId == ShieldBlue then
self:setShieldTexture(resolvepath('images/shield_blue.png'))
self:setShieldTexture(resolvepath('images/shield_blue.png'), false)
elseif shieldId == ShieldYellow then
self:setShieldTexture(resolvepath('images/shield_yellow.png'))
self:setShieldTexture(resolvepath('images/shield_yellow.png'), false)
elseif shieldId == ShieldBlueSharedExp then
self:setShieldTexture(resolvepath('images/shield_blue_shared.png'))
self:setShieldTexture(resolvepath('images/shield_blue_shared.png'), false)
elseif shieldId == ShieldYellowSharedExp then
self:setShieldTexture(resolvepath('images/shield_yellow_shared.png'))
self:setShieldTexture(resolvepath('images/shield_yellow_shared.png'), false)
elseif shieldId == ShieldBlueNoSharedExpBlink then
self:setShieldTexture(resolvepath('images/shield_blue_not_shared.png'))
self:setShieldTexture(resolvepath('images/shield_blue_not_shared.png'), true)
elseif shieldId == ShieldYellowNoSharedExpBlink then
self:setShieldTexture(resolvepath('images/shield_yellow_not_shared.png'))
self:setShieldTexture(resolvepath('images/shield_yellow_not_shared.png'), true)
elseif shieldId == ShieldBlueNoSharedExp then
self:setShieldTexture(resolvepath('images/shield_blue_not_shared.png'))
self:setShieldTexture(resolvepath('images/shield_blue_not_shared.png'), false)
elseif shieldId == ShieldYellowNoSharedExp then
self:setShieldTexture(resolvepath('images/shield_yellow_not_shared.png'))
self:setShieldTexture(resolvepath('images/shield_yellow_not_shared.png'), false)
end
end

View File

@@ -46,23 +46,25 @@ function VipList.onAddVip(id, name, online)
local nameLower = name:lower()
local childrenCount = vipList:getChildCount()
for i=1,childrenCount do
for i=1,childrenCount do
local child = vipList:getChildByIndex(i)
if online and not child.vipOnline then
vipList:insertChild(i, label)
return
end
local childText = child:getText():lower()
local length = math.min(childText:len(), nameLower:len())
for j=1,length do
if nameLower:byte(j) < childText:byte(j) then
vipList:insertChild(i, label)
return
elseif nameLower:byte(j) > childText:byte(j) then
break
if (not online and not child.vipOnline) or (online and child.vipOnline) then
local childText = child:getText():lower()
local length = math.min(childText:len(), nameLower:len())
for j=1,length do
if nameLower:byte(j) < childText:byte(j) then
vipList:insertChild(i, label)
return
elseif nameLower:byte(j) > childText:byte(j) then
break
end
end
end
end