forked from Sandstorm-Station/Sandstorm-Station-13
-
-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
11 changed files
with
138 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
///Atom that manages and controls multiple planes. It's an atom so we can hook into add_filter etc. Multiple controllers can control one plane. | ||
/atom/movable/plane_master_controller | ||
///List of planes in this controllers control. Initially this is a normal list, but becomes an assoc list of plane numbers as strings | plane instance | ||
var/list/controlled_planes = list() | ||
///hud that owns this controller | ||
var/datum/hud/owner_hud | ||
|
||
///Ensures that all the planes are correctly in the controlled_planes list. | ||
/atom/movable/plane_master_controller/New(hud) | ||
. = ..() | ||
owner_hud = hud | ||
var/assoc_controlled_planes = list() | ||
for(var/i in controlled_planes) | ||
var/atom/movable/screen/plane_master/instance = owner_hud.plane_masters["[i]"] | ||
Check failure on line 14 in code/_onclick/hud/plane_master_controller.dm GitHub Actions / Integration TestsBox Station: /datum/unit_test/create_and_destroy
|
||
if(!instance) //If we looked for a hud that isn't instanced, just keep going | ||
stack_trace("[i] isn't a valid plane master layer for [owner_hud.type], are you sure it exists in the first place?") | ||
continue | ||
assoc_controlled_planes["[i]"] = instance | ||
controlled_planes = assoc_controlled_planes | ||
|
||
// From BeeStation | ||
/atom/movable/plane_master_controller/Destroy() | ||
if(owner_hud) | ||
owner_hud.plane_master_controllers -= src | ||
Check failure on line 24 in code/_onclick/hud/plane_master_controller.dm GitHub Actions / Integration TestsBox Station: /datum/unit_test/create_and_destroy
Check failure on line 24 in code/_onclick/hud/plane_master_controller.dm GitHub Actions / Integration TestsBox Station: /datum/unit_test/create_and_destroy
|
||
controlled_planes.Cut() | ||
return ..() | ||
|
||
///Full override so we can just use filterrific | ||
/atom/movable/plane_master_controller/add_filter(name, priority, list/params) | ||
. = ..() | ||
for(var/i in controlled_planes) | ||
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i] | ||
pm_iterator.add_filter(name, priority, params) | ||
|
||
///Full override so we can just use filterrific | ||
/atom/movable/plane_master_controller/remove_filter(name_or_names) | ||
. = ..() | ||
for(var/i in controlled_planes) | ||
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i] | ||
pm_iterator.remove_filter(name_or_names) | ||
|
||
/atom/movable/plane_master_controller/update_filters() | ||
. = ..() | ||
for(var/i in controlled_planes) | ||
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i] | ||
pm_iterator.update_filters() | ||
|
||
///Gets all filters for this controllers plane masters | ||
/atom/movable/plane_master_controller/proc/get_filters(name) | ||
. = list() | ||
for(var/i in controlled_planes) | ||
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i] | ||
. += pm_iterator.get_filter(name) | ||
|
||
///Transitions all filters owned by this plane master controller | ||
/atom/movable/plane_master_controller/transition_filter(name, time, list/new_params, easing, loop) | ||
. = ..() | ||
for(var/i in controlled_planes) | ||
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i] | ||
pm_iterator.transition_filter(name, time, new_params, easing, loop) | ||
|
||
///Full override so we can just use filterrific | ||
/atom/movable/plane_master_controller/add_atom_colour(coloration, colour_priority) | ||
. = ..() | ||
for(var/i in controlled_planes) | ||
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i] | ||
pm_iterator.add_atom_colour(coloration, colour_priority) | ||
|
||
|
||
///Removes an instance of colour_type from the atom's atom_colours list | ||
/atom/movable/plane_master_controller/remove_atom_colour(colour_priority, coloration) | ||
. = ..() | ||
for(var/i in controlled_planes) | ||
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i] | ||
pm_iterator.remove_atom_colour(colour_priority, coloration) | ||
|
||
|
||
///Resets the atom's color to null, and then sets it to the highest priority colour available | ||
/atom/movable/plane_master_controller/update_atom_colour() | ||
for(var/i in controlled_planes) | ||
var/atom/movable/screen/plane_master/pm_iterator = controlled_planes[i] | ||
pm_iterator.update_atom_colour() | ||
|
||
|
||
/atom/movable/plane_master_controller/game | ||
name = PLANE_MASTERS_GAME | ||
controlled_planes = list(FLOOR_PLANE, GAME_PLANE, WALL_PLANE, ABOVE_WALL_PLANE, LIGHTING_PLANE, EMISSIVE_PLANE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters