mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
adds the "refresh TGUI" debug verb (#67265)
About The Pull Request adds the Refresh TGUI verb to the debug category OOC category, but it isn't locked behind any permissions. i'd put it in OOC, but.. eeeeeeh? there's not real much use for this verb other for debuggers. i put it in the OOC category Why It's Good For The Game debug purposes mostly not player facing lole
This commit is contained in:
@@ -344,9 +344,9 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
|
||||
// Initialize stat panel
|
||||
stat_panel.initialize(
|
||||
inline_html = file2text('html/statbrowser.html'),
|
||||
inline_js = file2text('html/statbrowser.js'),
|
||||
inline_css = file2text('html/statbrowser.css'),
|
||||
inline_html = file("html/statbrowser.html"),
|
||||
inline_js = file("html/statbrowser.js"),
|
||||
inline_css = file("html/statbrowser.css"),
|
||||
)
|
||||
addtimer(CALLBACK(src, .proc/check_panel_loaded), 30 SECONDS)
|
||||
|
||||
|
||||
@@ -102,14 +102,14 @@
|
||||
html = replacetextEx(html, "<!-- tgui:assets -->\n", inline_assets_str)
|
||||
// Inject inline HTML
|
||||
if (inline_html)
|
||||
html = replacetextEx(html, "<!-- tgui:inline-html -->", inline_html)
|
||||
html = replacetextEx(html, "<!-- tgui:inline-html -->", isfile(inline_html) ? file2text(inline_html) : inline_html)
|
||||
// Inject inline JS
|
||||
if (inline_js)
|
||||
inline_js = "<script>\n'use strict';\n[inline_js]\n</script>"
|
||||
inline_js = "<script>\n'use strict';\n[isfile(inline_js) ? file2text(inline_js) : inline_js]\n</script>"
|
||||
html = replacetextEx(html, "<!-- tgui:inline-js -->", inline_js)
|
||||
// Inject inline CSS
|
||||
if (inline_css)
|
||||
inline_css = "<style>\n[inline_css]\n</style>"
|
||||
inline_css = "<style>\n[isfile(inline_css) ? file2text(inline_css) : inline_css]\n</style>"
|
||||
html = replacetextEx(html, "<!-- tgui:inline-css -->", inline_css)
|
||||
// Open the window
|
||||
client << browse(html, "window=[id];[options]")
|
||||
@@ -132,6 +132,9 @@
|
||||
inline_html = initial_inline_html,
|
||||
inline_js = initial_inline_js,
|
||||
inline_css = initial_inline_css)
|
||||
// Resend assets
|
||||
for(var/datum/asset/asset in sent_assets)
|
||||
send_asset(asset)
|
||||
|
||||
/**
|
||||
* public
|
||||
@@ -365,11 +368,7 @@
|
||||
if("openLink")
|
||||
client << link(href_list["url"])
|
||||
if("cacheReloaded")
|
||||
// Reinitialize
|
||||
reinitialize()
|
||||
// Resend the assets
|
||||
for(var/asset in sent_assets)
|
||||
send_asset(asset)
|
||||
|
||||
/datum/tgui_window/vv_edit_var(var_name, var_value)
|
||||
return var_name != NAMEOF(src, id) && ..()
|
||||
|
||||
@@ -35,3 +35,12 @@
|
||||
// Force show the panel to see if there are any errors
|
||||
winset(src, "output", "is-disabled=1&is-visible=0")
|
||||
winset(src, "browseroutput", "is-disabled=0;is-visible=1")
|
||||
|
||||
/client/verb/refresh_tgui()
|
||||
set name = "Refresh TGUI"
|
||||
set category = "OOC"
|
||||
|
||||
message_admins("start")
|
||||
for(var/window_id in tgui_windows)
|
||||
var/datum/tgui_window/window = tgui_windows[window_id]
|
||||
window.reinitialize()
|
||||
|
||||
@@ -85,9 +85,9 @@ You can also do the same by splitting your code into separate files, and then le
|
||||
|
||||
```dm
|
||||
window.initialize(
|
||||
inline_html = file2text('code/modules/thing/thing.html'),
|
||||
inline_js = file2text('code/modules/thing/thing.js'),
|
||||
inline_css = file2text('code/modules/thing/thing.css'),
|
||||
inline_html = file("code/modules/thing/thing.html"),
|
||||
inline_js = file("code/modules/thing/thing.js"),
|
||||
inline_css = file("code/modules/thing/thing.css"),
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user