reflection 
A simple-ish component that reflects the icons of movables on the parent like a mirror. Sadly, there's no easy way to make the SOUTH dir reflection flip the visual so that you can see the back NORTH dir of a target while it's facing SOUTH beside adding the VIS_INHERIT_DIR flag to the target movable, which I'm not doing to spare eventual issues with other vis overlays in the future.
Vars | |
alpha | the transparency channel value of the reflection holder. |
---|---|
can_reflect | A callback used check to know which movables should be reflected and which not. |
check_reflect_signals | List of signals registered on reflected atoms to update their reflections. |
reflected_dir | The direction from which the component gets its visual overlays. The visuals are also flipped horizontally or vertically based on it. |
reflected_movables | A lazy assoc list that keeps track of all movables in range that either could be reflected or are reflected. |
reflection_filter | the filter data added to reflection holder. |
reflection_holder | the movable which the reflected movables are attached to, in turn added to the vis contents of the parent. |
reflection_matrix | the base matrix used by reflections |
update_signals | A list of signals that when sent to the parent, will force the comp to recalculate the reflected movables. |
Procs | |
Initialize | Init Args |
check_can_reflect | Checks if the target movable can be reflected or not. |
copy_appearance_to_reflection | Handles updating the appearance of the reflection to match the target movable. |
get_reflection_targets | Unsets the old reflected movables and sets it with new ones. |
on_dir_change | Called when the parent changes its direction. |
on_movable_entered_or_initialized | Called when a movable enters a turf within the connected range |
on_movable_exited | Called when a movable exits a turf within the connected range |
set_reflection | Turns the allowed reflected direction alongside the parent's dir. then calls get_reflection_targets. |
update_reflection | Called when the target movable changes its appearance or dir. |
Var Details
alpha 
the transparency channel value of the reflection holder.
can_reflect 
A callback used check to know which movables should be reflected and which not.
check_reflect_signals 
List of signals registered on reflected atoms to update their reflections.
reflected_dir 
The direction from which the component gets its visual overlays. The visuals are also flipped horizontally or vertically based on it.
reflected_movables 
A lazy assoc list that keeps track of all movables in range that either could be reflected or are reflected.
The key is the movable, and the value is the reflection object (or null - the reflection object is also lazy loaded).
reflection_filter 
the filter data added to reflection holder.
reflection_holder 
the movable which the reflected movables are attached to, in turn added to the vis contents of the parent.
reflection_matrix 
the base matrix used by reflections
update_signals 
A list of signals that when sent to the parent, will force the comp to recalculate the reflected movables.
Proc Details
Initialize
Init Args
- set_reflected_dir: Optional: What dir to reflect. If not provided, uses (and updates to) the parent's dir.
- reflection_filter: Optional: A list of filters to apply to the reflection.
- reflection_matrix: Optional: A matrix to apply as the transform of the reflection.
- can_reflect: Optional: A callback to check if a movable should be reflected.
- alpha: The transparency of the reflection holder.
- update_signals: Optional: Additional signals to provide to update_signals (to check for when to recalculate all reflections).
- check_reflect_signals: Optional: Additional signals to provide to check_reflect_signals (to check for when to update a single reflection).
check_can_reflect
Checks if the target movable can be reflected or not.
copy_appearance_to_reflection
Handles updating the appearance of the reflection to match the target movable.
get_reflection_targets
Unsets the old reflected movables and sets it with new ones.
on_dir_change
Called when the parent changes its direction.
on_movable_entered_or_initialized
Called when a movable enters a turf within the connected range
on_movable_exited
Called when a movable exits a turf within the connected range
set_reflection
Turns the allowed reflected direction alongside the parent's dir. then calls get_reflection_targets.
update_reflection
Called when the target movable changes its appearance or dir.