mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 14:07:51 +01:00
* Preliminary changes for 516 * Also removes the goon folder * Fixes a BUNCH of UIs * update our things * debug proc * le maintainer verb * fix strip panel * browseroutput => chat_panel * prettier, remove obsolete bat * tidu tgui say css * href purge * 515 compat * 515 compat 2 * more required chores * comments * fully working 515 * bungle * correct this * fixes 515 support * prettier * new CI * fixes old href styles sneaking in * update docs to reflect href changes * more href fixes (thanks cdui) * MORE href nonsense * even more hrefs (seriously wtf) * Update code/modules/admin/permissionverbs/permissionedit.dm * error on fail --------- Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
58 lines
1.9 KiB
Plaintext
58 lines
1.9 KiB
Plaintext
/**
|
|
* Copyright (c) 2020 Aleksej Komarov
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/* check_grep:ignore */ /client/var/datum/tgui_panel/tgui_panel
|
|
|
|
/**
|
|
* tgui panel / chat troubleshooting verb
|
|
*/
|
|
/client/verb/fix_tgui_panel()
|
|
set name = "Fix chat"
|
|
set category = "Special Verbs"
|
|
var/action
|
|
log_tgui(src, "Started fixing.")
|
|
|
|
nuke_chat()
|
|
|
|
// Failed to fix
|
|
action = alert(src, "Did that work?", "", "Yes", "No, switch to old ui")
|
|
if(action == "No, switch to old ui")
|
|
winset(src, "output", "on-show=&is-disabled=0&is-visible=1")
|
|
winset(src, "chat_panel", "is-disabled=1;is-visible=0")
|
|
log_tgui(src, "Failed to fix.")
|
|
|
|
/client/proc/nuke_chat()
|
|
// Catch all solution (kick the whole thing in the pants)
|
|
winset(src, "output", "on-show=&is-disabled=0&is-visible=1")
|
|
winset(src, "chat_panel", "is-disabled=1;is-visible=0")
|
|
if(!tgui_panel || !istype(tgui_panel))
|
|
log_tgui(src, "tgui_panel datum is missing")
|
|
tgui_panel = new(src, "chat_panel")
|
|
tgui_panel.initialize(force = TRUE)
|
|
// Force show the panel to see if there are any errors
|
|
winset(src, "output", "is-disabled=1&is-visible=0")
|
|
winset(src, "chat_panel", "is-disabled=0;is-visible=1")
|
|
|
|
/client/verb/refresh_tgui()
|
|
set name = "Refresh TGUI"
|
|
set category = "Special Verbs"
|
|
|
|
var/choice = alert(usr,
|
|
"Use it ONLY if you have trouble with TGUI window.\
|
|
That's UI's with EYE on top-left corner.\
|
|
Otherwise, you can get a white window that will only close when you restart the game!", "Refresh TGUI", "Refresh", "Cancel")
|
|
if(choice != "Refresh")
|
|
return
|
|
var/refreshed_count = 0
|
|
for(var/window_id in tgui_windows)
|
|
var/datum/tgui_window/window = tgui_windows[window_id]
|
|
if(!window.locked)
|
|
window.acquire_lock()
|
|
continue
|
|
window.reinitialize()
|
|
refreshed_count++
|
|
to_chat(usr, "<span class='notice'>TGUI windows refreshed - [refreshed_count].<br>If you have blank window - restart the game, or open previous TGUI window.</span>")
|
|
|