From a3665814f1533308a43a8f1486fc170bc738913f Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 20 Jul 2018 08:51:30 -0400 Subject: [PATCH] prevent various situations where the ui can get stuck basically check for input redirection before adding new screens --- .../ScreenSelectMusic decorations/profile.lua | 2 +- .../BGAnimations/ScreenSelectMusic overlay/default.lua | 9 ++------- Themes/Til Death/BGAnimations/_PlayerInfo.lua | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/profile.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/profile.lua index e416594a47..4acfce3755 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/profile.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/profile.lua @@ -724,7 +724,7 @@ local profilebuttons = Def.ActorFrame{ ms.ok("Succesfully logged in") end, MouseLeftClickMessageCommand=function(self) - if ButtonActive(self) and rankingSkillset == 1 then + if ButtonActive(self) and rankingSkillset == 1 and not SCREENMAN:get_input_redirected(PLAYER_1) then if not DLMAN:IsLoggedIn() then username = function(answer) user=answer diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic overlay/default.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic overlay/default.lua index be553764f2..a5b7bbadf5 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic overlay/default.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic overlay/default.lua @@ -2,16 +2,11 @@ local function input(event) local top = SCREENMAN:GetTopScreen() if event.DeviceInput.button == 'DeviceButton_left mouse button' then if event.type == "InputEventType_Release" then - if GAMESTATE:IsPlayerEnabled(PLAYER_1) then + if GAMESTATE:IsPlayerEnabled(PLAYER_1) and not SCREENMAN:get_input_redirected(PLAYER_1) then if isOver(top:GetChild("Overlay"):GetChild("PlayerAvatar"):GetChild("Avatar"..PLAYER_1):GetChild("Image")) then SCREENMAN:AddNewScreenToTop("ScreenAvatarSwitch"); end; end; - if GAMESTATE:IsPlayerEnabled(PLAYER_2) then - if isOver(top:GetChild("Overlay"):GetChild("PlayerAvatar"):GetChild("Avatar"..PLAYER_2):GetChild("Image")) then - SCREENMAN:AddNewScreenToTop("ScreenAvatarSwitch"); - end; - end; end; end return false; @@ -29,7 +24,7 @@ local t = Def.ActorFrame{ t[#t+1] = Def.Actor{ CodeMessageCommand=function(self,params) - if params.Name == "AvatarShow" and getTabIndex() == 0 then + if params.Name == "AvatarShow" and getTabIndex() == 0 and not SCREENMAN:get_input_redirected(PLAYER_1) then SCREENMAN:AddNewScreenToTop("ScreenAvatarSwitch"); end; end; diff --git a/Themes/Til Death/BGAnimations/_PlayerInfo.lua b/Themes/Til Death/BGAnimations/_PlayerInfo.lua index 8d66de18b7..f58964c0d8 100644 --- a/Themes/Til Death/BGAnimations/_PlayerInfo.lua +++ b/Themes/Til Death/BGAnimations/_PlayerInfo.lua @@ -90,7 +90,7 @@ t[#t+1] = Def.ActorFrame{ end end, MouseLeftClickMessageCommand=function(self) - if isOver(self) then + if isOver(self) and not SCREENMAN:get_input_redirected(PLAYER_1) then easyInputStringWithFunction("Choose new profile display name:", 64, false, setnewdisplayname) end end, @@ -141,7 +141,7 @@ t[#t+1] = Def.ActorFrame{ ms.ok("Succesfully logged in") end, MouseLeftClickMessageCommand=function(self) - if isOver(self) then + if isOver(self) and not SCREENMAN:get_input_redirected(PLAYER_1) then if not DLMAN:IsLoggedIn() then username = function(answer) user=answer