Goonstation Forums
[Feature] Item Ability Labels - Printable Version

+- Goonstation Forums (https://forum.ss13.co)
+-- Forum: Discussion (https://forum.ss13.co/forumdisplay.php?fid=6)
+--- Forum: Patches (https://forum.ss13.co/forumdisplay.php?fid=30)
+---- Forum: Implemented (https://forum.ss13.co/forumdisplay.php?fid=31)
+---- Thread: [Feature] Item Ability Labels (/showthread.php?tid=7463)



[Feature] Item Ability Labels - UrsulaMejor - 11-13-2016

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+.


RE: [Feature] Item Ability Labels - medsal15 - 11-13-2016

Add it please. Too many times I have wanted to breath a handheld air tank instead of my emergency oxygen tank I was gonna refill.


RE: [Feature] Item Ability Labels - Nnystyxx - 11-14-2016

Yes please christ
this would be a great qol change especially for when you have multiple oxy tanks and one is drained, you don't want to suffocate yourself