Skip to content

Commit

Permalink
Merge pull request tgstation#1075 from Giacomand/syndie_menu_collapse
Browse files Browse the repository at this point in the history
Added buttons to the syndie uplink which will reveal/hide the description of the items.
  • Loading branch information
liambaloh committed Aug 7, 2013
2 parents 5b50415 + ad8c525 commit 38a697b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
4 changes: 2 additions & 2 deletions code/datums/uplink_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ var/list/uplink_items = list()
cost = 1

/datum/uplink_item/device_tools/hacked_module
name = "Hacked Artificial Intelligence Law Upload Module"
name = "Hacked AI Law Upload Module"
desc = "When used with an upload console, this module allows you to upload priority laws to an artificial intelligence. Be careful with their wording, as artificial intelligences may look for loopholes to exploit."
item = /obj/item/weapon/aiModule/syndicate
cost = 7
Expand Down Expand Up @@ -307,7 +307,7 @@ var/list/uplink_items = list()
cost = 10

/datum/uplink_item/badass/random
name = "Random Item (?)"
name = "Random Item"
desc = "Picking this choice will send you a random item from the list. Useful for when you cannot think of a strategy to finish your objectives with."
item = /obj/item/weapon/storage/box/syndicate
cost = 0
Expand Down
24 changes: 21 additions & 3 deletions code/game/objects/items/devices/uplinks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ A list of items and costs is stored under the datum of every game mode, alongsid
var/uses // Numbers of crystals
// List of items not to shove in their hands.
var/list/purchase_log = list()
var/show_description = null
var/active = 0

/obj/item/device/uplink/New()
..()
Expand Down Expand Up @@ -45,9 +47,15 @@ A list of items and costs is stored under the datum of every game mode, alongsid
if(item.cost > 0)
cost_text = "([item.cost])"
if(item.cost <= uses)
dat += "<A href='byond://?src=\ref[src];buy_item=[category]:[i];'>[item.name]</A> [cost_text]<BR><font size=2>[desc]</font><BR>"
dat += "<A href='byond://?src=\ref[src];buy_item=[category]:[i];'>[item.name]</A> [cost_text] "
else
dat += "<font color='grey'><i>[item.name] [cost_text]</i></font><BR><font size=2><font color='grey'><i>[desc]</i></font></font><BR>"
dat += "<font color='grey'><i>[item.name] [cost_text] </i></font>"
if(item.desc)
if(show_description == item.type)
dat += "<A href='byond://?src=\ref[src];show_desc=0'><font size=2>\[-\]</font></A><BR><font size=2>[desc]</font>"
else
dat += "<A href='byond://?src=\ref[src];show_desc=[item.type]'><font size=2>\[?\]</font></A>"
dat += "<BR>"

// Break up the categories, if it isn't the last.
if(buyable_items.len != index)
Expand All @@ -70,6 +78,10 @@ A list of items and costs is stored under the datum of every game mode, alongsid

/obj/item/device/uplink/Topic(href, href_list)
..()

if(!active)
return

if (href_list["buy_item"])

var/item = href_list["buy_item"]
Expand All @@ -89,6 +101,13 @@ A list of items and costs is stored under the datum of every game mode, alongsid
I.buy(src, usr)


else if(href_list["show_desc"])

var/type = text2path(href_list["show_desc"])
show_description = type
interact(usr)


// HIDDEN UPLINK - Can be stored in anything but the host item has to have a trigger for it.
/* How to create an uplink in 3 easy steps!
Expand All @@ -104,7 +123,6 @@ A list of items and costs is stored under the datum of every game mode, alongsid
/obj/item/device/uplink/hidden
name = "Hidden Uplink."
desc = "There is something wrong if you're examining this."
var/active = 0

/obj/item/device/uplink/hidden/Topic(href, href_list)
..()
Expand Down

0 comments on commit 38a697b

Please sign in to comment.