diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index 5b3fe2daf0..135fe3ece3 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -39,6 +39,7 @@ #define COMSIG_ATOM_SING_PULL "atom_sing_pull" //from base of atom/singularity_pull(): (S, current_size) #define COMSIG_ATOM_SET_LIGHT "atom_set_light" //from base of atom/set_light(): (l_range, l_power, l_color) #define COMSIG_ATOM_ROTATE "atom_rotate" //from base of atom/shuttleRotate(): (rotation, params) +#define COMSIG_ATOM_DIR_CHANGE "atom_dir_change" //from base of atom/setDir(): (old_dir, new_dir) #define COMSIG_CLICK "atom_click" //from base of atom/Click(): (location, control, params) #define COMSIG_CLICK_SHIFT "shift_click" //from base of atom/ShiftClick(): (/mob) diff --git a/code/datums/components/turf_decal.dm b/code/datums/components/turf_decal.dm deleted file mode 100644 index 0cd4cb969e..0000000000 --- a/code/datums/components/turf_decal.dm +++ /dev/null @@ -1,51 +0,0 @@ -/datum/component/turf_decal - var/dir - var/icon - var/icon_state - var/layer - var/group - -/datum/component/turf_decal/Initialize(_dir, _icon, _icon_state, _layer=TURF_DECAL_LAYER, _group=TURF_DECAL_PAINT) - if(!isturf(parent) || !_icon || !_icon_state) - WARNING("A turf decal was applied incorrectly to [parent]: icon:[_icon ? _icon : "none"] icon_state:[_icon_state ? _icon_state : "none"]") - return COMPONENT_INCOMPATIBLE - - dir = _dir - icon = _icon - icon_state = _icon_state - layer = _layer - group = _group - apply_decal() - - RegisterSignal(COMSIG_ATOM_ROTATE, .proc/rotate_react) - RegisterSignal(COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_react) - -/datum/component/turf_decal/Destroy() - remove_decal() - return ..() - -/datum/component/turf_decal/OnTransfer(turf/newT) - remove_decal() - remove_decal(newT) - apply_decal(newT) - -/datum/component/turf_decal/proc/get_decal() - return image(icon, null, icon_state, layer, dir) - -/datum/component/turf_decal/proc/apply_decal(turf/overT) - var/turf/master = overT || parent - master.add_decal(get_decal(), group) - -/datum/component/turf_decal/proc/remove_decal(turf/overT) - var/turf/master = overT || parent - master.remove_decal(group) - -/datum/component/turf_decal/proc/rotate_react(rotation, params) - if(params & ROTATE_DIR) - dir = angle2dir(rotation+dir2angle(dir)) - remove_decal() - apply_decal() - -/datum/component/turf_decal/proc/clean_react(strength) - if(strength >= CLEAN_IMPRESSIVE) - qdel(src) \ No newline at end of file diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 8a85bbb814..5f074e44f3 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -520,6 +520,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) //Hook for running code when a dir change occurs /atom/proc/setDir(newdir) + SendSignal(COMSIG_ATOM_DIR_CHANGE, dir, newdir) dir = newdir /atom/proc/mech_melee_attack(obj/mecha/M) diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index 5cae151cb5..f04484c8a3 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -31,7 +31,7 @@ var/turf/T = loc if(!istype(T)) //you know this will happen somehow CRASH("Turf decal initialized in an object/nullspace") - T.AddComponent(/datum/component/turf_decal, dir, icon, icon_state) + T.AddComponent(/datum/component/decal, icon, icon_state, dir) /obj/effect/turf_decal/stripes/line icon_state = "warningline" diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index b0977f887e..11bd241437 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -96,7 +96,6 @@ if(ismonkey(occupant)) // Monkey occupant_overlay = image(CRYOMOBS, "monkey") - occupant_overlay.copy_overlays(occupant) else if(isalienadult(occupant)) if(isalienroyal(occupant)) // Queen and prae occupant_overlay = image(CRYOMOBS, "alienq") @@ -109,9 +108,6 @@ else if(ishuman(occupant) || islarva(occupant) || (isanimal(occupant) && !ismegafauna(occupant))) // Mobs that are smaller than cryotube occupant_overlay = image(occupant.icon, occupant.icon_state) - - if(ishuman(occupant) || islarva(occupant) || (isanimal(occupant) && !ismegafauna(occupant))) // Mobs that are smaller than cryotube - occupant_overlay = image(occupant.icon, occupant.icon_state) occupant_overlay.copy_overlays(occupant) else diff --git a/tgstation.dme b/tgstation.dme index ebb05710fb..d5611d84c7 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -330,6 +330,7 @@ #include "code\datums\antagonists\wizard.dm" #include "code\datums\components\_component.dm" #include "code\datums\components\archaeology.dm" +#include "code\datums\components\decal.dm" #include "code\datums\components\infective.dm" #include "code\datums\components\material_container.dm" #include "code\datums\components\paintable.dm" @@ -340,7 +341,6 @@ #include "code\datums\components\spooky.dm" #include "code\datums\components\squeek.dm" #include "code\datums\components\thermite.dm" -#include "code\datums\components\turf_decal.dm" #include "code\datums\diseases\_disease.dm" #include "code\datums\diseases\_MobProcs.dm" #include "code\datums\diseases\anxiety.dm"