mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-11 07:58:57 +01:00
0d92359da7
Re-creation of https://github.com/Aurorastation/Aurora.3/pull/21046 to skip merge conflict hell. Brings us modern TGUI. **ALTERNATE TITLE: TGUI HELLSCAPE PR ABANDON ALL HOPE YE WHO ENTER HERE** - [x] Migrate build tools (javascript -> typescript, bun for package management). - [x] Upgrade all TGUI dependencies and associated root files to TG-congruent versions (axios, babel, dompurify, eslint, highlight, marked, prettier, sass, source-map, stacktrace-parser, typescript). - [x] InfernoJS -> React migrations - [x] React cleanup and polish (migrate all remaining .js files to appropriate .ts or .tsx filetype, all remaining hooks, linting, error corrections, etc.) - [ ] Test all remaining TGUI interfaces
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.Debug"
|
|
var/action
|
|
log_tgui(src, "Started fixing.", context = "verb/fix_tgui_panel")
|
|
|
|
nuke_chat()
|
|
|
|
// Failed to fix, using tgalert as fallback
|
|
action = input(src, "Did that work?", "", "Yes") in list("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.Debug"
|
|
|
|
for(var/window_id in tgui_windows)
|
|
var/datum/tgui_window/window = tgui_windows[window_id]
|
|
window.reinitialize()
|