NanoUI updates.

* Simplified the code used in ui_interact procs and updated all current uses.
* Removed ununused jsviews JavaScript code (replaced it with vanilla jsrender).
* Added a message to the UI which shows if JavaScript is disabled (people with JavaScript disabled previously got blank UIs).
This commit is contained in:
Mark Aherne (Faerdan)
2014-01-06 02:49:25 +00:00
parent 909c873b2e
commit f25052fd4c
12 changed files with 1620 additions and 4763 deletions

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 = "radio_spectro")
/obj/machinery/radiocarbon_spectrometer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
if(user.stat)
return
@@ -144,20 +144,19 @@
data["radiation"] = round(radiation)
data["t_left_radspike"] = round(t_left_radspike)
data["rad_shield_on"] = rad_shield
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, ui_key)
// 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)
if (!ui)
// the ui does not exist, so we'll create a new one
// 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
ui = new(user, src, ui_key, "geoscanner.tmpl", "High Res Radiocarbon Spectrometer", 900, 825)
// When the UI is first opened this is the data it will use
ui.set_initial_data(data)
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
ui.open()
// Auto update every Master Controller tick
// auto update every Master Controller tick
ui.set_auto_update(1)
else
// The UI is already open so push the new data to it
ui.push_data(data)
return
/obj/machinery/radiocarbon_spectrometer/process()
if(scanning)