From da45a40fadfd3ac946a1397e15b343e851c028fd Mon Sep 17 00:00:00 2001 From: atermonera Date: Sat, 14 Jul 2018 22:05:32 -0700 Subject: [PATCH] Refactor crew manifest to a separate file --- code/game/objects/items/devices/PDA/PDA.dm | 1 + .../objects/items/devices/communicator/UI.dm | 4 ++-- nano/templates/communicator.tmpl | 20 +------------------ nano/templates/crew_manifest.tmpl | 5 +++-- nano/templates/pda.tmpl | 19 +----------------- 5 files changed, 8 insertions(+), 41 deletions(-) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 9dfb2c31737..bf034508dec 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -655,6 +655,7 @@ var/global/list/obj/item/device/pda/PDAs = list() 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") + ui.add_template("crewManifest", "crew_manifest.tmpl") // when the ui is first opened this is the data it will use ui.set_initial_data(data) // open the new ui window diff --git a/code/game/objects/items/devices/communicator/UI.dm b/code/game/objects/items/devices/communicator/UI.dm index 7b235129905..16f36f9b93f 100644 --- a/code/game/objects/items/devices/communicator/UI.dm +++ b/code/game/objects/items/devices/communicator/UI.dm @@ -133,10 +133,10 @@ ui = new(user, src, ui_key, "communicator_header.tmpl", "Communicator", 475, 700, state = key_state) // add templates for screens in common with communicator. ui.add_template("atmosphericScan", "atmospheric_scan.tmpl") + ui.add_template("crewManifest", "crew_manifest.tmpl") + ui.add_template("Body", "communicator.tmpl") // Main body // when the ui is first opened this is the data it will use ui.set_initial_data(data) - // Append main body - ui.append_template("Body", "communicator.tmpl") // open the new ui window ui.open() // auto update every five Master Controller tick diff --git a/nano/templates/communicator.tmpl b/nano/templates/communicator.tmpl index ff08a1bfe9d..4126def57f4 100644 --- a/nano/templates/communicator.tmpl +++ b/nano/templates/communicator.tmpl @@ -300,25 +300,7 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm {{else data.currentTab == 8}} -

Crew Manifest

-
- -
-
- {{for data.manifest}} - {{if value.elems.length}} - - {{for value.elems :itemValue:itemIndex}} - - - - - - {{/for}} - {{/if}} - {{/for}} -
{{:value.cat}}
{{:itemValue.name}}{{:itemValue.rank}}{{:itemValue.active}}
-
+ {{#def.crewManifest}} diff --git a/nano/templates/crew_manifest.tmpl b/nano/templates/crew_manifest.tmpl index 00c45a1d5ff..2246fefd260 100644 --- a/nano/templates/crew_manifest.tmpl +++ b/nano/templates/crew_manifest.tmpl @@ -1,5 +1,7 @@ - @@ -7,7 +9,6 @@ Copy-pasted from pda.tmpl

Crew Manifest


-
{{:helper.link('Home', 'home', {'switch_tab' : 1})}}

diff --git a/nano/templates/pda.tmpl b/nano/templates/pda.tmpl index 04ee2abfd94..e8911f7b9bf 100644 --- a/nano/templates/pda.tmpl +++ b/nano/templates/pda.tmpl @@ -295,24 +295,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm {{else data.mode== 41}} -
-
- {{for data.manifest}} - {{if value.elems.length}} - - {{for value.elems :itemValue:itemIndex}} - - - - - - {{/for}} - {{/if}} - {{/for}} - - -
{{:value.cat}}
{{:itemValue.name}}{{:itemValue.rank}}{{:itemValue.active}}
-
+ {{#def.crewManifest}} {{else data.mode == 3}}