Skip to content

Commit

Permalink
prevent various situations where the ui can get stuck
Browse files Browse the repository at this point in the history
basically check for input redirection before adding new screens
  • Loading branch information
MinaciousGrace committed Jul 20, 2018
1 parent dd0fb66 commit a366581
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Themes/Til Death/BGAnimations/_PlayerInfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a366581

Please sign in to comment.