mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 08:36:00 +01:00
[MIRROR] Rotation component refactor and improvements [MDB IGNORE] (#11304)
* Rotation component refactor and improvements * Update code/modules/power/singularity/emitter.dm * e Co-authored-by: Tim <timothymtorres@gmail.com> Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
@@ -70,6 +70,7 @@
|
||||
flags_1 |= ALLOW_DARK_PAINTS_1
|
||||
RegisterSignal(src, COMSIG_OBJ_PAINTED, .proc/on_painted)
|
||||
AddElement(/datum/element/atmos_sensitive, mapload)
|
||||
AddComponent(/datum/component/simple_rotation, ROTATION_NEEDS_ROOM, AfterRotation = CALLBACK(src,.proc/AfterRotation))
|
||||
|
||||
var/static/list/loc_connections = list(
|
||||
COMSIG_ATOM_EXIT = .proc/on_exit,
|
||||
@@ -78,10 +79,6 @@
|
||||
if (flags_1 & ON_BORDER_1)
|
||||
AddElement(/datum/element/connect_loc, loc_connections)
|
||||
|
||||
/obj/structure/window/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS ,null,CALLBACK(src, .proc/can_be_rotated),CALLBACK(src,.proc/after_rotation))
|
||||
|
||||
/obj/structure/window/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
||||
switch(the_rcd.mode)
|
||||
if(RCD_DECONSTRUCT)
|
||||
@@ -295,21 +292,8 @@
|
||||
if (fulltile)
|
||||
. += new /obj/item/shard(location)
|
||||
|
||||
/obj/structure/window/proc/can_be_rotated(mob/user,rotation_type)
|
||||
if(anchored)
|
||||
to_chat(user, span_warning("[src] cannot be rotated while it is fastened to the floor!"))
|
||||
return FALSE
|
||||
|
||||
var/target_dir = turn(dir, rotation_type == ROTATION_CLOCKWISE ? -90 : 90)
|
||||
|
||||
if(!valid_window_location(loc, target_dir, is_fulltile = fulltile))
|
||||
to_chat(user, span_warning("[src] cannot be rotated in that direction!"))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/window/proc/after_rotation(mob/user,rotation_type)
|
||||
/obj/structure/window/proc/AfterRotation(mob/user, degrees)
|
||||
air_update_turf(TRUE, FALSE)
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/structure/window/proc/on_painted(obj/structure/window/source, is_dark_color)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
Reference in New Issue
Block a user