diff --git a/code/modules/tgui/tgui.dm b/code/modules/tgui/tgui.dm
index 43b625a4152..5c0dd819f89 100644
--- a/code/modules/tgui/tgui.dm
+++ b/code/modules/tgui/tgui.dm
@@ -33,6 +33,8 @@
var/datum/ui_state/state = null // Topic state used to determine status/interactability.
var/datum/tgui/master_ui // The parent UI.
var/list/datum/tgui/children = list() // Children of this UI.
+ var/titlebar = TRUE
+ var/custom_browser_id = FALSE
/**
* public
@@ -51,11 +53,12 @@
*
* return datum/tgui The requested UI.
**/
-/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state)
+/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state, browser_id = null)
src.user = user
src.src_object = src_object
src.ui_key = ui_key
- src.window_id = "\ref[src_object]-[ui_key]"
+ src.window_id = browser_id ? browser_id : "\ref[src_object]-[ui_key]"
+ src.custom_browser_id = browser_id ? TRUE : FALSE
set_interface(interface)
@@ -96,7 +99,8 @@
var/debugable = check_rights_for(user.client, R_DEBUG)
user << browse(get_html(debugable), "window=[window_id];[window_size][list2params(window_options)]") // Open the window.
- winset(user, window_id, "on-close=\"uiclose \ref[src]\"") // Instruct the client to signal UI when the window is closed.
+ if (!custom_browser_id)
+ winset(user, window_id, "on-close=\"uiclose \ref[src]\"") // Instruct the client to signal UI when the window is closed.
SStgui.on_open(src)
/**
@@ -216,7 +220,7 @@
"style" = style,
"interface" = interface,
"fancy" = user.client.prefs.tgui_fancy,
- "locked" = user.client.prefs.tgui_lock,
+ "locked" = user.client.prefs.tgui_lock && !custom_browser_id,
"window" = window_id,
"ref" = "\ref[src]",
"user" = list(
@@ -226,7 +230,8 @@
"srcObject" = list(
"name" = "[src_object]",
"ref" = "\ref[src_object]"
- )
+ ),
+ "titlebar" = titlebar
)
return config_data
@@ -268,7 +273,7 @@
switch(action)
if("tgui:initialize")
- user << output(url_encode(get_json(initial_data)), "[window_id].browser:initialize")
+ user << output(url_encode(get_json(initial_data)), "[custom_browser_id ? window_id : "[window_id].browser"]:initialize")
initialized = TRUE
if("tgui:view")
if(params["screen"])
@@ -320,7 +325,7 @@
return // Cannot update UI, we have no visibility.
// Send the new JSON to the update() Javascript function.
- user << output(url_encode(get_json(data)), "[window_id].browser:update")
+ user << output(url_encode(get_json(data)), "[custom_browser_id ? window_id : "[window_id].browser"]:update")
/**
* private
@@ -366,4 +371,7 @@
else
src.status = status
if(status == UI_DISABLED || push) // Update if the UI just because disabled, or a push is requested.
- push_data(null, force = 1)
\ No newline at end of file
+ push_data(null, force = 1)
+
+/datum/tgui/proc/set_titlebar(value)
+ titlebar = value
diff --git a/tgui/src/components/button.ract b/tgui/src/components/button.ract
index e61164160a5..69a885dca1a 100644
--- a/tgui/src/components/button.ract
+++ b/tgui/src/components/button.ract
@@ -18,6 +18,8 @@
},
styles () {
let extra = ''
+ if (this.get('class'))
+ extra += ' ' + this.get('class');
if (this.get('tooltip-side'))
extra = ` tooltip-${this.get('tooltip-side')}`
if (this.get('grid'))
diff --git a/tgui/src/components/titlebar.ract b/tgui/src/components/titlebar.ract
index a67832cef8c..d299577f0d2 100644
--- a/tgui/src/components/titlebar.ract
+++ b/tgui/src/components/titlebar.ract
@@ -19,7 +19,7 @@ component.exports = {
const onrelease = (event) => this.set({ drag: false, x: null, y: null })
this.observe('config.fancy', (newkey, oldkey, keypath) => {
- winset(this.get('config.window'), 'titlebar', !newkey)
+ winset(this.get('config.window'), 'titlebar', !newkey && this.get('config.titlebar'))
if (newkey) {
document.addEventListener('mousemove', ondrag)
@@ -46,11 +46,13 @@ component.exports = {
}
-
-
- {{yield}}
- {{#if config.fancy}}
-
-
- {{/if}}
-
+{{#if config.titlebar}}
+
+
+ {{yield}}
+ {{#if config.fancy}}
+
+
+ {{/if}}
+
+{{/if}}
\ No newline at end of file
diff --git a/tgui/src/tgui.ract b/tgui/src/tgui.ract
index e5d93aebf8b..cdd31d3ee83 100644
--- a/tgui/src/tgui.ract
+++ b/tgui/src/tgui.ract
@@ -58,4 +58,6 @@ component.exports = {
-
+{{#if config.titlebar}}
+
+{{/if}}