Palette crayon fix (#31692)

* Fix crayons bricking palettes

* Fix colors from pens (and now crayons) refusing to mix with other colors on palette
This commit is contained in:
jellyveggie2
2021-12-25 18:31:31 +01:00
committed by GitHub
parent 07816e1821
commit 37b6fcd9a4
6 changed files with 37 additions and 27 deletions

View File

@@ -34,9 +34,9 @@
var/obj/item/toy/crayon/c = held_item
max_strength = PENCIL_STRENGTH_MAX
min_strength = PENCIL_STRENGTH_MIN
palette += c.colour
palette += c.mainColour
palette += c.shadeColour
base_color = c.color
base_color = c.mainColour
// Painting with hair dye sprays
if (istype(held_item, /obj/item/weapon/hair_dye))
@@ -63,6 +63,16 @@
palette += b.paint_color
base_color = b.paint_color
// Normalize palette colors
for (var/i = 1; i < palette.len; i++)
palette[i] = lowertext(palette[i])
if (length(palette[i]) < 9) //If missing alpha channel assume opaque
palette[i] += "ff"
// Normalize base color
base_color = lowertext(base_color)
if (length(base_color) < 9) //If missing alpha channel assume opaque
base_color += "ff"
/datum/painting_utensil/proc/duplicate()
var/datum/painting_utensil/dupe = new(null, null)