Files
Paradise/code/game/objects/items/devices/painter/pipe_painter.dm
T
AylongandGitHub 825c2c8866 Converts Input List to TGUI Input Lists (#23396)
* Part 1

* Testing 1

* Revert "Testing 1"

This reverts commit fc06554b28.

* Part 1.1

* Part 2 - UI Style List

* Preferences lists

* Preferences lists - DONE

* More inputs

* MOOOOOORE

* UI style else

* Last ones

* Double name fix

* Pre-selected Search

* Return Pick Darkness

* Return Pick Darkness

* Missing users

* Some review changes

* Revert MULE lists

* I just hate MERGE CONFLICT label

* List window tweaks

* I think there it is

* why i am stopid

* Update tgui.bundle.js
2023-12-10 19:38:23 +00:00

39 lines
1.2 KiB
Plaintext

/datum/painter/pipe
module_name = "pipe painter"
module_state = "pipe_painter"
var/static/list/blacklisted_pipes = list(/obj/machinery/atmospherics/pipe/simple/heat_exchanging, /obj/machinery/atmospherics/pipe/simple/insulated)
var/static/list/modes = list()
/datum/painter/pipe/New()
..()
if(!length(modes))
for(var/C in GLOB.pipe_colors)
modes += "[C]"
paint_setting = pick(modes)
/datum/painter/pipe/pick_color(mob/user)
var/new_paint_setting = tgui_input_list(user, "Which color do you want to use?", "Pick color", modes)
if(!new_paint_setting)
return
paint_setting = new_paint_setting
/datum/painter/pipe/paint_atom(atom/target, mob/user)
if(!istype(target, /obj/machinery/atmospherics/pipe))
return
var/obj/machinery/atmospherics/pipe/P = target
if(is_type_in_list(P, blacklisted_pipes))
return
if(P.pipe_color == GLOB.pipe_colors[paint_setting])
to_chat(user, "<span class='notice'>This pipe is aready painted [paint_setting]!</span>")
return
var/turf/T = get_turf(P)
if(P.level < 2 && T.level == 1 && T.intact && !T.transparent_floor)
to_chat(user, "<span class='warning'>You must remove the flooring first.</span>")
return
P.change_color(GLOB.pipe_colors[paint_setting])
return TRUE