Skip to content

Commit

Permalink
qol: custom colors for window painter (ss220-space#3774)
Browse files Browse the repository at this point in the history
  • Loading branch information
ROdenFL authored and SuhEugene committed Nov 9, 2023
1 parent cd71d4b commit f45cd81
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions code/game/objects/items/devices/window_painter.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/obj/item/pipe_painter/window_painter
name = "window painter"
icon_state = "window_painter"
var/colour = "#ffffff"


var/list/paintable_windows = list(
/obj/structure/window/reinforced,
Expand All @@ -9,14 +11,42 @@
/obj/structure/window/full/basic,
/obj/machinery/door/window)

/obj/item/pipe_painter/window_painter/New()
. = ..()
update_icon()
mode = "paint"


/obj/item/pipe_painter/window_painter/attack_self(mob/user)
var/choice = input(user,"Painter options") in list("Pipette","Choose Color","Color Presets")
switch(choice)
if("Pipette")
mode = "pipette"
if("Choose Color")
mode = "paint"
colour = input(user,"Choose Color") as color
update_icon()
if("Color Presets")
mode = "paint"
colour = input("Which color do you want to use?", name, colour) in GLOB.pipe_colors
update_icon()

/obj/item/pipe_painter/window_painter/afterattack(atom/A, mob/user as mob)
if(!is_type_in_list(A, paintable_windows) || !in_range(user, A))
return
var/obj/structure/window/W = A

if(W.color == GLOB.pipe_colors[mode])
to_chat(user, "<span class='notice'>This window is aready painted [mode]!</span>")
return
if(mode == "paint")
W.color = colour
playsound(loc, usesound, 30, TRUE)
else
colour = W.color
mode = "paint"
to_chat(user, span_notice("You copy color of this window."))
update_icon()

playsound(loc, usesound, 30, TRUE)
W.color = GLOB.pipe_colors[mode]
/obj/item/pipe_painter/window_painter/update_icon()
overlays.Cut()
var/image/colour_image = image('icons/obj/device.dmi', "window_painter_colour")
colour_image.color = colour
overlays += colour_image
Binary file modified icons/obj/device.dmi
Binary file not shown.

0 comments on commit f45cd81

Please sign in to comment.