From c83863508f8dd135935491812460490a16d980c4 Mon Sep 17 00:00:00 2001 From: Bjarl <94164348+Bjarl@users.noreply.github.com> Date: Thu, 20 Jul 2023 19:16:28 -0700 Subject: [PATCH] Alt-Click door assemblies to rotate them (#2090) ## About The Pull Request see title ## Why It's Good For The Game construction qol ## Changelog :cl: add: you can rotate door assemblies with alt-click /:cl: --- code/game/gamemodes/sandbox/airlock_maker.dm | 7 +++++++ code/game/machinery/doors/airlock.dm | 1 + code/game/machinery/doors/poddoor.dm | 1 + code/game/objects/structures/poddoor_assembly.dm | 7 +++++++ 4 files changed, 16 insertions(+) diff --git a/code/game/gamemodes/sandbox/airlock_maker.dm b/code/game/gamemodes/sandbox/airlock_maker.dm index ab98aa80b428..da1db44bb251 100644 --- a/code/game/gamemodes/sandbox/airlock_maker.dm +++ b/code/game/gamemodes/sandbox/airlock_maker.dm @@ -14,6 +14,13 @@ if(maker) maker.interact() +/obj/structure/door_assembly/ComponentInitialize() + . = ..() + AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS, null, CALLBACK(src, .proc/can_be_rotated)) + +/obj/structure/door_assembly/proc/can_be_rotated(mob/user, rotation_type) + return !anchored + /datum/airlock_maker var/obj/structure/door_assembly/linked = null diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index f009f9723b8e..680e0f898919 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1483,6 +1483,7 @@ A.previous_assembly = previous_airlock A.update_name() A.update_icon() + A.dir = dir if(!disassembled) if(A) diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index 465bfb4672bc..a55b68c5593d 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -65,6 +65,7 @@ assembly.update_name() assembly.update_icon() assembly.welded = TRUE + assembly.dir = dir new /obj/item/electronics/airlock(loc) qdel(src) diff --git a/code/game/objects/structures/poddoor_assembly.dm b/code/game/objects/structures/poddoor_assembly.dm index 96202deec4f2..919a92b11128 100644 --- a/code/game/objects/structures/poddoor_assembly.dm +++ b/code/game/objects/structures/poddoor_assembly.dm @@ -24,6 +24,13 @@ update_icon() update_door_name() +/obj/structure/poddoor_assembly/ComponentInitialize() + . = ..() + AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS, null, CALLBACK(src, .proc/can_be_rotated)) + +/obj/structure/poddoor_assembly/proc/can_be_rotated(mob/user, rotation_type) + return !anchored + /obj/structure/poddoor_assembly/examine(mob/user) . = ..() var/doorname = ""