diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index c43e9c33b72..86fe16ca1cf 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -100,7 +100,7 @@ Passive gate is similar to the regular pump except: /obj/machinery/atmospherics/components/binary/passive_gate/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0) ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "atmos_pump.tmpl", name, 400, 100) + ui = new(user, src, ui_key, "atmos_pump.dot", name, 400, 100) ui.open() /obj/machinery/atmospherics/components/binary/passive_gate/get_ui_data() diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 5062bd6dcf3..7032618d919 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -108,7 +108,7 @@ Thus, the two variables affect pump operation are set in New(): /obj/machinery/atmospherics/components/binary/pump/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0) ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "atmos_pump.tmpl", name, 400, 100) + ui = new(user, src, ui_key, "atmos_pump.dot", name, 400, 100) ui.open() /obj/machinery/atmospherics/components/binary/pump/get_ui_data() diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index ead30d5e6d9..a9b11200d58 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -105,7 +105,7 @@ Thus, the two variables affect pump operation are set in New(): /obj/machinery/atmospherics/components/binary/volume_pump/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0) ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "atmos_pump.tmpl", name, 400, 100) + ui = new(user, src, ui_key, "atmos_pump.dot", name, 400, 100) ui.open() /obj/machinery/atmospherics/components/binary/volume_pump/get_ui_data() diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 11b47197251..591ca7c7931 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -172,7 +172,7 @@ Filter types: /obj/machinery/atmospherics/components/trinary/filter/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0) ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "atmos_filter.tmpl", name, 400, 120) + ui = new(user, src, ui_key, "atmos_filter.dot", name, 400, 120) ui.open() /obj/machinery/atmospherics/components/trinary/filter/get_ui_data() diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 9e39a0b40f3..28cadf48539 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -135,7 +135,7 @@ /obj/machinery/atmospherics/components/trinary/mixer/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0) ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "atmos_mixer.tmpl", name, 400, 145) + ui = new(user, src, ui_key, "atmos_mixer.dot", name, 400, 145) ui.open() /obj/machinery/atmospherics/components/trinary/mixer/get_ui_data() diff --git a/code/ATMOSPHERICS/components/unary_devices/cryo.dm b/code/ATMOSPHERICS/components/unary_devices/cryo.dm index 88fb4e5bc03..9414f305397 100644 --- a/code/ATMOSPHERICS/components/unary_devices/cryo.dm +++ b/code/ATMOSPHERICS/components/unary_devices/cryo.dm @@ -113,7 +113,7 @@ /obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0) ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "cryo.tmpl", name, 520, 560, state = notcontained_state) + ui = new(user, src, ui_key, "cryo.dot", name, 520, 560, state = notcontained_state) ui.open() /obj/machinery/atmospherics/components/unary/cryo_cell/get_ui_data() diff --git a/code/controllers/subsystem/nano.dm b/code/controllers/subsystem/nano.dm index 30434484c5f..48b6bfb4612 100644 --- a/code/controllers/subsystem/nano.dm +++ b/code/controllers/subsystem/nano.dm @@ -2,7 +2,7 @@ var/datum/subsystem/nano/SSnano /datum/subsystem/nano name = "NanoUI" - wait = 10 + wait = 5 priority = 16 display = 6 diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index fe5c1be83a6..7ff29041ad9 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -187,7 +187,7 @@ /obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0) ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "air_alarm.tmpl", name, 480, 625) + ui = new(user, src, ui_key, "air_alarm.dot", name, 480, 625) ui.open() /obj/machinery/alarm/get_ui_data(mob/user) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 3e36bf39410..8b506bc1ef9 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -277,7 +277,7 @@ update_flag /obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0) ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "canister.tmpl", name, 470, 400, state = physical_state) + ui = new(user, src, ui_key, "canister.dot", name, 470, 400, state = physical_state) ui.open() /obj/machinery/portable_atmospherics/canister/get_ui_data() diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm index 63bce544e72..c53f3e9fde7 100644 --- a/code/game/machinery/doors/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock_electronics.dm @@ -16,7 +16,7 @@ /obj/item/weapon/electronics/airlock/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, force_open = 0) SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "airlock_electronics.tmpl", name, 975, 415, state = hands_state) + ui = new(user, src, ui_key, "airlock_electronics.dot", name, 975, 415, state = hands_state) ui.open() /obj/item/weapon/electronics/airlock/get_ui_data() diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 737d22ee22d..ee2a8ae7ca0 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -159,7 +159,7 @@ /obj/machinery/space_heater/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0) ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "space_heater.tmpl", name, 490, 350, state = physical_state) + ui = new(user, src, ui_key, "space_heater.dot", name, 490, 350, state = physical_state) ui.open() /obj/machinery/space_heater/Topic(href, href_list) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index ac41c83c18c..279d6fcde71 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -122,7 +122,7 @@ /obj/item/weapon/tank/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, force_open = 0) ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "tanks.tmpl", name, 525, 175, state = inventory_state) + ui = new(user, src, ui_key, "tanks.dot", name, 525, 175, state = inventory_state) ui.open() /obj/item/weapon/tank/get_ui_data() diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index f05466bf81d..09a7c0985a3 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -22,6 +22,9 @@ /client/Topic(href, href_list, hsrc) if(!usr || usr != mob) //stops us calling Topic for somebody else's client. Also helps prevent usr=null return + if(href_list["nanoui_error"]) + src << href_list["nanoui_error"] + throw EXCEPTION("NanoUI: [href_list["nanoui_error"]]") if(href_list["asset_cache_confirm_arrival"]) //src << "ASSET JOB [href_list["asset_cache_confirm_arrival"]] ARRIVED." var/job = text2num(href_list["asset_cache_confirm_arrival"]) diff --git a/code/modules/games/playing_cards.dmi b/code/modules/games/playing_cards.dmi index 47b5b3e745a..ac8916a64e5 100644 Binary files a/code/modules/games/playing_cards.dmi and b/code/modules/games/playing_cards.dmi differ diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 69ec116fbd3..b09bc9c21a1 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -28,13 +28,10 @@ var/list/stylesheets = list() // The list of CSS stylesheets to apply to the NanoUI.. var/list/scripts = list() // The list of Javascript scripts to apply to the NanoUI. var/templates[0] // The list of NanoUI templates available to the NanoUI. - var/layout_key = "default" // The layout_key used to load alternate layouts and CSS. - var/state_key = "default" // The state of the frontend. + var/layout = "default" // The layout used to load alternate layouts and CSS. var/auto_update = 1 // Update the NanoUI every MC tick. var/auto_update_layout = 0 // Re-render the layout every update. var/auto_update_content = 1 // Re-render the content every update. - var/show_map = 0 // Show the Map UI. - var/map_z_level = 1 // Map Z-level. var/list/initial_data // The data (and datastructure) used to initialize the NanoUI var/status = NANO_INTERACTIVE // The status/visibility of the NanoUI. var/datum/topic_state/state = null // Topic state used to determine status. Topic states are in interactions/. @@ -96,30 +93,13 @@ * Add the assets required by all NanoUIs. **/ /datum/nanoui/proc/add_common_assets() - // Libraries: jQuery, jQuery-UI, and doT. - add_script("jquery.js") - add_script("jquery-ui.js") - add_script("doT.js") - // Nano Utility: Utility functions and sanity checks. - add_script("nano_utility.js") // The NanoUtility JS, this is used to store utility functions. - // Nano Template: Renders templates using doT. - add_script("nano_template.js") - // Nano State Manager: Handles server updates and passes them to the current state. - add_script("nano_state_manager.js") - // Nano State: Base state. - add_script("nano_state.js") - // Nano State/Default: State used by all NanoUIs by default. - add_script("nano_state_default.js") - // Nano Base Callbacks: Used to set up callbacks across all NanoUIs. - add_script("nano_base_callbacks.js") - // Nano Base Helpers: Template helpers common across all NanoUIs. - add_script("nano_base_helpers.js") - // CSS reset. - add_stylesheet("normalize.css") - // Common style elements. - add_stylesheet("shared.css") - // Icons. - add_stylesheet("icons.css") + add_script("nanoui.js") + add_script("nanoui.util.js") + add_script("nanoui.template.js") + add_script("nanoui.helpers.js") + add_script("nanoui.handlers.js") + + add_stylesheet("nanoui.css") /** * private @@ -190,12 +170,9 @@ "srcObject" = list( "name" = src_object.name ), - "stateKey" = state_key, "status" = status, "autoUpdateLayout" = auto_update_layout, "autoUpdateContent" = auto_update_content, - "showMap" = show_map, - "mapZLevel" = map_z_level, "user" = list( "name" = user.name ) @@ -266,13 +243,13 @@ /** * public * - * Set the layout key for this NanoUI. - * This loads two files during get_html(): 'layout_[layout_key].tmpl' and 'layout_[layout_key].css'. + * Set the layout for this NanoUI. + * This loads two files during get_html(): 'layout_[layout].dot' and 'layout_[layout].css'. * * required layout_key string The new layout key. **/ -/datum/nanoui/proc/set_layout_key(layout_key) - src.layout_key = lowertext(layout_key) +/datum/nanoui/proc/set_layout(layout) + src.layout = lowertext(layout) /** * public @@ -294,36 +271,6 @@ /datum/nanoui/proc/set_auto_update_content(state) auto_update_content = state - /** - * public - * - * Set the state key used in the frontend. - * - * required state_key string The new state key.. - **/ -/datum/nanoui/proc/set_state_key(state_key) - src.state_key = state_key - - /** - * public - * - * Toggle showing the Map UI. - * - * required state bool Enable/disable the Map UI. - **/ -/datum/nanoui/proc/set_show_map(state) - show_map = state - - /** - * public - * - * Set the map Z-level. - * - * required z int The new Z-level. - **/ -/datum/nanoui/proc/set_map_z_level(z) - map_z_level = z - /** * public * @@ -343,8 +290,8 @@ **/ /datum/nanoui/proc/get_html() // Add files based on the layout key. - add_stylesheet("layout_[layout_key].css") - add_template("layout", "layout_[layout_key].tmpl") + add_template("layout", "layout_[layout].dot") + add_stylesheet("layout_[layout].css") // Generate + + + + + + + + [script_html] + + [stylesheet_html] - -
+ +