Skip to content

Commit

Permalink
ETTP lua chat: Use ScreenChanged msg command
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Mar 31, 2018
1 parent 3ea5451 commit ad2c68a
Showing 1 changed file with 19 additions and 24 deletions.
43 changes: 19 additions & 24 deletions Themes/_fallback/BGAnimations/ScreenChatOverlay overlay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,32 +59,27 @@ chat.MinimiseMessageCommand = function(self)
moveY=minimised and height*(lineNumber+inputLineNumber+tabHeight-1) or 0
self:y(moveY)
end
local i =0
chat.InitCommand = function(self)
online = IsNetSMOnline() and IsSMOnlineLoggedIn(PLAYER_1) and NSMAN:IsETTP()
self:SetUpdateFunction(
function(self)
local s = SCREENMAN:GetTopScreen()
if not s then
return
end
local sN = s:GetName()
if currentScreen ~= sN then
currentScreen= sN
online = IsNetSMOnline() and IsSMOnlineLoggedIn(PLAYER_1) and NSMAN:IsETTP()
if(sN == "ScreenGameplay" or sN == "ScreenNetGameplay") then
self:visible(false)
show = false
typing = false
else
self:visible(online)
show = true
s:AddInputCallback(input)
MESSAGEMAN:Broadcast("ScreenChanged")
end
MESSAGEMAN:Broadcast("UpdateChatOverlay")
end
end
)
end
chat.ScreenChangedMessageCommand = function(self)
local s = SCREENMAN:GetTopScreen()
if not s then
return
end
currentScreen = s:GetName()
online = IsNetSMOnline() and IsSMOnlineLoggedIn(PLAYER_1) and NSMAN:IsETTP()
if(currentScreen == "ScreenGameplay" or currentScreen == "ScreenNetGameplay") then
self:visible(false)
show = false
typing = false
else
self:visible(online)
show = true
s:AddInputCallback(input)
MESSAGEMAN:Broadcast("ScreenaaaChanged")
end
end
chat.MultiplayerDisconnectionMessageCommand = function(self)
online = false
Expand Down

0 comments on commit ad2c68a

Please sign in to comment.