Skip to content

Commit

Permalink
til death add online/local toggle function to re-entering the tab
Browse files Browse the repository at this point in the history
this means tapping 3 again or clicking scores twice will toggle online/local
  • Loading branch information
poco0317 committed Nov 28, 2021
1 parent 6238ea8 commit 382125a
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,22 @@ local ret = Def.ActorFrame {
if collapsed then -- expand if collaped
self:queuecommand("Expand")
else
-- if tab was already visible, swap nested tabs
if self:GetVisible() then
if nestedTab == 1 then nestedTab = 2 else nestedTab = 1 end
self:GetChild("Button_1"):playcommand("NestedTabChanged")
self:GetChild("Button_2"):playcommand("NestedTabChanged")
if nestedTab == 1 then
self:GetChild("ScoreDisplay"):visible(false)
self:GetChild("LocalScores"):visible(true)
sd:visible(true)
else
updateLeaderBoardForCurrentChart()
self:GetChild("ScoreDisplay"):visible(true)
self:GetChild("LocalScores"):visible(false)
sd:visible(false)
end
end
self:queuecommand("On")
self:visible(true)
end
Expand Down Expand Up @@ -886,9 +902,10 @@ ret[#ret + 1] = t

local function nestedTabButton(i)
return Def.ActorFrame {
Name = "Button_"..i,
InitCommand = function(self)
self:xy(frameX + offsetX/2 + (i - 1) * (nestedTabButtonWidth - capWideScale(100, 80)), frameY + offsetY - 4)
end,
end,
CollapseCommand = function(self)
self:visible(false)
end,
Expand Down

0 comments on commit 382125a

Please sign in to comment.