# shared

project-wide constants, media registrations, and shared glow infrastructure. loaded before all other core modules.

## purpose

provides the single source of truth for numeric constants, layer indices, color presets, registered media assets (fonts/textures via libsharedmedia), and the unified glow controller that all plugins use for rendering and managing glows.

## files

| file | responsibility |
|---|---|
| Constants.lua | all project constants: colors, layer indices (`C.Levels`), border style definitions (`C.BorderStyle`), cooldown system indices, padding values, glow configurations, aura skin presets. |
| Media.lua | libsharedmedia registrations for custom fonts and textures. |
| Tooltip.lua | `Orbit.Tooltip` — a private `GameTooltipTemplate` frame (`OrbitTooltip`). Every Orbit-owned hover tooltip uses it instead of the global `GameTooltip`. Owning the global tooltip from addon code taints it, which breaks Blizzard's own secret-handling unit-tooltip pipeline (`SetWorldCursor`) in WoW 12.0+. Consumers alias it: `local GameTooltip = Orbit.Tooltip`. |
| WhitelistedSpells.lua | exposes raw category tables (`CLASS_RESOURCES`, `HEALER_AURAS`, `COMBAT_RESES`, etc.) consumed directly by `GroupAuraFilters`. no `IsX` query API. |
| PlayerDummies.lua | unit-frame dummy data for config-panel previews (name, class, health, power). |
| SecretValueUtils.lua | helpers for WoW 12.0+ secret value detection. |
| TooltipParser.lua | tooltip scanning for active duration and cooldown duration extraction. |
| CooldownUtils.lua | icon dimension calculation, skin settings builder. |
| CooldownDragDrop.lua | `Orbit.CooldownDragDrop` — pure cursor → cooldown-ability resolver. cursor unwrap, `HasCooldown`/`IsDraggingCooldownAbility` (secret-value guarded), equipment slot lookup, cursor texture resolve, and saved-data entry builders for `TrackedItems` / `InjectedItems` / `TrackedBarSpell`. no plugin references — consumed by `CooldownManager/ViewerInjection.lua` and the (future) redesigned Tracked plugin. |
| GlowUtils.lua | pure data utility for constructing LibOrbitGlow option tables from DB settings. no frame manipulation. |
| GlowController.lua | single authoritative owner for all glow operations. all consumers call this module — no other file touches LibOrbitGlow directly. handles native blizzard overlay suppression, pandemic wrapper frames, proc glow lifecycle, and centralized state tracking via `frame._orbitGlow`. |
| DropZoneGlow.lua | `Orbit.DropZoneGlow:Attach(zoneFrame, r, g, b, outset)` — wraps a drop-zone frame with a 9-slice atlas glow. visibility is driven by a shared 0.1s ticker that gates on `IsDraggingCooldownAbility()` AND the zone being visible, so Tracked drop zones shown for non-drag reasons (edit mode, settings panel) do not light the glow. glow is at `Background` strata / frame level 0 to render beneath the zone's own textures. outset offsets are pixel-snapped via `Pixel:Multiple`. `outset` accepts a number or a function — CDM uses a function so the glow picks up live `GlobalSettings.BorderSize` on every re-show. shared by CooldownManager viewer injection (green), TrackedContainer drop zones (green, per neighbor-expansion cell), and TrackedBar drop hint (golden yellow). |

## adding a new constant

1. add it to the appropriate section in `Constants.lua`
2. reference it via `Orbit.Constants.YourSection.YourConstant`
3. never duplicate the value inline in another file

## rules

- no executable logic in Constants.lua or Media.lua. only declarations.
- no references to any other module (no `require`, no `Orbit.Engine`) in Constants.lua or Media.lua
- constants must be grouped by domain (colors, layers, cooldown indices, etc.)
- magic numbers found anywhere else in the codebase must be extracted here or to the consuming file's top-level constants
- all glow rendering must go through `GlowController`. never call `LCG.Show`/`LCG.Hide` directly from consumer code

