mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
[FIX] Ventcrawling overlay fixes (#27013)
* Vent images update while ventcrawling * Add some comments * Autodoc for a variable * Get rid of this useless timer * Update code/modules/atmospherics/machinery/atmospherics.dm Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com> Signed-off-by: Chap <erwin@lombok.demon.nl> * Move update pipe image to unary base * We're doing signals now * Added a comment to the signal * Trailing newline --------- Signed-off-by: Chap <erwin@lombok.demon.nl> Co-authored-by: Adrer <adrermail@gmail.com> Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
This commit is contained in:
co-authored by
Nathan Winters
Adrer
parent
66ed8f5026
commit
08b92591ee
@@ -101,8 +101,8 @@ Pipelines + Other Objects -> Pipe network
|
||||
plane = GAME_PLANE
|
||||
layer = GAS_PIPE_VISIBLE_LAYER + layer_offset
|
||||
|
||||
/obj/machinery/atmospherics/proc/update_pipe_image()
|
||||
pipe_image = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir) //the 20 puts it above Byond's darkness (not its opacity view)
|
||||
/obj/machinery/atmospherics/proc/update_pipe_image(overlay = src)
|
||||
pipe_image = image(overlay, loc, layer = ABOVE_HUD_LAYER, dir = dir) //the 20 puts it above Byond's darkness (not its opacity view)
|
||||
pipe_image.plane = HUD_PLANE
|
||||
|
||||
/obj/machinery/atmospherics/proc/check_icon_cache()
|
||||
@@ -322,6 +322,7 @@ Pipelines + Other Objects -> Pipe network
|
||||
// Ventcrawling
|
||||
#define VENT_SOUND_DELAY 30
|
||||
/obj/machinery/atmospherics/relaymove(mob/living/user, direction)
|
||||
var/datum/pipeline/current_pipenet = returnPipenet(src)
|
||||
direction &= initialize_directions
|
||||
if(!direction || !(direction in GLOB.cardinal)) //cant go this way.
|
||||
return
|
||||
@@ -332,6 +333,7 @@ Pipelines + Other Objects -> Pipe network
|
||||
var/obj/machinery/atmospherics/target_move = findConnecting(direction)
|
||||
if(target_move)
|
||||
if(is_type_in_list(target_move, GLOB.ventcrawl_machinery) && target_move.can_crawl_through())
|
||||
current_pipenet.crawlers -= user
|
||||
user.remove_ventcrawl()
|
||||
user.forceMove(target_move.loc) //handles entering and so on
|
||||
user.visible_message("You hear something squeezing through the ducts.", "You climb out of the ventilation system.")
|
||||
@@ -344,6 +346,7 @@ Pipelines + Other Objects -> Pipe network
|
||||
playsound(src, 'sound/machines/ventcrawl.ogg', 50, TRUE, -3)
|
||||
else
|
||||
if((direction & initialize_directions) || is_type_in_list(src, GLOB.ventcrawl_machinery)) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
|
||||
current_pipenet.crawlers -= user
|
||||
user.remove_ventcrawl()
|
||||
user.forceMove(loc)
|
||||
user.visible_message("You hear something squeezing through the pipes.", "You climb out of the ventilation system.")
|
||||
|
||||
@@ -50,6 +50,13 @@
|
||||
build_network()
|
||||
. = 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/update_pipe_image()
|
||||
. = ..()
|
||||
if(parent)
|
||||
for(var/mob/crawler in parent.crawlers)
|
||||
var/mob/living/current_crawler = crawler
|
||||
current_crawler.update_pipe_vision(src)
|
||||
|
||||
/obj/machinery/atmospherics/unary/build_network(remove_deferral = FALSE)
|
||||
if(!parent)
|
||||
parent = new /datum/pipeline()
|
||||
|
||||
@@ -88,8 +88,7 @@
|
||||
vent_icon += "[on ? "[releasing ? "out" : "in"]" : "off"]"
|
||||
|
||||
. += GLOB.pipe_icon_manager.get_atmos_icon("device", state = vent_icon)
|
||||
|
||||
update_pipe_image()
|
||||
update_pipe_image(.)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/update_underlays()
|
||||
if(..())
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
scrubber_icon = "scrubberweld"
|
||||
|
||||
. += GLOB.pipe_icon_manager.get_atmos_icon("device", state = scrubber_icon)
|
||||
update_pipe_image()
|
||||
update_pipe_image(.)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/update_underlays()
|
||||
if(..())
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
var/update = TRUE
|
||||
|
||||
var/list/crawlers = list()
|
||||
|
||||
/datum/pipeline/New()
|
||||
SSair.pipenets += src
|
||||
|
||||
@@ -220,3 +222,12 @@
|
||||
GL += C.portableConnectorReturnAir()
|
||||
|
||||
share_many_airs(GL)
|
||||
|
||||
/datum/pipeline/proc/add_ventcrawler(mob/living/crawler)
|
||||
if(!(crawler in crawlers))
|
||||
RegisterSignal(crawler, COMSIG_LIVING_EXIT_VENTCRAWL, PROC_REF(remove_ventcrawler), crawler)
|
||||
crawlers += crawler
|
||||
|
||||
/datum/pipeline/proc/remove_ventcrawler(mob/living/crawler)
|
||||
UnregisterSignal(crawler, COMSIG_LIVING_EXIT_VENTCRAWL)
|
||||
crawlers -= crawler
|
||||
|
||||
Reference in New Issue
Block a user