Refactor common template HTML for atmospheric scan into its own file.

As a demonstration of the partials inclusion feature, the HTML for the atmospheric scan screen (which was nearly identical between PDAs and Communicators) was moved into a separate file and then transcluded into both pda.tmpl and communicator.tmpl
Also added a README.dm with the very basics of nanoui and template transclusion, and fixed comments in nano_state.js
This commit is contained in:
Leshana
2018-04-27 11:58:41 -04:00
parent b60281e19a
commit f508841fff
7 changed files with 104 additions and 114 deletions

View File

@@ -653,8 +653,9 @@ var/global/list/obj/item/device/pda/PDAs = list()
// 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, "pda.tmpl", title, 520, 400, state = inventory_state)
// add templates for screens in common with communicator.
ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")
// 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()

View File

@@ -118,6 +118,8 @@
// 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, "communicator.tmpl", "Communicator", 475, 700, state = key_state)
// add templates for screens in common with communicator.
ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window