Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qol: custom colors for window painter #3774

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading