[MIRROR] Adds a signal for storage exit and insert, uses it to make trading cards zoom properly (#285)

* Adds a signal for storage exit and insert, uses it to make trading cards zoom properly (#52737)

* Adds a signal for storage exit and insert, uses it to make trading cards shirk properly

* Adds storage param

* Adds a signal for storage exit and insert, uses it to make trading cards zoom properly

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-08-11 22:45:55 +02:00
committed by GitHub
co-authored by LemonInTheDark
parent b7b32cb604
commit 0fe96ab3c3
3 changed files with 28 additions and 8 deletions
+20 -4
View File
@@ -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)