Skip to content

Commit

Permalink
Prevent chat from showing up when not in multiplayer screens
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 2, 2018
1 parent 5230541 commit 3f0c97c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Themes/_fallback/BGAnimations/ScreenChatOverlay overlay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,27 @@ chat.InitCommand = function(self)
self:visible(false)
end
local isGameplay
local isInSinglePlayer
chat.ScreenChangedMessageCommand = function(self)
local s = SCREENMAN:GetTopScreen()
if not s then
return
end
local oldScreen = currentScreen
currentScreen = s:GetName()

-- prevent the chat from showing in singleplayer because it can be annoying
if oldScreen ~= currentScreen and (currentScreen == "ScreenSelectMusic" or currentScreen == "ScreenTitleMenu" or currentScreen == "ScreenOptionsService") then
isInSinglePlayer = true
end
if string.sub(currentScreen, 1, 9) == "ScreenNet" and currentScreen ~= "ScreenNetSelectProfile" then
isInSinglePlayer = false
end

online = IsNetSMOnline() and IsSMOnlineLoggedIn(PLAYER_1) and NSMAN:IsETTP()
isGameplay = (currentScreen == "ScreenGameplay" or currentScreen == "ScreenNetGameplay")
if isGameplay then

if isGameplay or isInSinglePlayer then
self:visible(false)
show = false
typing = false
Expand All @@ -87,7 +99,7 @@ chat.ScreenChangedMessageCommand = function(self)
0.025
)
else
self:visible(online)
self:visible(online and not isInSinglePlayer)
show = true
end
if currentScreen == "ScreenNetSelectMusic" then
Expand Down

0 comments on commit 3f0c97c

Please sign in to comment.