Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Feature] Item Ability Labels
#1
This patch appends (ITEM NAME) to the end of the name of any item ability toggles associated with the item.

For example, if you're holding an emergency o2 tank and a jetpack, you'll have two buttons, both labeled "Toggle Tank Valve". This patch makes them say "Toggle Tank Valve (jetpack)" and "Toggle Tank Valve (emergency oxygen tank)", respectively.

http://puu.sh/shv80/ce5c74b3ce.patch


DO NOT COPY PASTE FROM THIS BOX; IT HAS HAD TABS REMOVED
Code:
--- a/code/WorkInProgress/AbilityItem.dm
+++ b/code/WorkInProgress/AbilityItem.dm
@@ -294,7 +294,10 @@
var/obj/ability_button/NB = new A(src)
ability_buttons += NB

- for(var/obj/ability_button/B in ability_buttons) B.the_item = src
+ for(var/obj/ability_button/B in ability_buttons)
+ B.the_item = src
+ B.name = B.name + " ([src.name])"
+
// if(ability_buttons.len > 0)
// spawn(0) check_abilities()
..()

Credit for this goes to drsingh, who originally suggested it. I just decided to figure out how to implement it. There's probably a better way of doing this, and if so, i encourage anyone who would like to do so to do that. Consider this patch a suggestion+.
Reply


Messages In This Thread
[Feature] Item Ability Labels - by UrsulaMejor - 11-13-2016, 06:54 PM
RE: [Feature] Item Ability Labels - by medsal15 - 11-13-2016, 08:59 PM
RE: [Feature] Item Ability Labels - by Nnystyxx - 11-14-2016, 03:06 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)