Files
Polaris/nano
Leshana 85d3cbfa12 Replaced "area" shuttles with "landmark" shuttles.
Largely ported from the work done at Baystation in Baystation12#17460 and later commits.

 - Shuttles no longer require a separate area for each location they jump to.
   Instead destinations are indicated by landmark objects, which are not necessarily exclusive to that shuttle.
   This means that more than one shuttle could use the same docking port (not at the same time of course).
 - Enhanced shuttle control computers to use nanoui if they didn't.
 - Organizes shuttle datum code a bit better so there is less re-inventing the wheel in subtypes.
 - Allows the possibility of shuttles (or destinations) that start on late-loaded maps.
 - Deprecate the "extra" shuttle areas that are no longer needed and update shuttle areas in unit tests

This all required a bit of infrastructure improvements.

 - ChangeArea proc, for changing the area of a turf.
 - Fixed lighting overlays actually being able to be destroyed.
 - Added a few utility macros and procs.
 - Added "turf translation" procs which are like move_contents_to but more flexible.

(cherry picked from commit c837078105)
2020-03-13 00:26:08 -04:00
..
2019-07-30 17:03:28 -07:00
2019-04-13 19:30:30 -04:00
2018-08-26 17:08:32 -07:00
2016-03-30 15:02:42 +01:00

NanoUI Templates

NanoUI uses doT (https://olado.github.io/doT/index.html) as its templating engine.

Template Markup Tags

Markup tags are used to add dynamic content to the template. TODO - This documentation is incomplete.

Print Tag

  • The print tag outputs variable as text to the UI. {{:data.variable}}

If Tag

  • The if tag displays content conditionally based on the provided expression being true.
  • When combined with the else tag the if tag can also show content if the provided expression is false.
  • The else tag can optionally have an expression provided (e.g. "{{else expression2}}"), giving it "elseif" functionality.

{{if expression}} <expression true content> {{/if}} {{if expression}} <expression true content> {{else}} <expression false content> {{/if}} {{if expression1}} <expression1 true content> {{else expression2}} <expression2 true content> {{/if}}

For Tag

  • Loop through entries in an array (an array is a list with a numeric index (it does not use strings as keys).
  • Each time the for tag iterates though the array it sets a variable (default "value") to the data of the current entry (another variable, default "index", contains the index). An example of this is using the print tag to print the contents (e.g. {{:value.key1}} and {{:value.key2}}).
  • If combined with an empty tag the for tag can display content when the array is empty.

{{for array}} <list entry content> {{/for}} {{for array}} <list entry content> {{empty}} <empty list content> {{/for}}

Tansclusion Tag

  • Include the contents of another template which has been added to the ui. {{#def.atmosphericScan}}

  • You first must have added a template to the ui server side in your DM code: ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")

  • Then you can reference it in the main template. The tag will be replaced by the contents of the named template. All tags in the named template are evaluated as normal.