[MIRROR] Pipe painting, spraycan preset colors [MDB IGNORE] (#24974)

* Pipe painting, spraycan preset colors (#79521)

![dreamseeker_AZs0erdnrs](https://github.com/tgstation/tgstation/assets/3625094/06a12d22-387b-4a33-8b61-59bbe3495c82)

## About The Pull Request

Made pipe painter properly paint pipe colors, work on pipe items, and
added the same functionality to regular spraycans.

Spraycans now have the color presets in UI for easier selection of the
valid pipe colors.

## Why It's Good For The Game

Bug fixing is good.
It was weird that spraycans couldn't paint pipes, but some other device
could.
Also custom spraycan color is too clunky, presets are nice for quick
spraycan color selection.

## Changelog

🆑
fix: fixed pipe painter not applying pipe color properly
qol: made spraycans work also as pipe painters
qol: spraycans now have basic color presets for quick selection
/🆑

* Pipe painting, spraycan preset colors

---------

Co-authored-by: Andrew <mt.forspam@gmail.com>
This commit is contained in:
SkyratBot
2023-11-13 09:44:48 -05:00
committed by GitHub
co-authored by Andrew
parent 5ba4a5dd0c
commit 4aa870eb5d
6 changed files with 56 additions and 31 deletions
@@ -9,19 +9,24 @@
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2.5, /datum/material/glass = SHEET_MATERIAL_AMOUNT)
/obj/item/pipe_painter/afterattack(atom/A, mob/user, proximity_flag)
/obj/item/pipe_painter/afterattack(atom/target, mob/user, proximity_flag)
. = ..()
//Make sure we only paint adjacent items
if(!proximity_flag)
return
if(!istype(A, /obj/machinery/atmospherics/pipe))
return
var/obj/machinery/atmospherics/pipe/P = A
if(P.paint(GLOB.pipe_paint_colors[paint_color]))
if(istype(target, /obj/machinery/atmospherics))
var/obj/machinery/atmospherics/target_pipe = target
target_pipe.paint(GLOB.pipe_paint_colors[paint_color])
playsound(src, 'sound/machines/click.ogg', 50, TRUE)
user.visible_message(span_notice("[user] paints \the [P] [paint_color]."),span_notice("You paint \the [P] [paint_color]."))
balloon_alert(user, "painted in [paint_color] color")
else if(istype(target, /obj/item/pipe))
var/obj/item/pipe/target_pipe = target
var/color = GLOB.pipe_paint_colors[paint_color]
target_pipe.pipe_color = color
target.add_atom_colour(color, FIXED_COLOUR_PRIORITY)
playsound(src, 'sound/machines/click.ogg', 50, TRUE)
balloon_alert(user, "painted in [paint_color] color")
/obj/item/pipe_painter/attack_self(mob/user)
paint_color = tgui_input_list(user, "Which colour do you want to use?", "Pipe painter", GLOB.pipe_paint_colors)