Syndicate agents can now view exploitable information from their syndicate uplink display.

This commit is contained in:
PsiOmega
2014-09-01 01:12:03 +02:00
parent 89b29eb0f0
commit dccec4483d
3 changed files with 129 additions and 39 deletions
+3
View File
@@ -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"
+36 -4
View File
@@ -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", "<br>")
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.
+90 -35
View File
@@ -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()}}
<H2><span class="white">{{:data.welcome}}</span></H2>
<br>
<div class="item">
<div class="itemLabelNarrow">
<b>Functions</b>:
</div>
<div class="itemContent">
{{:helper.link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}}
</div>
</div>
<br>
<div class="item">
<div class="itemLabel">
<b>Tele-Crystals</b>:
</div>
<div class="itemContent">
{{:data.crystals}}
</div>
</div>
<H2><span class="white">Request items:</span></H2><br>
<span class="white"><i>Each item costs a number of tele-crystals as indicated by the number following their name.</i></span>
<br><br>
{{for data.nano_items}}
{{if data.menu != 0}}
<div class="item">
<H3><span class="white">{{:value.Category}}</span></H3>
</div>
{{for value.items :itemValue:itemIndex}}
<div class="item">
{{:helper.link( itemValue.Name, 'gear', {'buy_item' : itemValue.obj_path, 'cost' : itemValue.Cost}, itemValue.Cost > data.crystals ? 'disabled' : null, null)}} - <span class="white">{{:itemValue.Cost}}</span>
</div>
{{/for}}
<div class="itemContent">
{{:helper.link('Return', 'arrowreturn-1-w', {'return' : 1}, null, 'fixedLeftWide')}}
</div>
</div>
<br>
{{/for}}
{{/if}}
{{if data.menu == 0}}
<H2><span class="white">{{:data.welcome}}</span></H2>
<br>
<div class="item">
<div class="itemLabelNarrow">
<b>Functions</b>:
</div>
<div class="itemContent">
{{:helper.link('Exploitable Information', 'gear', {'menu' : 1}, null, 'fixedLeftWider')}}
{{:helper.link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}}
</div>
</div>
<br>
<div class="item">
<div class="itemLabel">
<b>Tele-Crystals</b>:
</div>
<div class="itemContent">
{{:data.crystals}}
</div>
</div>
<H2><span class="white">Request items:</span></H2><br>
<span class="white"><i>Each item costs a number of tele-crystals as indicated by the number following their name.</i></span>
<div class="item">
{{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, null, 'fixedLeftWidest')}}
</div>
<br><br>
{{for data.nano_items}}
<div class="item">
<H3><span class="white">{{:value.Category}}</span></H3>
</div>
{{for value.items :itemValue:itemIndex}}
<div class="item">
{{:helper.link( itemValue.Name, 'gear', {'buy_item' : itemValue.obj_path, 'cost' : itemValue.Cost}, itemValue.Cost > data.crystals ? 'disabled' : null, null)}} - <span class="white">{{:itemValue.Cost}}</span>
</div>
{{/for}}
<br>
{{/for}}
<div class="item">
{{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, null, 'fixedLeftWidest')}}
</div>
{{else data.menu == 1}}
<span class="white">Information Record List</span></H2>
<br>
<div class="item">
Select a Record
</div>
<br>
{{for data.exploit_records}}
<div class="item">
{{:helper.link(value.Name, 'gear', {'menu' : 11, 'id' : value.id}, null, null)}}
</div>
{{/for}}
{{else data.menu == 11}}
<span class="white">Information Record</span></H2>
<br>
<div class="statusDisplayRecords">
<div class="item">
<div class="itemContent" style="width: 100%;">
{{if data.general_exists == 1}}
<span class="good">Name: </span> <span class="average">{{:data.general.name}} </span><br>
<span class="good">Sex: </span> <span class="average">{{:data.general.sex}} </span><br>
<span class="good">Species: </span> <span class="average">{{:data.general.species}} </span><br>
<span class="good">Age: </span> <span class="average">{{:data.general.age}} </span><br>
<span class="good">Rank: </span> <span class="average">{{:data.general.rank}} </span><br>
<span class="good">Fingerprint: </span> <span class="average">{{:data.general.fingerprint}} </span><br>
<span class="good">Physical Status: </span> <span class="average">{{:data.general.p_stat}} </span><br>
<span class="good">Mental Status: </span> <span class="average">{{:data.general.m_stat}} </span><br><br>
{{else}}
<span class="bad">
General Record Lost!<br><br>
</span>
{{/if}}
{{if data.exploit_exists == 1}}
Acquired Information:<br>
<span class="good">Notes: </span> <span class="average">{{:data.exploit.notes}} </span><br><br>
{{else}}
<span class="bad">
No exploitative information acquired!
<br>
<br>
</span>
{{/if}}
</div>
</div>
</div>
{{/if}}