Geeves
2024-05-01 22:34:15 +00:00
committed by GitHub
parent 61748c7429
commit 3e43bea584
7 changed files with 117 additions and 59 deletions
+31 -31
View File
@@ -1,21 +1,21 @@
//--------------------------------------------
// Pipe colors
//
// Add them here and to the pipe_colors list
// Add them here and to the GLOB.pipe_colors list
// to automatically add them to all relevant
// atmospherics devices.
//--------------------------------------------
/proc/pipe_color_lookup(var/color)
for(var/C in pipe_colors)
if(color == pipe_colors[C])
for(var/C in GLOB.pipe_colors)
if(color == GLOB.pipe_colors[C])
return "[C]"
/proc/pipe_color_check(var/color)
if(!color)
return 1
for(var/C in pipe_colors)
if(color == pipe_colors[C])
for(var/C in GLOB.pipe_colors)
if(color == GLOB.pipe_colors[C])
return 1
return 0
@@ -95,10 +95,10 @@
var/image/I = image('icons/atmos/pipes.dmi', icon_state = state)
pipe_icons[cache_name] = I
for(var/pipe_color in pipe_colors)
for(var/pipe_color in GLOB.pipe_colors)
I = image('icons/atmos/pipes.dmi', icon_state = state)
I.color = pipe_colors[pipe_color]
pipe_icons[state + "[pipe_colors[pipe_color]]"] = I
I.color = GLOB.pipe_colors[pipe_color]
pipe_icons[state + "[GLOB.pipe_colors[pipe_color]]"] = I
pipe = new ('icons/atmos/heat.dmi')
for(var/state in pipe.IconStates())
@@ -128,10 +128,10 @@
if(findtext(state, "core") || findtext(state, "4way"))
var/image/I = image('icons/atmos/manifold.dmi', icon_state = state)
manifold_icons[state] = I
for(var/pipe_color in pipe_colors)
for(var/pipe_color in GLOB.pipe_colors)
I = image('icons/atmos/manifold.dmi', icon_state = state)
I.color = pipe_colors[pipe_color]
manifold_icons[state + pipe_colors[pipe_color]] = I
I.color = GLOB.pipe_colors[pipe_color]
manifold_icons[state + GLOB.pipe_colors[pipe_color]] = I
/datum/pipe_icon_manager/proc/gen_device_icons()
if(!device_icons)
@@ -179,10 +179,10 @@
for(var/D in GLOB.cardinal)
var/image/I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
underlays[cache_name + "[D]"] = I
for(var/pipe_color in pipe_colors)
for(var/pipe_color in GLOB.pipe_colors)
I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
I.color = pipe_colors[pipe_color]
underlays[state + "[D]" + "[pipe_colors[pipe_color]]"] = I
I.color = GLOB.pipe_colors[pipe_color]
underlays[state + "[D]" + "[GLOB.pipe_colors[pipe_color]]"] = I
/*
Leaving the old icon manager code commented out for now, as we may want to rewrite the new code to cleanly
@@ -241,39 +241,39 @@
pipe_underlays_exposed["[D]"] = I
if("pipe_intact-scrubbers")
pipe_underlays_intact["[D]"] = I
for(var/pipe_color in pipe_colors)
for(var/pipe_color in GLOB.pipe_colors)
I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
I.color = pipe_colors[pipe_color]
I.color = GLOB.pipe_colors[pipe_color]
switch(state)
if("intact")
underlays_intact["[D]" + pipe_colors[pipe_color]] = I
underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("exposed")
underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("down")
underlays_down["[D]" + pipe_colors[pipe_color]] = I
underlays_down["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_exposed")
pipe_underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
pipe_underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_intact")
pipe_underlays_intact["[D]" + pipe_colors[pipe_color]] = I
pipe_underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("intact-supply")
underlays_intact["[D]" + pipe_colors[pipe_color]] = I
underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("exposed-supply")
underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("down-supply")
underlays_down["[D]" + pipe_colors[pipe_color]] = I
underlays_down["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_exposed-supply")
pipe_underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
pipe_underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_intact-supply")
pipe_underlays_intact["[D]" + pipe_colors[pipe_color]] = I
pipe_underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("intact-scrubbers")
underlays_intact["[D]" + pipe_colors[pipe_color]] = I
underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("exposed-scrubbers")
underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("down-scrubbers")
underlays_down["[D]" + pipe_colors[pipe_color]] = I
underlays_down["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_exposed-scrubbers")
pipe_underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
pipe_underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_intact-scrubbers")
pipe_underlays_intact["[D]" + pipe_colors[pipe_color]] = I
pipe_underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
*/
+11
View File
@@ -26,6 +26,17 @@
desc_info += "<br>Most pipes and atmospheric devices can be connected or disconnected with a wrench. The pipe's pressure must not be too high, \
or if it is a device, it must be turned off first."
/obj/machinery/atmospherics/pipe/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
var/pipe_color_check = pipe_color || PIPE_COLOR_GREY
var/found_color_name = "Unknown"
for(var/color_name in GLOB.pipe_colors)
var/color_value = GLOB.pipe_colors[color_name]
if(pipe_color_check == color_value)
found_color_name = color_name
break
. += "This pipe is: <span style='color:[pipe_color_check == PIPE_COLOR_GREY ? COLOR_GRAY : pipe_color_check]'>[capitalize(found_color_name)]</span>"
/obj/machinery/atmospherics/pipe/hides_under_flooring()
return level != 2