Skip to content

Commit

Permalink
Merge pull request #761 from AntlerForce/replaymenuregression
Browse files Browse the repository at this point in the history
Check if cols is nan and set to 0 if so
  • Loading branch information
AntlerForce authored Sep 13, 2024
2 parents 61965c8 + d114604 commit f8a1207
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions LuaMenu/widgets/gui_tooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ local replayTooltip = {}
local PLAYERWIDTH, PLAYERHEIGHT = 220, 22

local function getReplayPlayerListTooltip(teamList)

local showTeams = true
if #teamList > 2 then
showTeams = false -- assume ffa
Expand All @@ -997,6 +997,10 @@ local function getReplayPlayerListTooltip(teamList)
table.sort(teamList, SortTeamsBySkill)
end

if (cols ~= cols) then
cols = 0
end

replayTooltip.mainStackPanel = Panel:New {
name = 'mainStackPanel',
x = 0,
Expand Down Expand Up @@ -1038,7 +1042,7 @@ local function getReplayPlayerListTooltip(teamList)
yOffsetTeam = math.floor((teamNr - 1) / cols) * (prevRowHeightMax + 23)

teamStack = newTeamStack()

-- team title
if not teamStack.teamTitle then
teamStack.teamTitle = GetTooltipLine(teamStack, nil, 3)
Expand All @@ -1051,7 +1055,7 @@ local function getReplayPlayerListTooltip(teamList)
end
local truncatedTitle = StringUtilities.GetTruncatedStringWithDotDot(teamTitle, teamStack.teamTitle.GetFont(), PLAYERWIDTH - 10)
teamStack.teamTitle.Update(0, truncatedTitle)

yOffsetPlayer = 23
else
xOffsetPlayer = math.floor((teamNr - 1) / divisor) * PLAYERWIDTH
Expand Down Expand Up @@ -1079,6 +1083,7 @@ local function getReplayPlayerListTooltip(teamList)
totalHeight = totalHeight + yOffsetTeamMax

-- Set tooltip sizes

replayTooltip.mainStackPanel:SetPos(nil, nil, cols * PLAYERWIDTH, totalHeight + 5)

return replayTooltip.mainStackPanel
Expand Down

0 comments on commit f8a1207

Please sign in to comment.