Accessories are now visible when attached

Uses overlays.

I was originally planning to use the SOUTH direction of the
icons/mob/ties.dmi image as the overlay, however this had problems with
the fact that those images are directional. Rather than override Move()
in clothing/under to reset dir to SOUTH whenever clothing with an
attached accessory was thrown or dragged, I thought it would be less
hacky to read the overlays from a separate .dmi.
This commit is contained in:
Mike
2014-05-10 22:30:09 -04:00
parent f3ea0ab223
commit 6e391c01c9
3 changed files with 9 additions and 0 deletions

View File

@@ -9,6 +9,11 @@
slot_flags = 0
w_class = 2.0
var/obj/item/clothing/under/has_suit = null //the suit the tie may be attached to
var/image/inv_overlay = null //overlay used when attached to clothing.
/obj/item/clothing/tie/New()
..()
inv_overlay = image("icon" = 'icons/obj/clothing/ties_overlay.dmi', "icon_state" = "[item_color? "[item_color]" : "[icon_state]"]")
//when user attached an accessory to S
/obj/item/clothing/tie/proc/on_attached(obj/item/clothing/under/S, mob/user as mob)
@@ -16,12 +21,15 @@
return
has_suit = S
loc = has_suit
has_suit.overlays += inv_overlay
user << "<span class='notice'>You attach [src] to [has_suit].</span>"
src.add_fingerprint(user)
/obj/item/clothing/tie/proc/on_removed(mob/user as mob)
if(!has_suit)
return
has_suit.overlays -= inv_overlay
has_suit = null
usr.put_in_hands(src)
src.add_fingerprint(user)

View File

@@ -501,6 +501,7 @@ proc/get_damage_icon_part(damage_state, body_part)
overlays_standing[UNIFORM_LAYER] = standing
else
overlays_standing[UNIFORM_LAYER] = null
// This really, really seems like it should not be mixed in the middle of display code...
// Automatically drop anything in store / id / belt if you're not wearing a uniform. //CHECK IF NECESARRY
for( var/obj/item/thing in list(r_store, l_store, wear_id, belt) ) //
if(thing) //

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB