Merge pull request #10409 from AzuleUtama/uplinkSearch

Uplink - Collapsible Categories and Layout Tweaks
This commit is contained in:
variableundefined
2018-12-11 20:45:45 +08:00
committed by GitHub
3 changed files with 39 additions and 29 deletions
+1
View File
@@ -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
+5 -3
View File
@@ -24,6 +24,7 @@ var/list/world_uplinks = list()
var/job = null
var/show_descriptions = 0
var/temp_category
/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
@@ -260,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"])
@@ -272,6 +271,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
+33 -26
View File
@@ -11,11 +11,10 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm
<b>Functions</b>:
</div>
<div class="itemContent">
{{: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('Purchase Gear', 'gear', {'menu' : 0, 'category' : null}, null, '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')}}
{{: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')}}
</div>
</div>
<br>
@@ -32,30 +31,38 @@ Used In File(s): \code\game\objects\items\devices\uplinks.dm
</div>
</div>
<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>
{{if itemValue.Cost <= data.crystals && data.descriptions}}
<div class="item">
{{:itemValue.Description}}
</div>
{{/if}}
{{/for}}
<br>
{{/for}}
<div class="item">
{{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, data.crystals <= 0 ? 'disabled' : null, null)}}
</div>
{{for data.nano_items}}
{{if value.Category == data.category_choice}}
<div class="item">
{{:helper.link('Refund item in active hand' , 'gear', {refund : 1}, null, null)}}
{{:helper.link ( value.Category, 'arrow-circle-down', {'menu' : 0, 'category' : null}, null, 'white')}}
</div>
{{else}}
<div class="item">
{{:helper.link ( value.Category, 'arrow-circle-right', {'menu' : 0, 'category' : value.Category}, null, 'white')}}
</div>
{{/if}}
{{if value.Category == data.category_choice}}
<div class="block">
{{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>
{{if itemValue.Cost <= data.crystals && data.descriptions}}
<div class="item">
{{:itemValue.Description}}
</div>
{{/if}}
{{/for}}
</div>
{{/if}}
{{/for}}
<br>
<div class="item">
{{:helper.link('Buy Random Item' , 'gear', {'buy_item' : 'random'}, data.crystals <= 0 ? 'disabled' : null, 'white')}}
</div>
<div class="item">
{{:helper.link('Refund item in active hand' , 'gear', {refund : 1}, null, 'white')}}
</div>
{{else data.menu == 1}}