Files
Bubberstation/code/datums/components
SkyratBot d349b495fb [MIRROR] Replaces bees and hivelord MOUSE_OPACITY_OPAQUE with a component. (#7955)
* Replaces bees and hivelord MOUSE_OPACITY_OPAQUE with a component. (#61032)

I have replaced the mouse opacity setting for bees and hivelord, its brood and legion skulls with a component that adds an almost (has to be 1 alpha to catch the click) invisible underlay to its target that doesn't block the entire turf.
The component prevents the underlay from shrinking or expanding above/below certain boundaries when the attached atom transform matrix is vv'd by an admin or if it's a mob being resized.
The component can be added to any atom, though there's no common signal for when objects are resized.

* Replaces bees and hivelord MOUSE_OPACITY_OPAQUE with a component.

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2021-09-03 22:55:59 +01:00
..
2021-08-08 22:05:10 +01:00
2021-06-09 10:44:59 +12:00
2021-09-03 03:57:29 +01:00
2021-03-07 02:29:00 +00:00

Datum Component System (DCS)

Concept

Loosely adapted from /vg/. This is an entity component system for adding behaviours to datums when inheritance doesn't quite cut it. By using signals and events instead of direct inheritance, you can inject behaviours without hacky overloads. It requires a different method of thinking, but is not hard to use correctly. If a behaviour can have application across more than one thing. Make it generic, make it a component. Atom/mob/obj event? Give it a signal, and forward it's arguments with a SendSignal() call. Now every component that want's to can also know about this happening.

HackMD page for an introduction to the system as a whole.

See/Define signals and their arguments in __DEFINES\components.dm