diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 504dc89e3a7..33f52055145 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -166,6 +166,10 @@ #define COMSIG_ATOM_ATTACK_PAW "atom_attack_paw" #define COMPONENT_NO_ATTACK_HAND (1<<0) //works on all 3. //This signal return value bitflags can be found in __DEFINES/misc.dm +//from base of atom/movable/on_enter_storage(): (datum/component/storage/concrete/master_storage) +#define COMISG_STORAGE_ENTERED "storage_entered" +//from base of atom/movable/on_exit_storage(): (datum/component/storage/concrete/master_storage) +#define CONSIG_STORAGE_EXITED "storage_exited" ///from base of atom/expose_reagents(): #define COMSIG_ATOM_EXPOSE_REAGENTS "atom_expose_reagents" diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 3d6dcfc3167..a95fc8908fc 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -749,12 +749,12 @@ return blocker_opinion /// called when this atom is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called. -/atom/movable/proc/on_exit_storage(datum/component/storage/concrete/S) - return +/atom/movable/proc/on_exit_storage(datum/component/storage/concrete/master_storage) + SEND_SIGNAL(src, CONSIG_STORAGE_EXITED, master_storage) /// called when this atom is added into a storage item, which is passed on as S. The loc variable is already set to the storage item. -/atom/movable/proc/on_enter_storage(datum/component/storage/concrete/S) - return +/atom/movable/proc/on_enter_storage(datum/component/storage/concrete/master_storage) + SEND_SIGNAL(src, COMISG_STORAGE_ENTERED, master_storage) /atom/movable/proc/get_spacemove_backup() var/atom/movable/dense_object_backup diff --git a/code/game/objects/items/tcg/tcg.dm b/code/game/objects/items/tcg/tcg.dm index 98b8b7efac3..57b0ceb221d 100644 --- a/code/game/objects/items/tcg/tcg.dm +++ b/code/game/objects/items/tcg/tcg.dm @@ -22,7 +22,9 @@ GLOBAL_LIST_EMPTY(cached_cards) /obj/item/tcgcard/Initialize(mapload, datum_series, datum_id) . = ..() - transform = matrix(0.3,0,0,0,0.3,0) + zoom_out() + RegisterSignal(src, COMISG_STORAGE_ENTERED, .proc/zoom_in) + RegisterSignal(src, CONSIG_STORAGE_EXITED, .proc/zoom_out) //If they are passed as null let's replace them with the vars on the card. this also means we can allow for map loaded ccards if(!datum_series) datum_series = series @@ -57,10 +59,16 @@ GLOBAL_LIST_EMPTY(cached_cards) /obj/item/tcgcard/equipped(mob/user, slot, initial) . = ..() - transform = matrix() + zoom_in() /obj/item/tcgcard/dropped(mob/user, silent) . = ..() + zoom_out() + +/obj/item/tcgcard/proc/zoom_in() + transform = matrix() + +/obj/item/tcgcard/proc/zoom_out() transform = matrix(0.3,0,0,0,0.3,0) /obj/item/cardpack @@ -116,7 +124,9 @@ GLOBAL_LIST_EMPTY(cached_cards) /obj/item/cardpack/Initialize() . = ..() - transform = matrix(0.4,0,0,0,0.4,0) + zoom_out() + RegisterSignal(src, COMISG_STORAGE_ENTERED, .proc/zoom_in) + RegisterSignal(src, CONSIG_STORAGE_EXITED, .proc/zoom_out) //Pass by refrance moment //This lets us only have one rarity table per pack, badmins beware if(GLOB.cached_rarity_table[type]) @@ -130,10 +140,16 @@ GLOBAL_LIST_EMPTY(cached_cards) /obj/item/cardpack/equipped(mob/user, slot, initial) . = ..() - transform = matrix() + zoom_in() /obj/item/cardpack/dropped(mob/user, silent) . = ..() + zoom_out() + +/obj/item/cardpack/proc/zoom_in() + transform = matrix() + +/obj/item/cardpack/proc/zoom_out() transform = matrix(0.4,0,0,0,0.4,0) /obj/item/cardpack/attack_self(mob/user)