From 382125a43279342061859588be6f3a4cb325c91f Mon Sep 17 00:00:00 2001 From: Barinade Date: Sat, 27 Nov 2021 19:40:10 -0600 Subject: [PATCH] til death add online/local toggle function to re-entering the tab this means tapping 3 again or clicking scores twice will toggle online/local --- .../ScreenSelectMusic decorations/score.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/score.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/score.lua index 2e3e1d17e3..7c0cb6f12e 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/score.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/score.lua @@ -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 @@ -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,