From dccec4483d53fa24b5e6392ad31f02cfd4600b7d Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Mon, 1 Sep 2014 00:06:30 +0200 Subject: [PATCH] Syndicate agents can now view exploitable information from their syndicate uplink display. --- code/game/machinery/cryopod.dm | 3 + code/game/objects/items/devices/uplinks.dm | 40 ++++++- nano/templates/uplink.tmpl | 125 +++++++++++++++------ 3 files changed, 129 insertions(+), 39 deletions(-) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index fe569e2364..596375b3a2 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -255,6 +255,9 @@ var/global/list/frozen_items = list() for(var/datum/data/record/G in data_core.general) if ((G.fields["name"] == occupant.real_name)) del(G) + for(var/datum/data/record/E in data_core.exploit) + if ((E.fields["name"] == occupant.real_name)) + del(E) if(orient_right) icon_state = "body_scanner_0-r" diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index 04c3c0a7e2..e85a37a824 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -28,6 +28,8 @@ datum/nano_item_lists var/list/ItemsCategory // List of categories with lists of items var/list/ItemsReference // List of references with an associated item var/list/nanoui_items // List of items for NanoUI use + var/nanoui_menu = 0 // The current menu we are in + var/list/nanoui_data = new // Additional data for NanoUI use /obj/item/device/uplink/New() welcome = ticker.mode.uplink_welcome @@ -161,9 +163,11 @@ datum/nano_item_lists var/title = "Syndicate Uplink" var/data[0] - data["crystals"] = uses - data["nano_items"] = nanoui_items data["welcome"] = welcome + data["crystals"] = uses + data["menu"] = nanoui_menu + data["nano_items"] = nanoui_items + data += nanoui_data // update the ui if it exists, returns null if no ui is passed/found ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) @@ -195,8 +199,13 @@ datum/nano_item_lists toggle() ui.close() return 1 - - if(..(href, href_list) == 1) + if(href_list["return"]) + nanoui_menu = round(nanoui_menu/10) + update_nano_data() + if(href_list["menu"]) + nanoui_menu = text2num(href_list["menu"]) + update_nano_data(href_list["id"]) + else if(..(href, href_list) == 1) var/datum/uplink_item/UI = ItemsReference[href_list["buy_item"]] if(!UI) return @@ -209,6 +218,29 @@ datum/nano_item_lists interact(usr) return 1 +/obj/item/device/uplink/hidden/proc/update_nano_data(var/id) + if(nanoui_menu == 1) + var/exploitData[0] + for(var/datum/data/record/R in sortRecord(data_core.exploit)) + exploitData[++exploitData.len] = list(Name = R.fields["name"],"id" = R.fields["id"]) + nanoui_data["exploit_records"] = exploitData + + if(nanoui_menu == 11) + nanoui_data["general_exists"] = 0 + nanoui_data["exploit_exists"] = 0 + + for(var/datum/data/record/R in data_core.general) + if(R.fields["id"] == id) + nanoui_data["general"] = R.fields + nanoui_data["general_exists"] = 1 + break + + for(var/datum/data/record/E in data_core.exploit) + if(E.fields["id"] == id) + nanoui_data["exploit"] = E.fields + nanoui_data["exploit"]["notes"] = replacetext(nanoui_data["exploit"]["notes"], "\n", "
") + nanoui_data["exploit_exists"] = 1 + // I placed this here because of how relevant it is. // You place this in your uplinkable item to check if an uplink is active or not. // If it is, it will display the uplink menu and return 1, else it'll return false. diff --git a/nano/templates/uplink.tmpl b/nano/templates/uplink.tmpl index 807dfbe584..46670e338c 100644 --- a/nano/templates/uplink.tmpl +++ b/nano/templates/uplink.tmpl @@ -4,42 +4,97 @@ Title: Syndicate Uplink, uses some javascript to change nanoUI up a bit. Used In File(s): \code\game\objects\items\devices\uplinks.dm --> {{:helper.syndicateMode()}} -

{{:data.welcome}}

-
-
-
- Functions: -
-
- {{:helper.link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}} -
-
-
-
-
- Tele-Crystals: -
-
- {{:data.crystals}} -
-
-

Request items:


-Each item costs a number of tele-crystals as indicated by the number following their name. - -

-{{for data.nano_items}} +{{if data.menu != 0}}
-

{{:value.Category}}

-
- {{for value.items :itemValue:itemIndex}} -
- {{:helper.link( itemValue.Name, 'gear', {'buy_item' : itemValue.obj_path, 'cost' : itemValue.Cost}, itemValue.Cost > data.crystals ? 'disabled' : null, null)}} - {{:itemValue.Cost}} -
- {{/for}} +
+ {{:helper.link('Return', 'arrowreturn-1-w', {'return' : 1}, null, 'fixedLeftWide')}} +
+
-{{/for}} +{{/if}} +{{if data.menu == 0}} +

{{:data.welcome}}

+
+
+
+ Functions: +
+
+ {{:helper.link('Exploitable Information', 'gear', {'menu' : 1}, null, 'fixedLeftWider')}} + {{:helper.link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}} +
+
+
+
+
+ Tele-Crystals: +
+
+ {{:data.crystals}} +
+
+

Request items:


+ Each item costs a number of tele-crystals as indicated by the number following their name. -
- {{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, null, 'fixedLeftWidest')}} -
+

+ {{for data.nano_items}} +
+

{{:value.Category}}

+
+ {{for value.items :itemValue:itemIndex}} +
+ {{:helper.link( itemValue.Name, 'gear', {'buy_item' : itemValue.obj_path, 'cost' : itemValue.Cost}, itemValue.Cost > data.crystals ? 'disabled' : null, null)}} - {{:itemValue.Cost}} +
+ {{/for}} +
+ {{/for}} +
+ {{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, null, 'fixedLeftWidest')}} +
+{{else data.menu == 1}} + Information Record List +
+
+ Select a Record +
+
+ {{for data.exploit_records}} +
+ {{:helper.link(value.Name, 'gear', {'menu' : 11, 'id' : value.id}, null, null)}} +
+ {{/for}} +{{else data.menu == 11}} + Information Record +
+
+
+
+ {{if data.general_exists == 1}} + Name: {{:data.general.name}}
+ Sex: {{:data.general.sex}}
+ Species: {{:data.general.species}}
+ Age: {{:data.general.age}}
+ Rank: {{:data.general.rank}}
+ Fingerprint: {{:data.general.fingerprint}}
+ Physical Status: {{:data.general.p_stat}}
+ Mental Status: {{:data.general.m_stat}}

+ {{else}} + + General Record Lost!

+
+ {{/if}} + {{if data.exploit_exists == 1}} + Acquired Information:
+ Notes: {{:data.exploit.notes}}

+ {{else}} + + No exploitative information acquired! +
+
+
+ {{/if}} +
+
+
+{{/if}}