Offline Authentication Fixes (For real this time) (#20769)

Thanks to harry for pointing me in the right direction here.

The way this worked previously, is that it bypassed the UI
initialization. I ended up moving all of that into a seperate proc,
which is now also called upon logging in with the offline authenticator
(after prefs are loaded).

In addition, I improved the login window. Instead of having a closable
pop-up window (which was only made closable due to a bug with it staying
open), it is now integrated into the game window itself (and I fixed the
bug requiring it to be closable). There was also an unclosed `<body>`
tag which I closed, and all the elements previously sent to the (now
blocked) chat window, instead appear on the window itself.
This commit is contained in:
Cody Brittain
2025-05-18 00:08:39 +00:00
committed by GitHub
parent 0731ef44d0
commit 7db461ad73
4 changed files with 105 additions and 24 deletions
+19 -18
View File
@@ -383,6 +383,9 @@ GLOBAL_LIST_INIT(localhost_addresses, list(
tgui_panel = new(src, "browseroutput")
tgui_say = new(src, "tgui_say")
// Forcibly enable hardware-accelerated graphics, as we need them for the lighting overlays.
winset(src, null, "command=\".configure graphics-hwmode on\"")
if(IsGuestKey(key) && GLOB.config.external_auth)
src.authed = FALSE
var/mob/abstract/unauthed/m = new()
@@ -395,26 +398,9 @@ GLOBAL_LIST_INIT(localhost_addresses, list(
. = ..()
src.InitClient()
src.InitPrefs()
src.InitUI()
mob.LateLogin()
// Initialize stat panel
stat_panel.initialize(
inline_html = file("html/statbrowser.html"),
inline_js = file("html/statbrowser.js"),
inline_css = file("html/statbrowser.css"),
)
addtimer(CALLBACK(src, PROC_REF(check_panel_loaded)), 30 SECONDS)
INVOKE_ASYNC(src, PROC_REF(acquire_dpi))
// Initialize tgui panel
tgui_panel.initialize()
tgui_say.initialize()
// Forcibly enable hardware-accelerated graphics, as we need them for the lighting overlays.
winset(src, null, "command=\".configure graphics-hwmode on\"")
send_resources()
if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them.
@@ -445,6 +431,21 @@ GLOBAL_LIST_INIT(localhost_addresses, list(
if(prefs.toggles_secondary & CLIENT_PREFERENCE_HIDE_MENU)
addtimer(CALLBACK(src, VERB_REF(toggle_menu), 1 SECONDS))
/client/proc/InitUI()
INVOKE_ASYNC(src, PROC_REF(acquire_dpi))
// Initialize tgui panel
tgui_panel.initialize()
tgui_say.initialize()
// Initialize stat panel
stat_panel.initialize(
inline_html = file("html/statbrowser.html"),
inline_js = file("html/statbrowser.js"),
inline_css = file("html/statbrowser.css"),
)
addtimer(CALLBACK(src, PROC_REF(check_panel_loaded)), 30 SECONDS)
/client/proc/InitClient()
SHOULD_NOT_SLEEP(TRUE)