mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-14 17:45:02 +01:00
844550f7c2
What it was doing was by and large fine, HOW it was doing it SUCKED I've cleaned it up and the nearby code some, notable hits include: - random if check in secrets ui that was totally unused - proc called add that actually set - lists not defined as such - stupid var names - proc args which did nothing - code which did nothing - oververbose code - proc/var names with no spacing at all Note: This might have changed behavior accidentally, I've done my best to test but we'll need to look out for issue reports in coming days. I was working on bitflag code and saw red, now it's 2 hours later. 🆑 code: Brought browser code up to standard with the rest of the codebase admin: Hey lads, I cleaned up how non TGUI windows work on the backend, please let me know if anything is broken! PING ME MOTHERFUCKER /🆑
43 lines
1.3 KiB
Plaintext
43 lines
1.3 KiB
Plaintext
/*!
|
|
* Copyright (c) 2020 Aleksej Komarov
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/client/var/datum/tgui_panel/tgui_panel
|
|
|
|
/**
|
|
* tgui panel / chat troubleshooting verb
|
|
*/
|
|
/client/verb/fix_tgui_panel()
|
|
set name = "Fix chat"
|
|
set category = "OOC"
|
|
var/action
|
|
log_tgui(src, "Started fixing.", context = "verb/fix_tgui_panel")
|
|
|
|
nuke_chat()
|
|
|
|
// Failed to fix, using tg_alert as fallback
|
|
action = tg_alert(src, "Did that work?", "", "Yes", "No, switch to old ui")
|
|
if (action == "No, switch to old ui")
|
|
winset(src, "output_selector.legacy_output_selector", "left=output_legacy")
|
|
log_tgui(src, "Failed to fix.", context = "verb/fix_tgui_panel")
|
|
|
|
/client/proc/nuke_chat()
|
|
// Catch all solution (kick the whole thing in the pants)
|
|
winset(src, "output_selector.legacy_output_selector", "left=output_legacy")
|
|
if(!tgui_panel || !istype(tgui_panel))
|
|
log_tgui(src, "tgui_panel datum is missing",
|
|
context = "verb/fix_tgui_panel")
|
|
tgui_panel = new(src)
|
|
tgui_panel.initialize(force = TRUE)
|
|
// Force show the panel to see if there are any errors
|
|
winset(src, "output_selector.legacy_output_selector", "left=output_browser")
|
|
|
|
/client/verb/refresh_tgui()
|
|
set name = "Refresh TGUI"
|
|
set category = "OOC"
|
|
|
|
for(var/window_id in tgui_windows)
|
|
var/datum/tgui_window/window = tgui_windows[window_id]
|
|
window.reinitialize()
|