Merge pull request #13936 from BlueWildrose/hoodyhoodu

Fixes loadout specific polychromic hoodies not having their hoods polychromable
This commit is contained in:
silicons
2021-01-03 18:10:44 -07:00
committed by GitHub
2 changed files with 11 additions and 0 deletions
+2
View File
@@ -698,6 +698,8 @@ SUBSYSTEM_DEF(job)
if(polychromic && istype(polychromic))
var/list/polychromic_entry = polychromic.colors_by_atom[I]
if(polychromic_entry)
if(polychromic.suits_with_helmet_typecache[I.type]) //is this one of those toggleable hood/helmet things?
polychromic.connect_helmet(I,i[LOADOUT_COLOR])
polychromic.colors_by_atom[I] = i[LOADOUT_COLOR]
I.update_icon()
else
+9
View File
@@ -165,6 +165,15 @@
/datum/element/polychromic/proc/on_examine(atom/source, mob/user, list/examine_list)
examine_list += "<span class='notice'>Alt-click to recolor it.</span>"
/datum/element/polychromic/proc/connect_helmet(atom/I, var/applycolor)
if(isitem(I))
if(istype(I,/obj/item/clothing/suit/hooded))
var/obj/item/clothing/suit/hooded/Isuit = I
colors_by_atom[Isuit.hood] = applycolor
else if(istype(I,/obj/item/clothing/suit/space/hardsuit))
var/obj/item/clothing/suit/space/hardsuit/Isuit = I
colors_by_atom[Isuit.helmet] = applycolor
/datum/element/polychromic/proc/register_helmet(atom/source, obj/item/clothing/head/H)
if(!isitem(H)) //backup in case if it messes up somehow
if(istype(source,/obj/item/clothing/suit/hooded)) //so how come it be like this, where toggleable headslots are named separately (helmet/hood) anyways?