diff --git a/code/game/objects/items/devices/communicator/UI.dm b/code/game/objects/items/devices/communicator/UI.dm index 593896b4a2..c1d5af8303 100644 --- a/code/game/objects/items/devices/communicator/UI.dm +++ b/code/game/objects/items/devices/communicator/UI.dm @@ -117,17 +117,21 @@ if(cartridge) // If there's a cartridge, we need to grab the information from it data["cart_devices"] = cartridge.get_device_status() data["cart_templates"] = cartridge.ui_templates + data["cart_info"] = cartridge.get_data() // update the ui if it exists, returns null if no ui is passed/found ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if(!ui) // 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) + data["currentTab"] = 1 // Reset the current tab, because we're going to home page + 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") // 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 @@ -254,11 +258,8 @@ if(href_list["switch_template"]) var/datum/nanoui/ui = nanomanager.get_open_ui(usr, src, "main") if(ui) - switch(href_list["switch_template"]) - if("1") - ui.reinitialise("communicator.tmpl") - if("2") - ui.reinitialise("comm2.tmpl") + usr << "Switching to template [href_list["switch_template"]]" + ui.append_template("Body", href_list["switch_template"]) if(href_list["Light"]) fon = !fon diff --git a/code/game/objects/items/devices/communicator/cartridge.dm b/code/game/objects/items/devices/communicator/cartridge.dm index 850036ab9e..f47608747d 100644 --- a/code/game/objects/items/devices/communicator/cartridge.dm +++ b/code/game/objects/items/devices/communicator/cartridge.dm @@ -22,6 +22,9 @@ L[++L.len] = list("name" = I.name, "active" = 0, "index" = i++) return L +/obj/item/weapon/commcard/proc/get_data() + return list() + /obj/item/weapon/commcard/engineering name = "\improper Power-ON cartridge" icon_state = "cart-e" @@ -45,6 +48,7 @@ /obj/item/weapon/commcard/medical name = "\improper Med-U cartridge" icon_state = "cart-m" + ui_templates = list(list("name" = "Medical Records", "template" = "med_records.tmpl"), list("name" = "test", "template" = "comm2.tmpl")) // List of list for when multiple templates //Med records template //Med scanner //Halogen counter @@ -55,6 +59,27 @@ internal_devices |= new /obj/item/device/halogen_counter(src) // Add med records template +/obj/item/weapon/commcard/medical/get_data() + var/data[0] + var/records[0] + for(var/datum/data/record/M in sortRecord(data_core.medical)) + var/record[0] + record[++record.len] = list("tab" = "Name", "val" = M.fields["name"]) + record[++record.len] = list("tab" = "ID", "val" = M.fields["id"]) + record[++record.len] = list("tab" = "Blood Type", "val" = M.fields["b_type"]) + record[++record.len] = list("tab" = "DNA #", "val" = M.fields["b_dna"]) + record[++record.len] = list("tab" = "Gender", "val" = M.fields["id_gender"]) + record[++record.len] = list("tab" = "Entity Classification", "val" = M.fields["brain_type"]) + record[++record.len] = list("tab" = "Minor Disorders", "val" = M.fields["mi_dis"]) + record[++record.len] = list("tab" = "Major Disorders", "val" = M.fields["ma_dis"]) + record[++record.len] = list("tab" = "Allergies", "val" = M.fields["alg"]) + record[++record.len] = list("tab" = "Condition", "val" = M.fields["cdi"]) + record[++record.len] = list("tab" = "Notes", "val" = M.fields["notes"]) + + records[++records.len] = list("name" = M.fields["name"], "record" = record) + data["records"] = records + return data + /obj/item/weapon/commcard/medical/chemistry name = "\improper ChemWhiz cartridge" icon_state = "cart-chem" diff --git a/nano/templates/comm2.tmpl b/nano/templates/comm2.tmpl index ca80ef6ca3..651fc0b20c 100644 --- a/nano/templates/comm2.tmpl +++ b/nano/templates/comm2.tmpl @@ -3,7 +3,7 @@ Title: Communicator UI Used In File(s): code\game\objects\items\devices\communicator\communicator.dm --> -
+
{{:data.time}} | @@ -18,11 +18,24 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
-
{{:helper.link('Home', 'home', {'switch_template' : 1})}}
-
-
- {{for data.homeScreen}} - {{:helper.link(value.module, value.icon, {'switch_tab' : value.number}, null, 'link64')}} +

Medical Records

+{{if data.currentTab == "0"}} +
+ {{for data.cart_info.records}} +
+ {{:helper.link(value.name, '', {"switch_tab" : value.name})}} +
{{/for}}
-
\ No newline at end of file +{{/if}} +{{for data.cart_info.records}} + {{if value.name == data.currentTab}} +
{{:helper.link('Back', 'icon-triangle-1-w', {'switch_tab' : 0})}}

+ {{for value.record :itemValue:itemIndex}} +
+
{{:itemValue.tab}}
+
{{:itemValue.val}}
+
+ {{/for}} + {{/if}} +{{/for}} \ No newline at end of file diff --git a/nano/templates/communicator.tmpl b/nano/templates/communicator.tmpl index 340188001f..d12caee4b6 100644 --- a/nano/templates/communicator.tmpl +++ b/nano/templates/communicator.tmpl @@ -3,20 +3,6 @@ Title: Communicator UI Used In File(s): code\game\objects\items\devices\communicator\communicator.dm --> -
-
-
- {{:data.time}} | - {{if data.connectionStatus == 1}} - - {{else}} - - {{/if}} - | {{:data.owner}} | {{:data.occupation}} -
-
-
- {{if data.currentTab == 1}}
@@ -86,43 +72,43 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm

Connection Management


External Connections

- {{for data.voice_mobs}} -
-
- {{:value.name}} -
-
-
{{:helper.link('Disconnect', 'close', {'disconnect' : value.true_name}, null, 'redButton')}}
-
+ {{for data.voice_mobs}} +
+
+ {{:value.name}}
- {{/for}} +
+
{{:helper.link('Disconnect', 'close', {'disconnect' : value.true_name}, null, 'redButton')}}
+
+
+ {{/for}}

Internal Connections

- {{for data.communicating}} -
-
- {{:value.name}} -
-
- {{:helper.link('Disconnect', 'close', {'disconnect' : value.true_name}, null, 'redButton')}} - {{if data.video_comm == null}} - {{:helper.link('Start Video', 'signal-diag', {'startvideo' : value.ref})}} - {{else data.video_comm == value.ref}} - {{:helper.link('End Video', 'signal-diag', {'endvideo' : value.true_name}, null, 'redButton')}} - {{/if}} -
+ {{for data.communicating}} +
+
+ {{:value.name}}
- {{/for}} +
+ {{:helper.link('Disconnect', 'close', {'disconnect' : value.true_name}, null, 'redButton')}} + {{if data.video_comm == null}} + {{:helper.link('Start Video', 'signal-diag', {'startvideo' : value.ref})}} + {{else data.video_comm == value.ref}} + {{:helper.link('End Video', 'signal-diag', {'endvideo' : value.true_name}, null, 'redButton')}} + {{/if}} +
+
+ {{/for}}

Requests Received

- {{for data.requestsReceived}} -
-
- {{:value.name}} -
-
-
{{:value.address}}
{{:helper.link('Accept', 'signal-diag', {'dial' : value.address})}}{{:helper.link('Decline', 'close', {'decline' : value.ref})}} -
+ {{for data.requestsReceived}} +
+
+ {{:value.name}}
- {{/for}} +
+
{{:value.address}}
{{:helper.link('Accept', 'signal-diag', {'dial' : value.address})}}{{:helper.link('Decline', 'close', {'decline' : value.ref})}} +
+
+ {{/for}}

Invites Sent

{{for data.invitesSent}} @@ -146,19 +132,19 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
{{:helper.link('Home', 'home', {'switch_tab' : 1})}}

