From a578f9cef7ab32792fe63232bf044e003a0a4227 Mon Sep 17 00:00:00 2001 From: AzuleUtama <44248086+AzuleUtama@users.noreply.github.com> Date: Wed, 5 Dec 2018 16:02:51 +0000 Subject: [PATCH 1/5] Uplink Category Search Makes it so users can pick categories in the uplink --- code/game/objects/items/devices/uplinks.dm | 5 +++ nano/templates/uplink.tmpl | 43 ++++++++++++++-------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index d0c0622d1e5..927ddb50b56 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -24,6 +24,7 @@ var/list/world_uplinks = list() var/job = null var/show_descriptions = 0 + var/temp_category = "Ammunition" /obj/item/uplink/nano_host() return loc @@ -233,6 +234,7 @@ var/list/world_uplinks = list() if(!nanoui_items) generate_items(user) data["nano_items"] = nanoui_items + data["category_choice"] = temp_category data += nanoui_data return data @@ -272,6 +274,9 @@ var/list/world_uplinks = list() if(href_list["descriptions"]) show_descriptions = !show_descriptions update_nano_data() + if(href_list["category"]) + temp_category = href_list["category"] + update_nano_data() SSnanoui.update_uis(src) return 1 diff --git a/nano/templates/uplink.tmpl b/nano/templates/uplink.tmpl index 6177ab016a7..5eeb22a2c95 100644 --- a/nano/templates/uplink.tmpl +++ b/nano/templates/uplink.tmpl @@ -20,7 +20,7 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm
-{{if data.menu == 0}} +{{if data.menu == 0 || data.menu == 2}}

Request items:

Each item costs a number of tele-crystals as indicated by the number following their name.
@@ -32,23 +32,34 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm

- {{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 data.menu == 0}} + {{for data.nano_items}} +
+ {{:helper.link ( value.Category, 'gear', {'menu' : 2, 'category' : value.Category}, null, null)}} +
+ {{/for}} - {{if itemValue.Cost <= data.crystals && data.descriptions}} -
- {{:itemValue.Description}} -
- {{/if}} - {{/for}} -
+{{else data.menu == 2}} + {{for data.nano_items}} + {{if value.Category == data.category_choice}} +
+

