Continued work in progress on a major revision of the NanoUI templating system.

This commit is contained in:
Mark Aherne
2014-07-11 10:48:42 +01:00
parent 728ba52af0
commit 7e7e6cd8ac
73 changed files with 1367 additions and 1031 deletions

View File

@@ -59,7 +59,7 @@
if(stat & (NOPOWER|BROKEN)) return
ui_interact(user)
/obj/machinery/account_database/ui_interact(mob/user, ui_key="main", datum/nanoui/ui=null)
/obj/machinery/account_database/ui_interact(mob/user, ui_key="main", var/datum/nanoui/ui = null, var/force_open = 1)
user.set_machine(src)
var/data[0]
@@ -105,7 +105,7 @@
if (accounts.len > 0)
data["accounts"] = accounts
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "accounts_terminal.tmpl", src.name, 400, 640)
ui.set_initial_data(data)

View File

@@ -32,11 +32,12 @@
*
* @param user /mob The mob who is interacting with this ui
* @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main")
* @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui
* @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui
* @param force_open boolean Force the UI to (re)open, even if it's already open
*
* @return nothing
*/
/atom/movable/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
/atom/movable/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
return
// Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob

View File

@@ -39,19 +39,23 @@
* @param ui_key string A string key used for the ui
* @param ui /datum/nanoui An existing instance of the ui (can be null)
* @param data list The data to be passed to the ui, if it exists
* @param force_open boolean The ui is being forced to (re)open, so close ui if it exists (instead of updating)
*
* @return /nanoui Returns the found ui, for null if none exists
*/
/datum/nanomanager/proc/try_update_ui(var/mob/user, src_object, ui_key, var/datum/nanoui/ui, data)
/datum/nanomanager/proc/try_update_ui(var/mob/user, src_object, ui_key, var/datum/nanoui/ui, data, var/force_open = 0)
if (isnull(ui)) // no ui has been passed, so we'll search for one
{
ui = get_open_ui(user, src_object, ui_key)
}
}
if (!isnull(ui))
// The UI is already open so push the data to it
ui.push_data(data)
return ui
// The UI is already open
if (!force_open)
ui.push_data(data)
return ui
else
testing("nanomanager/try_update_ui mob [user.name] [src_object:name] [ui_key] [force_open] - forcing opening of ui")
ui.close()
return null
/**
@@ -66,14 +70,17 @@
/datum/nanomanager/proc/get_open_ui(var/mob/user, src_object, ui_key)
var/src_object_key = "\ref[src_object]"
if (isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
testing("nanomanager/get_open_ui mob [user.name] [src_object:name] [ui_key] - there are no uis open")
return null
else if (isnull(open_uis[src_object_key][ui_key]) || !istype(open_uis[src_object_key][ui_key], /list))
else if (isnull(open_uis[src_object_key][ui_key]) || !istype(open_uis[src_object_key][ui_key], /list))
testing("nanomanager/get_open_ui mob [user.name] [src_object:name] [ui_key] - there are no uis open for this object")
return null
for (var/datum/nanoui/ui in open_uis[src_object_key][ui_key])
if (ui.user == user)
return ui
testing("nanomanager/get_open_ui mob [user.name] [src_object:name] [ui_key] - ui not found")
return null
/**
@@ -83,7 +90,7 @@
*
* @return int The number of uis updated
*/
/datum/nanomanager/proc/update_uis(src_object)
/datum/nanomanager/proc/update_uis(src_object)
var/src_object_key = "\ref[src_object]"
if (isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
return 0
@@ -128,7 +135,8 @@
*/
/datum/nanomanager/proc/close_user_uis(var/mob/user, src_object = null, ui_key = null)
if (isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0)
return 0 // has no open uis
testing("nanomanager/close_user_uis mob [user.name] has no open uis")
return 0 // has no open uis
var/close_count = 0
for (var/datum/nanoui/ui in user.open_uis)
@@ -136,6 +144,8 @@
ui.close()
close_count++
testing("nanomanager/close_user_uis mob [user.name] closed [open_uis.len] of [close_count] uis")
return close_count
/**
@@ -157,6 +167,7 @@
var/list/uis = open_uis[src_object_key][ui.ui_key]
uis.Add(ui)
processing_uis.Add(ui)
testing("nanomanager/ui_opened mob [ui.user.name] [ui.src_object:name] [ui.ui_key] - user.open_uis [ui.user.open_uis.len] | uis [uis.len] | processing_uis [processing_uis.len]")
/**
* Remove a /nanoui ui from the list of open uis
@@ -176,7 +187,11 @@
processing_uis.Remove(ui)
ui.user.open_uis.Remove(ui)
var/list/uis = open_uis[src_object_key][ui.ui_key]
return uis.Remove(ui)
uis.Remove(ui)
testing("nanomanager/ui_closed mob [ui.user.name] [ui.src_object:name] [ui.ui_key] - user.open_uis [ui.user.open_uis.len] | uis [uis.len] | processing_uis [processing_uis.len]")
return 1
/**
* This is called on user logout
@@ -189,6 +204,7 @@
//
/datum/nanomanager/proc/user_logout(var/mob/user)
testing("nanomanager/user_logout user [user.name]")
return close_user_uis(user)
/**
@@ -201,7 +217,9 @@
* @return nothing
*/
/datum/nanomanager/proc/user_transferred(var/mob/oldMob, var/mob/newMob)
testing("nanomanager/user_transferred from mob [oldMob.name] to mob [newMob.name]")
if (isnull(oldMob.open_uis) || !istype(oldMob.open_uis, /list) || open_uis.len == 0)
testing("nanomanager/user_transferred mob [oldMob.name] has no open uis")
return 0 // has no open uis
if (isnull(newMob.open_uis) || !istype(newMob.open_uis, /list))

View File

@@ -41,6 +41,8 @@ nanoui is used to open and update nano browser uis
// the body content for this ui, do not change unless you know what you're doing
// the #mainTemplate div will contain the compiled "main" template html
var/content = "<div id='mainTemplate'></div>"
// the title of this ui
var/state_key = "default"
// initial data, containing the full data structure, must be sent to the ui (the data structure cannot be extended later on)
var/list/initial_data[0]
// set to 1 to update the ui automatically every master_controller tick
@@ -94,7 +96,10 @@ nanoui is used to open and update nano browser uis
add_script("libraries.min.js") // A JS file comprising of jQuery, doT.js and jQuery Timer libraries (compressed together)
add_script("nano_utility.js") // The NanoUtility JS, this is used to store utility functions.
add_script("nano_template.js") // The NanoTemplate JS, this is used to render templates.
add_script("nano_update.js") // The NanoUpdate JS, this is used to receive updates and apply them.
add_script("nano_state_manager.js") // The
add_script("nano_state.js") // The
add_script("nano_state_default.js") // The
add_script("nano_base_callbacks.js") // The
add_script("nano_base_helpers.js") // The NanoBaseHelpers JS, this is used to set up template helpers which are common to all templates
add_stylesheet("shared.css") // this CSS sheet is common to all UIs
add_stylesheet("icons.css") // this CSS sheet is common to all UIs
@@ -108,12 +113,15 @@ nanoui is used to open and update nano browser uis
* @return nothing
*/
/datum/nanoui/proc/set_status(state, push_update)
if (state != status)
status = state
if (push_update || !status)
push_data(list(), 1) // Update the UI, force the update in case the status is 0
else
status = state
if (state != status) // Only update if it is different
if (status == STATUS_DISABLED)
status = state
if (push_update)
update()
else
status = state
if (push_update || status == 0)
push_data(null, 1) // Update the UI, force the update in case the status is 0, data is null so that previous data is used
/**
* Update the status (visibility) of this ui based on the user's status
@@ -122,7 +130,7 @@ nanoui is used to open and update nano browser uis
*
* @return nothing
*/
/datum/nanoui/proc/update_status(push_update = 0)
/datum/nanoui/proc/update_status(var/push_update = 0)
if (istype(user, /mob/living/silicon/ai))
set_status(STATUS_INTERACTIVE, push_update) // interactive (green visibility)
else if (istype(user, /mob/living/silicon/robot))
@@ -170,21 +178,39 @@ nanoui is used to open and update nano browser uis
* @return nothing
*/
/datum/nanoui/proc/set_initial_data(list/data)
initial_data = add_default_data(data)
initial_data = data
/**
* Add default data to the data being sent to the ui.
* Get config data to sent to the ui.
*
* @param data /list The list of data to be modified
*
* @return /list modified data
* @return /list config data
*/
/datum/nanoui/proc/add_default_data(list/data)
data["ui"] = list(
/datum/nanoui/proc/get_config_data()
var/list/config_data = list(
"title" = title,
"srcObject" = list("name" = src_object.name),
"stateKey" = state_key,
"status" = status,
"user" = list("name" = user.name)
)
return data
return config_data
/**
* Get data to sent to the ui.
*
* @param data /list The list of general data for this ui (can be null to use previous data sent)
*
* @return /list data to send to the ui
*/
/datum/nanoui/proc/get_send_data(var/list/data)
var/list/config_data = get_config_data()
var/list/send_data = list("config" = config_data)
if (!isnull(data))
send_data["data"] = data
return send_data
/**
* Set the browser window options for this ui
@@ -240,7 +266,17 @@ nanoui is used to open and update nano browser uis
* @return nothing
*/
/datum/nanoui/proc/set_content(ncontent)
content = ncontent
content = ncontent
/**
* Set the state key for use in the frontend Javascript
*
* @param nstate_key string The new HTML content for this UI
*
* @return nothing
*/
/datum/nanoui/proc/set_state_key(nstate_key)
state_key = nstate_key
/**
* Set whether or not to use the "old" on close logic (mainly unset_machine())
@@ -274,9 +310,8 @@ nanoui is used to open and update nano browser uis
if (templatel_data.len > 0)
template_data_json = list2json(templatel_data)
var/initial_data_json = "{}" // An empty JSON object
if (initial_data.len > 0)
initial_data_json = list2json(initial_data)
var/list/send_data = get_send_data(initial_data)
var/initial_data_json = list2json(send_data)
var/url_parameters_json = list2json(list("src" = "\ref[src]"))
@@ -287,11 +322,11 @@ nanoui is used to open and update nano browser uis
<script type='text/javascript'>
function receiveUpdateData(jsonString)
{
// We need both jQuery and NanoUpdate to be able to recieve data
// We need both jQuery and NanoStateManager to be able to recieve data
// At the moment any data received before those libraries are loaded will be lost
if (typeof NanoUpdate != 'undefined' && typeof jQuery != 'undefined')
if (typeof NanoStateManager != 'undefined' && typeof jQuery != 'undefined')
{
NanoUpdate.receiveUpdateData(jsonString);
NanoStateManager.receiveUpdateData(jsonString);
}
}
</script>
@@ -301,7 +336,12 @@ nanoui is used to open and update nano browser uis
<div id='uiWrapper'>
[title ? "<div id='uiTitleWrapper'><div id='uiStatusIcon' class='icon24 uiStatusGood'></div><div id='uiTitle'>[title]</div><div id='uiTitleFluff'></div></div>" : ""]
<div id='uiContent'>
<div id='uiNoJavaScript'>Initiating...</div>
<div id='uiLoadingNotice'>Initiating...</div>
<noscript id='uiNoScript'>
<h2>JAVASCRIPT REQUIRED</h2>
<p>Your Internet Explorer's Javascript is disabled (or broken).<br/>
Enable Javascript and then open this UI again.</p>
</noscript>
"}
/**
@@ -378,9 +418,10 @@ nanoui is used to open and update nano browser uis
if (status == STATUS_DISABLED && !force_push)
return // Cannot update UI, no visibility
data = add_default_data(data)
var/list/send_data = get_send_data(data)
//user << list2json(data) // used for debugging
user << output(list2params(list(list2json(data))),"[window_id].browser:receiveUpdateData")
user << output(list2params(list(list2json(send_data))),"[window_id].browser:receiveUpdateData")
/**
* This Topic() proc is called whenever a user clicks on a link within a Nano UI
@@ -411,7 +452,15 @@ nanoui is used to open and update nano browser uis
return
if (status && (update || is_auto_updating))
src_object.ui_interact(user, ui_key, src) // Update the UI (update_status() is called whenever a UI is updated)
update() // Update the UI (update_status() is called whenever a UI is updated)
else
update_status(1) // Not updating UI, so lets check here if status has changed
/**
* Update the UI
*
* @return nothing
*/
/datum/nanoui/proc/update(var/force_open = 0)
src_object.ui_interact(user, ui_key, src, force_open)

View File

@@ -673,7 +673,7 @@
return
// do APC interaction
user.set_machine(src)
//user.set_machine(src)
src.interact(user)
/obj/machinery/power/apc/attack_alien(mob/living/carbon/alien/humanoid/user)
@@ -741,7 +741,7 @@
else
return 0 // 0 = User is not a Malf AI
/obj/machinery/power/apc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
/obj/machinery/power/apc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
if(!user)
return
@@ -752,7 +752,7 @@
"powerCellStatus" = cell ? cell.percent() : null,
"chargeMode" = chargemode,
"chargingStatus" = charging,
"totalLoad" = lastused_equip + lastused_light + lastused_environ,
"totalLoad" = round(lastused_equip + lastused_light + lastused_environ),
"coverLocked" = coverlocked,
"siliconUser" = istype(user, /mob/living/silicon),
"malfStatus" = get_malf_status(user),
@@ -760,7 +760,7 @@
"powerChannels" = list(
list(
"title" = "Equipment",
"powerLoad" = lastused_equip,
"powerLoad" = round(lastused_equip),
"status" = equipment,
"topicParams" = list(
"auto" = list("eqp" = 3),
@@ -770,7 +770,7 @@
),
list(
"title" = "Lighting",
"powerLoad" = lastused_light,
"powerLoad" = round(lastused_light),
"status" = lighting,
"topicParams" = list(
"auto" = list("lgt" = 3),
@@ -780,7 +780,7 @@
),
list(
"title" = "Environment",
"powerLoad" = lastused_environ,
"powerLoad" = round(lastused_environ),
"status" = environ,
"topicParams" = list(
"auto" = list("env" = 3),
@@ -792,7 +792,7 @@
)
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -961,14 +961,14 @@
/obj/machinery/power/apc/Topic(href, href_list, var/usingUI = 1)
if(!(isrobot(usr) && (href_list["apcwires"] || href_list["pulse"])))
if(!can_use(usr, 1))
return
return 0
src.add_fingerprint(usr)
if (href_list["apcwires"])
var/t1 = text2num(href_list["apcwires"])
if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
usr << "You need wirecutters!"
return
return 0
if (src.isWireColorCut(t1))
src.mend(t1)
else
@@ -977,10 +977,10 @@
var/t1 = text2num(href_list["pulse"])
if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
usr << "You need a multitool!"
return
return 0
if (src.isWireColorCut(t1))
usr << "You can't pulse a cut wire."
return
return 0
else
src.pulse(t1)
else if (href_list["lock"])
@@ -1027,11 +1027,11 @@
else if( href_list["close"] )
nanomanager.close_user_uis(usr, src)
return
return 0
else if (href_list["close2"])
usr << browse(null, "window=apcwires")
return
return 0
else if (href_list["overload"])
if( istype(usr, /mob/living/silicon) && !src.aidisabled )
@@ -1042,7 +1042,7 @@
if( istype(malfai, /mob/living/silicon/ai) && !src.aidisabled )
if (malfai.malfhacking)
malfai << "You are already hacking an APC."
return
return 0
malfai << "Beginning override of APC systems. This takes some time, and you cannot perform other actions during the process."
malfai.malfhack = src
malfai.malfhacking = 1
@@ -1071,7 +1071,7 @@
if(usingUI)
src.updateDialog()
return
return 1
/*/obj/machinery/power/apc/proc/malfoccupy(var/mob/living/silicon/ai/malf)
if(!istype(malf))

View File

@@ -250,7 +250,7 @@
building_terminal = 0
/obj/machinery/power/smes/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
/obj/machinery/power/smes/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
if(stat & BROKEN)
return
@@ -269,7 +269,7 @@
data["outputLoad"] = round(loaddemand)
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm

View File

@@ -104,7 +104,7 @@
*
* @return nothing
*/
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main",var/datum/nanoui/ui = null)
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main",var/datum/nanoui/ui = null, var/force_open = 1)
if(broken_requirements.len)
user << "<span class='warning'>[src] is broken. [broken_requirements[broken_requirements[1]]]</span>"
return
@@ -114,8 +114,8 @@
// this is the data which will be sent to the ui
var/data[0]
data["amount"] = amount
data["energy"] = energy
data["maxEnergy"] = max_energy
data["energy"] = round(energy)
data["maxEnergy"] = round(max_energy)
data["isBeakerLoaded"] = beaker ? 1 : 0
data["glass"] = accept_glass
var beakerContents[0]
@@ -141,7 +141,7 @@
data["chemicals"] = chemicals
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm

View File

@@ -114,7 +114,7 @@
if(total_purity && fresh_coolant)
coolant_purity = total_purity / fresh_coolant
/obj/machinery/radiocarbon_spectrometer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
/obj/machinery/radiocarbon_spectrometer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
if(user.stat)
return
@@ -146,7 +146,7 @@
data["rad_shield_on"] = rad_shield
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm

View File

@@ -18,7 +18,7 @@
ui_interact(user)
/obj/machinery/computer/shuttle_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
/obj/machinery/computer/shuttle_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
var/datum/shuttle/ferry/shuttle = shuttle_controller.shuttles[shuttle_tag]
if (!istype(shuttle))
@@ -57,7 +57,7 @@
"can_force" = shuttle.can_force(),
)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "shuttle_control_console.tmpl", "[shuttle_tag] Shuttle Control", 470, 310)

View File

@@ -153,7 +153,7 @@
read_authorization(W)
..()
/obj/machinery/computer/shuttle_control/emergency/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
/obj/machinery/computer/shuttle_control/emergency/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
var/datum/shuttle/ferry/emergency/shuttle = shuttle_controller.shuttles[shuttle_tag]
if (!istype(shuttle))
@@ -211,7 +211,7 @@
"user" = debug? user : null,
)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "escape_shuttle_control_console.tmpl", "Shuttle Control", 470, 420)

View File

@@ -36,7 +36,7 @@
if(..()) return
ui_interact(user)
/obj/machinery/computer/centrifuge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
/obj/machinery/computer/centrifuge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
user.set_machine(src)
var/data[0]
@@ -70,7 +70,7 @@
data["antibodies"] = A && A.data["antibodies"] ? antigens2string(A.data["antibodies"]) : null
data["is_antibody_sample"] = 1
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "isolation_centrifuge.tmpl", src.name, 400, 500)
ui.set_initial_data(data)

View File

@@ -43,7 +43,7 @@
if(..()) return
ui_interact(user)
/obj/machinery/computer/diseasesplicer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
/obj/machinery/computer/diseasesplicer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
user.set_machine(src)
var/data[0]
@@ -81,7 +81,7 @@
else
data["info"] = "No dish loaded."
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "disease_splicer.tmpl", src.name, 400, 600)
ui.set_initial_data(data)

View File

@@ -50,7 +50,7 @@
if(stat & (NOPOWER|BROKEN)) return
ui_interact(user)
/obj/machinery/disease2/incubator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
/obj/machinery/disease2/incubator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
user.set_machine(src)
var/data[0]
@@ -82,7 +82,7 @@
for (var/ID in virus)
data["blood_already_infected"] = virus[ID]
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "dish_incubator.tmpl", src.name, 400, 600)
ui.set_initial_data(data)

View File

@@ -49,7 +49,7 @@
if(stat & (NOPOWER|BROKEN)) return
ui_interact(user)
/obj/machinery/disease2/isolator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
/obj/machinery/disease2/isolator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
user.set_machine(src)
var/data[0]
@@ -100,7 +100,7 @@
"name" = entry.fields["name"], \
"description" = replacetext(desc, "\n", ""))
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "pathogenic_isolator.tmpl", src.name, 400, 500)
ui.set_initial_data(data)