- {{for data.knownDevices}} -
-
- {{:value.name}} -
-
-
{{:value.address}}
- {{:helper.link('Copy', 'pencil', {'copy' : value.address, 'switch_tab' : 2})}} - {{:helper.link('Call', 'phone', {'dial' : value.address, 'copy' : value.address, 'switch_tab' : 2})}} - {{:helper.link('Msg', 'mail-closed', {'copy' : value.address, 'copy_name' : value.name, 'switch_tab' : 40})}} -
+ {{for data.knownDevices}} +
+
+ {{:value.name}}
- {{/for}} +
+
{{:value.address}}
+ {{:helper.link('Copy', 'pencil', {'copy' : value.address, 'switch_tab' : 2})}} + {{:helper.link('Call', 'phone', {'dial' : value.address, 'copy' : value.address, 'switch_tab' : 2})}} + {{:helper.link('Msg', 'mail-closed', {'copy' : value.address, 'copy_name' : value.name, 'switch_tab' : 40})}} +
+
+ {{/for}} @@ -215,8 +201,8 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
{{:helper.link('Home', 'home', {'switch_tab' : 1})}}

- {{if data.feeds.length}} - + + {{if data.feeds.length}}

Recent News

@@ -418,8 +404,14 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
{{:helper.link('Home', 'home', {'switch_tab' : 1})}}

- {{:helper.link('External Device', 'gear', {'switch_template' : 2})}} + {{:helper.link('External Device', 'gear', {'switch_template' : 'comm2.tmpl'})}}
+ {{for data.cart_templates}} +
+ {{:helper.link(value.name, 'gear', {'switch_template' : value.template, 'switch_tab' : 0})}} +
+ {{empty}} + {{/for}} {{if data.cart_devices}}

Internal Devices

diff --git a/nano/templates/communicator_header.tmpl b/nano/templates/communicator_header.tmpl new file mode 100644 index 0000000000..fd4f136312 --- /dev/null +++ b/nano/templates/communicator_header.tmpl @@ -0,0 +1,16 @@ +
+
+
+ {{:data.time}} | + {{if data.connectionStatus == 1}} + + {{else}} + + {{/if}} + | {{:data.owner}} | {{:data.occupation}} | +
+
+ {{:helper.link('Home', 'home', {'switch_tab' : 1, 'switch_template' : 'communicator.tmpl'})}} +
+
+
\ No newline at end of file diff --git a/nano/templates/manifest.tmpl b/nano/templates/manifest.tmpl new file mode 100644 index 0000000000..00c45a1d5f --- /dev/null +++ b/nano/templates/manifest.tmpl @@ -0,0 +1,27 @@ + + +

Crew Manifest

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

+ +
+
+ {{for data.manifest}} + {{if value.elems.length}} + + {{for value.elems :itemValue:itemIndex}} + + + + + + {{/for}} + {{/if}} + {{/for}} +
{{:value.cat}}
{{:itemValue.name}}{{:itemValue.rank}}{{:itemValue.active}}
+
diff --git a/nano/templates/med_records.tmpl b/nano/templates/med_records.tmpl new file mode 100644 index 0000000000..6883c9281d --- /dev/null +++ b/nano/templates/med_records.tmpl @@ -0,0 +1,21 @@ +

Medical Records

+{{if data.currentTab == "0"}} +
+ {{for data.cart_info.records}} +
+ {{:helper.link(value.name, '', {"switch_tab" : value.name})}} +
+ {{/for}} +
+{{/if}} +{{for data.cart_info.records}} + {{if value.name == data.currentTab}} +
{{:helper.link('Back', 'icon-triangle-1-w', {'switch_tab' : 0})}}

+ {{for value.record :itemValue:itemIndex}} +
+
{{:itemValue.tab}}
+
{{:itemValue.val}}
+
+ {{/for}} + {{/if}} +{{/for}} \ No newline at end of file diff --git a/polaris.dme b/polaris.dme index f00565f47e..78f6c2b403 100644 --- a/polaris.dme +++ b/polaris.dme @@ -2490,7 +2490,7 @@ #include "code\ZAS\Zone.dm" #include "interface\interface.dm" #include "interface\skin.dmf" -#include "maps\southern_cross\southern_cross.dm" +#include "maps\example\example.dm" #include "maps\submaps\space_submaps\space.dm" #include "maps\submaps\surface_submaps\mountains\mountains.dm" #include "maps\submaps\surface_submaps\mountains\mountains_areas.dm"