diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index 53efa61f96..6c764dad16 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -11,12 +11,21 @@ A list of items and costs is stored under the datum of every game mode, alongsid var/cost = 0 var/path = null var/reference = "" + var/description = "" -datum/uplink_item/New(var/itemPath, var/itemCost as num, var/itemName as text, var/itemReference as text) +datum/uplink_item/New(var/itemPath, var/itemCost as num, var/itemName as text, var/itemReference as text, var/itemDescription) cost = itemCost path = itemPath name = itemName - reference = itemReference + description = itemDescription + + +datum/uplink_item/proc/description() + if(!description) + // Fallback description + var/obj/temp = src.path + description = replacetext(initial(temp.desc), "\n", "
") + return description datum/nano_item_lists var/list/items_nano @@ -41,16 +50,17 @@ datum/nano_item_lists uses = ticker.mode.uplink_uses ItemsCategory = ticker.mode.uplink_items - var/datum/nano_item_lists/IL = generate_item_lists() - nanoui_items = IL.items_nano - ItemsReference = IL.items_reference - world_uplinks += src /obj/item/device/uplink/Del() world_uplinks -= src ..() +/obj/item/device/uplink/proc/generate_items() + var/datum/nano_item_lists/IL = generate_item_lists() + nanoui_items = IL.items_nano + ItemsReference = IL.items_reference + // BS12 no longer use this menu but there are forks that do, hency why we keep it /obj/item/device/uplink/proc/generate_menu() var/dat = "[src.welcome]
" @@ -87,7 +97,7 @@ datum/nano_item_lists for(var/category in ItemsCategory) nano[++nano.len] = list("Category" = category, "items" = list()) for(var/datum/uplink_item/I in ItemsCategory[category]) - nano[nano.len]["items"] += list(list("Name" = I.name, "Cost" = I.cost, "obj_path" = I.reference)) + nano[nano.len]["items"] += list(list("Name" = I.name, "Description" = I.description(),"Cost" = I.cost, "obj_path" = I.reference)) reference[I.reference] = I var/datum/nano_item_lists/result = new @@ -189,6 +199,8 @@ datum/nano_item_lists data["welcome"] = welcome data["crystals"] = uses data["menu"] = nanoui_menu + if(!nanoui_items) + generate_items() data["nano_items"] = nanoui_items data += nanoui_data diff --git a/nano/templates/uplink.tmpl b/nano/templates/uplink.tmpl index e3d65b45c6..e981155622 100644 --- a/nano/templates/uplink.tmpl +++ b/nano/templates/uplink.tmpl @@ -1,93 +1,99 @@ - - -{{:helper.syndicateMode()}} -

{{:data.welcome}}

-
-
-
- Functions: -
-
- {{:helper.link('Request Items', 'gear', {'menu' : 0}, null, 'fixedLeftWider')}} - {{:helper.link('Exploitable Information', 'gear', {'menu' : 1}, null, 'fixedLeftWider')}} - {{:helper.link('Return', 'arrowreturn-1-w', {'return' : 1}, null, 'fixedLeft')}} - {{:helper.link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}} -
-
-
- -{{if data.menu == 0}} -

Request items:

- Each item costs a number of tele-crystals as indicated by the number following their name. -
-
- Tele-Crystals: -
-
- {{:data.crystals}} -
-
-
- {{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'}, data.crystals <= 0 ? 'disabled' : null, null)}} -
- -{{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.exploit_exists == 1}} - Name: {{:data.exploit.name}}
- Sex: {{:data.exploit.sex}}
- Species: {{:data.exploit.species}}
- Age: {{:data.exploit.age}}
- Rank: {{:data.exploit.rank}}
- Home System: {{:data.exploit.home_system}}
- Citizenship: {{:data.exploit.citizenship}}
- Faction: {{:data.exploit.faction}}
- Religion: {{:data.exploit.religion}}
- Fingerprint: {{:data.exploit.fingerprint}}
- -
Acquired Information:
- Notes:
{{:data.exploit.nanoui_exploit_record}}

- {{else}} - - No exploitative information acquired! -
-
-
- {{/if}} -
-
-
-{{/if}} + + +{{:helper.syndicateMode()}} +

{{:data.welcome}}

+
+
+
+ Functions: +
+
+ {{:helper.link('Request Items', 'gear', {'menu' : 0}, null, 'fixedLeftWider')}} + {{:helper.link('Exploitable Information', 'gear', {'menu' : 1}, null, 'fixedLeftWider')}} + {{:helper.link('Return', 'arrowreturn-1-w', {'return' : 1}, null, 'fixedLeft')}} + {{:helper.link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}} +
+
+
+ +{{if data.menu == 0}} +

Request items:

+ Each item costs a number of tele-crystals as indicated by the number following their name. +
+
+ Tele-Crystals: +
+
+ {{:data.crystals}} +
+
+
+ {{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}} +
+ + {{if itemValue.Cost <= data.crystals}} +
+ {{:itemValue.Description}} +
+ {{/if}} + {{/for}} +
+ {{/for}} + +
+ {{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, data.crystals <= 0 ? 'disabled' : null, null)}} +
+ +{{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.exploit_exists == 1}} + Name: {{:data.exploit.name}}
+ Sex: {{:data.exploit.sex}}
+ Species: {{:data.exploit.species}}
+ Age: {{:data.exploit.age}}
+ Rank: {{:data.exploit.rank}}
+ Home System: {{:data.exploit.home_system}}
+ Citizenship: {{:data.exploit.citizenship}}
+ Faction: {{:data.exploit.faction}}
+ Religion: {{:data.exploit.religion}}
+ Fingerprint: {{:data.exploit.fingerprint}}
+ +
Acquired Information:
+ Notes:
{{:data.exploit.nanoui_exploit_record}}

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