Skip to content

Commit

Permalink
fix crash opt in overlay redir failing to stick
Browse files Browse the repository at this point in the history
chat overlay cringe
  • Loading branch information
poco0317 committed Dec 10, 2021
1 parent 30b547b commit b7cc8bc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Themes/_fallback/Graphics/_crashUploadOptIn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ local boxw = SCREEN_WIDTH/1.5
local boxh = SCREEN_HEIGHT/3.3
local bufferspace = 5
local txt = "NOTICE\nWith your permission, Etterna will upload crash dumps and logs to our server at crash.etterna.dev.\nTo opt in, click the button below or press Y and then restart the game.\nOtherwise, press Escape or click outside the box."
local redirb4 = false

local t = Def.ActorFrame {
Name = "CrashUploadOptInDialogue",
Expand All @@ -18,9 +19,13 @@ local t = Def.ActorFrame {
-- input redirection management FAILS IF YOU RESTART/EXIT THE SCREEN UNNATURALLY (like with F3)
-- BEWARE THEMERS
-- if you get input locked, just ctrl+operator out of it
local redirb4 = SCREENMAN:get_input_redirected(PLAYER_1)
redirb4 = SCREENMAN:get_input_redirected(PLAYER_1)
SCREENMAN:set_input_redirected(PLAYER_1, true)

-- have to forcibly set redir true after a little bit of time
-- the chat overlay turns it off randomly
self:sleep(0.5):queuecommand("InputRedirSet")

SCREENMAN:GetTopScreen():AddInputCallback(function(event)
if not enabled then return end
if event.type ~= "InputEventType_FirstPress" then return true end
Expand Down Expand Up @@ -64,6 +69,9 @@ local t = Def.ActorFrame {
return true
end)
end,
InputRedirSetCommand = function(self)
SCREENMAN:set_input_redirected(PLAYER_1, true)
end,

Def.Quad {
Name = "BG",
Expand Down

0 comments on commit b7cc8bc

Please sign in to comment.