Files
Paradise/code/_onclick/hud/plane_master_controller.dm
RomainzZ e386cfd9bf Lamp Bloom, Exposure and Glare (#24534)
* Light Update

* Not failing tests I hope

* Whitespace Removal

* Tweaking here and there

* Merge Conflict Fix

* Rebuild TGUI Bundle to Fix Merge Conflict

* Settings are now in "Game Preferences" too

* ColorMatrix formatting and removal of unused procs

* A little mistake on matrices

* A little mistake x2 (last I hope)

* Moving Glare under every other effect, tweaking values, playing with blending

* Update TGUI Bundle for Merge Conflict

* Apply suggestions from code reviews

* Fuck it, it just works

* No tabs cool

* Remove unused

* Am I retarded

* We better return

* Whitespace we need

* oh

* New SQL update version

* Missing comma fix and recompiled tgui.bundle

* Updating SQL version in misc_defines and config

* Remove datum in holder

* BloomEdit empty lines removal

* No more unneeded functions calls

* Tgui.bundle rebuild

* SQL Changes

* SQL Version = 56 now

* Documentation and some formatting

* tgui.bundle.js rebuild

* Remove unused layers and variables

* Allow cameras to render backdrops

* Possible runtime issue fix

* Remove "baked" bloom from the lamps

* Revert the "remove". Make it low on alpha channel

* Shuttle rotation light update fix

* We don't need this

* Possible runtime issue fix x2

* tgui.bundle.js update

* tgui.bundle.js update

* tgui.bundle.js update

* Revert config.toml changes

* Revert the revertion of config.toml changes

* Bring that config changes back!

* Entry added

* tgui.bundle.js update

* Prettier possible fix (?)

* Runtime fix (and broken tubes now have light after reinstalling them)

* config update

---------

Co-authored-by: Mikhail Dzianishchyts <mikhail.dzianishchyts@gmail.com>
2024-07-05 21:16:16 +00:00

88 lines
3.4 KiB
Plaintext

///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]"]
assoc_controlled_planes["[i]"] = instance
controlled_planes = assoc_controlled_planes
///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,
LIGHTING_PLANE,
PLANE_SPACE_PARALLAX,
PLANE_SPACE,
LIGHTING_EXPOSURE_PLANE,
LIGHTING_LAMPS_SELFGLOW,
LIGHTING_LAMPS_PLANE,
LIGHTING_LAMPS_GLARE
)