mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
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:
@@ -9,6 +9,11 @@
|
|||||||
slot_flags = 0
|
slot_flags = 0
|
||||||
w_class = 2.0
|
w_class = 2.0
|
||||||
var/obj/item/clothing/under/has_suit = null //the suit the tie may be attached to
|
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
|
//when user attached an accessory to S
|
||||||
/obj/item/clothing/tie/proc/on_attached(obj/item/clothing/under/S, mob/user as mob)
|
/obj/item/clothing/tie/proc/on_attached(obj/item/clothing/under/S, mob/user as mob)
|
||||||
@@ -16,12 +21,15 @@
|
|||||||
return
|
return
|
||||||
has_suit = S
|
has_suit = S
|
||||||
loc = has_suit
|
loc = has_suit
|
||||||
|
has_suit.overlays += inv_overlay
|
||||||
|
|
||||||
user << "<span class='notice'>You attach [src] to [has_suit].</span>"
|
user << "<span class='notice'>You attach [src] to [has_suit].</span>"
|
||||||
src.add_fingerprint(user)
|
src.add_fingerprint(user)
|
||||||
|
|
||||||
/obj/item/clothing/tie/proc/on_removed(mob/user as mob)
|
/obj/item/clothing/tie/proc/on_removed(mob/user as mob)
|
||||||
if(!has_suit)
|
if(!has_suit)
|
||||||
return
|
return
|
||||||
|
has_suit.overlays -= inv_overlay
|
||||||
has_suit = null
|
has_suit = null
|
||||||
usr.put_in_hands(src)
|
usr.put_in_hands(src)
|
||||||
src.add_fingerprint(user)
|
src.add_fingerprint(user)
|
||||||
|
|||||||
@@ -501,6 +501,7 @@ proc/get_damage_icon_part(damage_state, body_part)
|
|||||||
overlays_standing[UNIFORM_LAYER] = standing
|
overlays_standing[UNIFORM_LAYER] = standing
|
||||||
else
|
else
|
||||||
overlays_standing[UNIFORM_LAYER] = null
|
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
|
// 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) ) //
|
for( var/obj/item/thing in list(r_store, l_store, wear_id, belt) ) //
|
||||||
if(thing) //
|
if(thing) //
|
||||||
|
|||||||
BIN
icons/obj/clothing/ties_overlay.dmi
Normal file
BIN
icons/obj/clothing/ties_overlay.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Reference in New Issue
Block a user