{{: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 && data.descriptions}} +
+ {{:itemValue.Description}} +
+ {{/if}} + {{/for}} + {{/if}} {{/for}} +{{/if}}
{{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, data.crystals <= 0 ? 'disabled' : null, null)}} From 511726172b5858fffde8a6774312ca5a9e91cba3 Mon Sep 17 00:00:00 2001 From: AzuleUtama <44248086+AzuleUtama@users.noreply.github.com> Date: Wed, 5 Dec 2018 17:11:22 +0000 Subject: [PATCH 2/5] Formatting --- nano/templates/uplink.tmpl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nano/templates/uplink.tmpl b/nano/templates/uplink.tmpl index 5eeb22a2c95..e59cf17a8a4 100644 --- a/nano/templates/uplink.tmpl +++ b/nano/templates/uplink.tmpl @@ -12,7 +12,7 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm
{{:helper.link('Request Items', 'gear', {'menu' : 0}, null, 'fixedLeftWider')}} - {{:helper.link(data.descriptions ? 'Hide Descriptions' : 'Show Descriptions', 'gear', {'descriptions' : 1}, data.menu == 0 ? '' : 'disabled', 'fixedLeftWider')}} + {{:helper.link(data.descriptions ? 'Hide Descriptions' : 'Show Descriptions', 'gear', {'descriptions' : 1}, data.menu == 2 ? '' : 'disabled', 'fixedLeftWider')}} {{:helper.link('Exploitable Information', 'gear', {'menu' : 1}, null, 'fixedLeftWider')}} {{:helper.link('Return', 'arrow-left', {'return' : 1}, null, 'fixedLeft')}} {{:helper.link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}} @@ -39,6 +39,10 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm {{:helper.link ( value.Category, 'gear', {'menu' : 2, 'category' : value.Category}, null, null)}}
{{/for}} +
+
+ {{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, data.crystals <= 0 ? 'disabled' : null, null)}} +
{{else data.menu == 2}} {{for data.nano_items}} @@ -60,12 +64,8 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm {{/if}} {{/for}} {{/if}} - -
- {{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, data.crystals <= 0 ? 'disabled' : null, null)}} -
- -
+
+
{{:helper.link('Refund item in active hand' , 'gear', {refund : 1}, null, null)}}
From d0912dc05e471395ad9de8d03c0ad42ffcbf11ff Mon Sep 17 00:00:00 2001 From: AzuleUtama <44248086+AzuleUtama@users.noreply.github.com> Date: Thu, 6 Dec 2018 01:01:14 +0000 Subject: [PATCH 3/5] Categories can be collapsed, all the code is now on one menu. --- nano/templates/uplink.tmpl | 47 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/nano/templates/uplink.tmpl b/nano/templates/uplink.tmpl index e59cf17a8a4..72973bdf8f1 100644 --- a/nano/templates/uplink.tmpl +++ b/nano/templates/uplink.tmpl @@ -11,16 +11,15 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm Functions:
- {{:helper.link('Request Items', 'gear', {'menu' : 0}, null, 'fixedLeftWider')}} - {{:helper.link(data.descriptions ? 'Hide Descriptions' : 'Show Descriptions', 'gear', {'descriptions' : 1}, data.menu == 2 ? '' : 'disabled', 'fixedLeftWider')}} + {{:helper.link('Request Items', 'gear', {'menu' : 0, 'category' : null}, null, 'fixedLeftWider')}} + {{:helper.link(data.descriptions ? 'Hide Descriptions' : 'Show Descriptions', 'gear', {'descriptions' : 1}, data.menu == 0 ? '' : 'disabled', 'fixedLeftWider')}} {{:helper.link('Exploitable Information', 'gear', {'menu' : 1}, null, 'fixedLeftWider')}} - {{:helper.link('Return', 'arrow-left', {'return' : 1}, null, 'fixedLeft')}} {{:helper.link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}}

-{{if data.menu == 0 || data.menu == 2}} +{{if data.menu == 0}}

Request items:

Each item costs a number of tele-crystals as indicated by the number following their name.
@@ -35,39 +34,39 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm {{if data.menu == 0}} {{for data.nano_items}} -
- {{:helper.link ( value.Category, 'gear', {'menu' : 2, 'category' : value.Category}, null, null)}} -
- {{/for}} -
-
- {{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, data.crystals <= 0 ? 'disabled' : null, null)}} -
- -{{else data.menu == 2}} - {{for data.nano_items}} {{if value.Category == data.category_choice}} -
-

{{:value.Category}}

-
+
+ {{:helper.link ( value.Category, 'arrow-circle-down', {'menu' : 0, 'category' : null}, null, 'white')}} +
+ {{else}} +
+ {{:helper.link ( value.Category, 'arrow-circle-right', {'menu' : 0, 'category' : value.Category}, null, 'white')}} +
+ {{/if}} + {{if value.Category == data.category_choice}} +
{{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}} + {{:helper.link( itemValue.Name, 'gear', {'buy_item' : itemValue.obj_path, 'cost' : itemValue.Cost}, itemValue.Cost > data.crystals ? 'disabled' : null, 'redButton')}} - {{:itemValue.Cost}}
- {{if itemValue.Cost <= data.crystals && data.descriptions}}
{{:itemValue.Description}}
{{/if}} {{/for}} +
{{/if}} - {{/for}} -{{/if}} -
+ {{/for}} +
+
- {{:helper.link('Refund item in active hand' , 'gear', {refund : 1}, null, null)}} + {{:helper.link('Buy Random Item' , 'gear', {'buy_item' : 'random'}, data.crystals <= 0 ? 'disabled' : null, 'white')}} +
+
+ {{:helper.link('Refund item in active hand' , 'gear', {refund : 1}, null, 'white')}}
+{{/if}} {{else data.menu == 1}}

Information Record List:

From d9215f3789c886e9ab386e9ebac1c2421ca1c6ed Mon Sep 17 00:00:00 2001 From: AzuleUtama <44248086+AzuleUtama@users.noreply.github.com> Date: Thu, 6 Dec 2018 10:19:23 +0000 Subject: [PATCH 4/5] Made temp category start as null, cleaned up template code --- code/game/objects/items/devices/uplinks.dm | 2 +- nano/templates/uplink.tmpl | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index 927ddb50b56..7582d52e852 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -24,7 +24,7 @@ var/list/world_uplinks = list() var/job = null var/show_descriptions = 0 - var/temp_category = "Ammunition" + var/temp_category /obj/item/uplink/nano_host() return loc diff --git a/nano/templates/uplink.tmpl b/nano/templates/uplink.tmpl index 72973bdf8f1..9aac008a714 100644 --- a/nano/templates/uplink.tmpl +++ b/nano/templates/uplink.tmpl @@ -31,8 +31,7 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm

- -{{if data.menu == 0}} + {{for data.nano_items}} {{if value.Category == data.category_choice}}
@@ -47,7 +46,7 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm
{{for value.items :itemValue:itemIndex}}
- {{:helper.link( itemValue.Name, 'gear', {'buy_item' : itemValue.obj_path, 'cost' : itemValue.Cost}, itemValue.Cost > data.crystals ? 'disabled' : null, 'redButton')}} - {{:itemValue.Cost}} + {{: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 && data.descriptions}}
@@ -58,7 +57,6 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm
{{/if}} {{/for}} -

{{:helper.link('Buy Random Item' , 'gear', {'buy_item' : 'random'}, data.crystals <= 0 ? 'disabled' : null, 'white')}} @@ -66,7 +64,6 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm
{{:helper.link('Refund item in active hand' , 'gear', {refund : 1}, null, 'white')}}
-{{/if}} {{else data.menu == 1}}

Information Record List:

From 00c34f193591d86a2db9220adcd56c012028fb4b Mon Sep 17 00:00:00 2001 From: AzuleUtama <44248086+AzuleUtama@users.noreply.github.com> Date: Fri, 7 Dec 2018 00:09:11 +0000 Subject: [PATCH 5/5] Blocks job specific gear category for nukies, removed last of 'return' function uplink code, minor layout changes to template --- code/datums/uplink_item.dm | 1 + code/game/objects/items/devices/uplinks.dm | 3 --- nano/templates/uplink.tmpl | 6 +++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 8d871447cd3..3f3c394a7e6 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -163,6 +163,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) /datum/uplink_item/jobspecific category = "Job Specific Tools" cant_discount = TRUE + excludefrom = list(/datum/game_mode/nuclear) // Stops the job specific category appearing for nukies //Clown /datum/uplink_item/jobspecific/clowngrenade diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index 7582d52e852..9c080a4c256 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -262,9 +262,6 @@ var/list/world_uplinks = list() hidden_crystals = 0 ui.close() return 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"]) diff --git a/nano/templates/uplink.tmpl b/nano/templates/uplink.tmpl index 9aac008a714..7d2158a240c 100644 --- a/nano/templates/uplink.tmpl +++ b/nano/templates/uplink.tmpl @@ -11,10 +11,10 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm Functions:
- {{:helper.link('Request Items', 'gear', {'menu' : 0, 'category' : null}, null, 'fixedLeftWider')}} - {{:helper.link(data.descriptions ? 'Hide Descriptions' : 'Show Descriptions', 'gear', {'descriptions' : 1}, data.menu == 0 ? '' : 'disabled', 'fixedLeftWider')}} + {{:helper.link('Purchase Gear', 'gear', {'menu' : 0, 'category' : null}, null, 'fixedLeftWider')}} {{:helper.link('Exploitable Information', 'gear', {'menu' : 1}, null, 'fixedLeftWider')}} - {{:helper.link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}} + {{:helper.link(data.descriptions ? 'Hide Descriptions' : 'Show Descriptions', 'info-circle', {'descriptions' : 1}, data.menu == 0 ? '' : 'disabled', 'fixedLeftWider')}} + {{:helper.link('Lock Uplink', 'power-off', {'lock' : "1"}, null, 'fixedLeftWider')}}