Skip to content

Commit

Permalink
Improve userlist name positioning calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Mar 10, 2019
1 parent 11ee54b commit 7699738
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 46 deletions.
23 changes: 2 additions & 21 deletions Themes/Til Death/BGAnimations/_lobbyuserlist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,8 @@ local r =
}

local function userLabel(i)
local x = 0
local y = 0
if i <= usersRowSize then
x = (usersX) + (i * usersWidth)
y = usersY + usersHeight
elseif i <= usersRowSize * 2 then
x = (usersX) + ((i - usersRowSize) * usersWidth)
y = usersY
elseif i <= usersRowSize * 3 then
x = (usersX) + ((i - usersRowSize * 2) * usersWidth) + usersWidthSmall
y = usersY + usersHeight
elseif i <= usersRowSize * 4 then
x = (usersX) + ((i - usersRowSize * 3) * usersWidth) + usersWidthSmall
y = usersY
elseif i <= usersRowSize * 5 then
x = (usersX) + (usersRowSize * usersWidth) + usersWidthSmall * (i - usersRowSize * 4)
y = usersY
else
x = (usersX) + (usersRowSize * usersWidth) + usersWidthSmall * (i - usersRowSize * 5)
y = usersY + usersHeight
end
local x = usersX + usersWidth * ((i-1) % usersRowSize)
local y = usersY + math.floor((i-1) / usersRowSize) * usersHeight
local aux =
LoadFont("Common Normal") ..
{
Expand Down
30 changes: 5 additions & 25 deletions Themes/Til Death/BGAnimations/_userlist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,22 @@ local r =
}

local function userLabel(i)
local x = 0
local y = 0
if i <= usersRowSize then
x = (usersX) + (i * usersWidth)
y = usersY + usersHeight
elseif i <= usersRowSize * 2 then
x = (usersX) + ((i - usersRowSize) * usersWidth)
y = usersY
elseif i <= usersRowSize * 3 then
x = (usersX) + ((i - usersRowSize * 2) * usersWidth) + usersWidthSmall
y = usersY + usersHeight
elseif i <= usersRowSize * 4 then
x = (usersX) + ((i - usersRowSize * 3) * usersWidth) + usersWidthSmall
y = usersY
elseif i <= usersRowSize * 5 then
x = (usersX) + (usersRowSize * usersWidth) + usersWidthSmall * (i - usersRowSize * 4)
y = usersY
else
x = (usersX) + (usersRowSize * usersWidth) + usersWidthSmall * (i - usersRowSize * 5)
y = usersY + usersHeight
end
local x = usersX + usersWidth * ((i-1) % usersRowSize)
local y = usersY + math.floor((i-1) / usersRowSize) * usersHeight
local aux =
LoadFont("Common Normal") ..
{
Name = i,
BeginCommand = function(self)
if showVisualizer then
y = y + 25
end
self:xy(x, y):zoom(usersZoom):diffuse(posit):queuecommand("Set")
end,
SetCommand = function(self)
if SCREENMAN:GetTopScreen():GetName() ~= "ScreenNetSelectMusic" then
return
end
if showVisualizer then
y = usersY + 25
self:y(y)
end
local num = self:GetName() + 0
qty = top:GetUserQty()
if num <= qty then
Expand Down

0 comments on commit 7699738

Please sign in to comment.