mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 15:26:49 +01:00
fix viplist sort, shared exp blink
This commit is contained in:
Submodule modules/client_tibiafiles updated: 9beb17daae...dd648e1431
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user