move filter_data to atoms def, add get_overlays

This commit is contained in:
spookerton
2022-04-12 19:53:23 +01:00
parent 4c9dbff719
commit a930f4eb7c
3 changed files with 35 additions and 5 deletions

View File

@@ -1,8 +1,5 @@
// These involve BYOND's built in filters that do visual effects, and not stuff that distinguishes between things.
// All of this ported from TG.
/atom/movable
var/list/filter_data // For handling persistent filters
/proc/cmp_filter_data_priority(list/A, list/B)
return A["priority"] - B["priority"]

View File

@@ -222,6 +222,32 @@ var/global/image/appearance_bro = new() // Temporarily super-global because of B
else if(cut_old)
cut_overlays()
/**
* Returns a list of overlays that the target atom has
*
* @param priority If true, returns priority overlays as well
* @param special If true, returns special overlays like emissives and em_blockers
*/
/proc/get_overlays(atom/other, priority, special)
var/list/including = list()
if(!other)
return including
for(var/image/I as anything in other.our_overlays)
if(!special && I.plane > 0)
continue
including += I
if(!priority)
return including
for(var/image/I as anything in other.priority_overlays)
if(!special && I.plane > 0)
continue
including += I
return including
#undef NOT_QUEUED_ALREADY
#undef QUEUE_FOR_COMPILE

View File

@@ -26,8 +26,15 @@
///Chemistry.
// Overlays
var/list/our_overlays //our local copy of (non-priority) overlays without byond magic. Use procs in SSoverlays to manipulate
var/list/priority_overlays //overlays that should remain on top and not normally removed when using cut_overlay functions, like c4.
///Our local copy of (non-priority) overlays without byond magic. Use procs in SSoverlays to manipulate
var/list/our_overlays
///Overlays that should remain on top and not normally removed when using cut_overlay functions, like c4.
var/list/priority_overlays
///vis overlays managed by SSvis_overlays to automaticaly turn them like other overlays
var/list/managed_vis_overlays
///Our local copy of filter data so we can add/remove it
var/list/filter_data
//Detective Work, used for the duplicate data points kept in the scanners
var/list/original_atom