From fa38505de9d97c2afea42f34eecca1b0cf48d21c Mon Sep 17 00:00:00 2001 From: Rimi Nosha Date: Tue, 28 Nov 2023 21:16:09 +0000 Subject: [PATCH] Makes Elevator Emergency Stop Non-Silent, Fix Panel Stop Button Appearance (#385) --- .../SpaceRuins/hilbertresearchfacility.dmm | 6 ++--- _maps/map_files/tramstation/tramstation.dmm | 6 ++--- .../datums/industrial_lift/lift_controller.dm | 7 ++++++ .../structures/industrial_lift_structures.dm | 25 ++++++++----------- .../Artea/385_remove_speaker_buttons.txt | 5 ++++ 5 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 tools/UpdatePaths/Artea/385_remove_speaker_buttons.txt diff --git a/_maps/RandomRuins/SpaceRuins/hilbertresearchfacility.dmm b/_maps/RandomRuins/SpaceRuins/hilbertresearchfacility.dmm index 735a7bbc2a3..43aa6c15a02 100644 --- a/_maps/RandomRuins/SpaceRuins/hilbertresearchfacility.dmm +++ b/_maps/RandomRuins/SpaceRuins/hilbertresearchfacility.dmm @@ -461,7 +461,7 @@ /turf/open/floor/mineral/titanium/tiled/white, /area/ruin/space/has_grav/powered/hilbertresearchfacility) "kP" = ( -/obj/machinery/button/elevator/speaker{ +/obj/machinery/button/elevator{ id = "hilbert"; pixel_y = 4 }, @@ -2136,7 +2136,7 @@ dir = 8 }, /obj/structure/table/reinforced/rglass, -/obj/machinery/button/elevator/speaker{ +/obj/machinery/button/elevator{ id = "right_part_hilbert"; pixel_y = 4 }, @@ -2153,7 +2153,7 @@ dir = 1 }, /obj/structure/sign/departments/cargo/directional/north, -/obj/machinery/button/elevator/speaker{ +/obj/machinery/button/elevator{ id = "hilbert"; pixel_y = 4 }, diff --git a/_maps/map_files/tramstation/tramstation.dmm b/_maps/map_files/tramstation/tramstation.dmm index 8b691ea6cca..f17849f3fcc 100644 --- a/_maps/map_files/tramstation/tramstation.dmm +++ b/_maps/map_files/tramstation/tramstation.dmm @@ -1670,7 +1670,7 @@ /turf/open/floor/iron/grimy, /area/station/hallway/secondary/entry) "aMD" = ( -/obj/machinery/button/elevator/speaker{ +/obj/machinery/button/elevator{ id = "tram" }, /turf/closed/wall, @@ -26475,7 +26475,7 @@ /turf/open/floor/iron, /area/station/hallway/secondary/entry) "jEO" = ( -/obj/machinery/button/elevator/speaker{ +/obj/machinery/button/elevator{ id = "tram" }, /turf/closed/wall, @@ -37541,7 +37541,7 @@ /turf/open/floor/iron, /area/station/engineering/atmospherics_engine) "nwQ" = ( -/obj/machinery/button/elevator/speaker{ +/obj/machinery/button/elevator{ id = "tram" }, /turf/closed/wall, diff --git a/code/datums/industrial_lift/lift_controller.dm b/code/datums/industrial_lift/lift_controller.dm index 0917e425e1f..c300cbf2bbe 100644 --- a/code/datums/industrial_lift/lift_controller.dm +++ b/code/datums/industrial_lift/lift_controller.dm @@ -62,6 +62,9 @@ /// Whether we are currently managing a roof var/managing_roof = FALSE + /// A list of elevator panels to notify when lift is e-stopped. + var/list/controller_machines = list() + /datum/lift_controller/process(delta_time) if(next_action_time > world.time) return @@ -269,6 +272,9 @@ intentionally_halted = !intentionally_halted if(intentionally_halted) SetHalted(TRUE) + for(var/atom/movable/speaker as anything in controller_machines) + speaker.say("The elevator has been emergency stopped!") + playsound(speaker, 'sound/machines/warning-buzzer.ogg', 75) else next_action_time = world.time + 1 SECONDS @@ -339,6 +345,7 @@ if(halted) travel_progress = 0 loop_sound.stop() + playsound(GetSoundTurf(), ) else loop_sound.start() if(!current_wp) diff --git a/code/game/objects/structures/industrial_lift_structures.dm b/code/game/objects/structures/industrial_lift_structures.dm index bf50737c976..c5cf2ef3230 100644 --- a/code/game/objects/structures/industrial_lift_structures.dm +++ b/code/game/objects/structures/industrial_lift_structures.dm @@ -39,11 +39,9 @@ . += mutable_appearance(icon, display_icon) . += emissive_appearance(icon, display_icon) - /obj/item/assembly/control/elevator name = "elevator controller" desc = "A small device used to call elevators to the current floor." - var/has_speaker = FALSE /obj/item/assembly/control/elevator/activate() if(cooldown) @@ -60,21 +58,15 @@ if(!stop_wp) return if(controller.called_waypoints[stop_wp]) - if(has_speaker) - say("The [controller.name] is already called to this location.") + say("The [controller.name] is already called to this location.") return if(!controller.destination_wp && controller.current_wp == stop_wp) - if(has_speaker) - say("The [controller.name] is already here. Please board the [controller.name] and select a destination.") + say("The [controller.name] is already here. Please board the [controller.name] and select a destination.") return playsound(my_turf, 'sound/lifts/elevator_ding.ogg', 60) - if(has_speaker) - say("The [controller.name] has been called to [stop_wp.name]. Please wait for its arrival.") + say("The [controller.name] has been called to [stop_wp.name]. Please wait for its arrival.") controller.CallWaypoint(stop_wp) -/obj/item/assembly/control/elevator/speaker - has_speaker = TRUE - /obj/machinery/button/elevator name = "elevator button" desc = "Go back. Go back. Go back. Can you operate the elevator." @@ -82,9 +74,6 @@ skin = "launcher" device_type = /obj/item/assembly/control/elevator -/obj/machinery/button/elevator/speaker - device_type = /obj/item/assembly/control/elevator/speaker - /obj/structure/elevator_control_panel icon = 'icons/obj/structures/elevator_control.dmi' icon_state = "elevator_control" @@ -119,6 +108,7 @@ if(linked_controller) name = "[linked_controller.name] control panel" desc = "A panel which interfaces with \the [linked_controller.name] controls." + linked_controller.controller_machines |= src /obj/structure/elevator_control_panel/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) @@ -140,7 +130,7 @@ var/datum/lift_waypoint/stop_wp = i floors += list(list("id" = stop_wp.waypoint_id, "is_active" = !!queued_stops[stop_wp] || stop_wp.position.z == z, "name" = stop_wp.name)) - data += list("floors" = floors, "is_stopped" = linked_controller.halted) + data += list("floors" = floors, "is_stopped" = linked_controller.intentionally_halted) return data /obj/structure/elevator_control_panel/ui_act(action, params) @@ -168,3 +158,8 @@ playsound(src, SFX_TERMINAL_TYPE, 50) ui_interact(usr) return TRUE + +/obj/structure/elevator_control_panel/Destroy() + if(linked_controller) + linked_controller.controller_machines -= src + return ..() diff --git a/tools/UpdatePaths/Artea/385_remove_speaker_buttons.txt b/tools/UpdatePaths/Artea/385_remove_speaker_buttons.txt new file mode 100644 index 00000000000..ff319add92c --- /dev/null +++ b/tools/UpdatePaths/Artea/385_remove_speaker_buttons.txt @@ -0,0 +1,5 @@ +#comment Replaces speaker buttons with... speaker buttons. +https://github.com/Artea-Station/Artea-Station-Server/pull/385 + +/obj/item/assembly/control/elevator/speaker : /obj/item/assembly/control/elevator{@OLD} +/obj/machinery/button/elevator/speaker : /obj/machinery/button/elevator{@OLD} \ No newline at end of file