How beligal/mtga-enhancement-suite works
MTGA Enhancement Suite is a local BepInEx mod extending Magic: The Gathering Arena. The principal workflow is: a player invokes an in-game deck or match feature, Harmony/UI integration dispatches to a feature controller, which reads or mutates Arena state and persists local results. Replays additionally export self-contained HTML consumed by the bundled React viewer. The tree and excerpts establish these major capabilities; some feature-to-UI wiring is represented at directory level because its implementations were not sampled.
Components 27
Arena Integration
- Plugin Entry
Plugin/Plugin.cs - Harmony Patches
Plugin/Patches - Game References
Plugin/GameRefs.cs
Deck Management
- Deck UI
Plugin/UI - Card Presets
Plugin/Features/CardPresetManager.cs - Deck Import
Plugin/Features/DeckImportManager.cs - Deck Organization
Plugin/Features/DeckOrganizationManager.cs - Local Decks
Plugin/Features/LocalDeckController.cs - Deck Name Styling
Plugin/Features/DeckNameController.cs
Matches and Replays
- Match Statistics
Plugin/Features/MatchStatsStore.cs - Match Recorder
Plugin/Features/MatchRecorder.cs - Replay Recorder
Plugin/Features/ReplayRecorder.cs - Replay Exporter
Plugin/Features/ReplayExporter.cs - Replay HTML
Plugin/Features/ReplayHtml.cs
Local Persistence
- Mod Settings
Plugin/State/ModSettings.cs - Local Deck Store
Plugin/Features/LocalDeckStore.cs - Replay Files
Plugin/Features/ReplayFiles.cs
Replay Viewer
- Viewer Entry
viewer/src/main.tsx - Replay App
viewer/src/App.tsx - Replay Adapter
viewer/src/adapter/replayAdapter.ts - Replay Controls
viewer/src/phase/ReplayControls.tsx - Replay Board
viewer/src/components/Battlefield.tsx - Card Images
viewer/src/services/cardImage.ts
Other components
- Player
- Arena Client
- Web Browser
- Update Repository
Connections 32
- Player → Deck UI: uses features
- Player → Match Statistics: opens statistics
- Player → Replay Exporter: opens replays
- Plugin Entry → Harmony Patches: registers patches
- Harmony Patches → Game References: accesses Arena
- Game References → Arena Client: reads game state
- Deck UI → Card Presets: dispatches preset
- Deck UI → Deck Import: dispatches import
- Deck UI → Deck Organization: dispatches organization
- Deck UI → Local Decks: dispatches local deck
- Deck UI → Deck Name Styling: opens name editor
- Card Presets → Arena Client: reads deck model
- Card Presets → Mod Settings: saves presets
- Deck Import → Arena Client: reads source decks
- Deck Import → Arena Client: inserts cards
- Deck Organization → Mod Settings: persists folders
- Local Decks → Local Deck Store: reads and writes
- Local Decks → Arena Client: opens editor
- Deck Name Styling → Arena Client: updates deck name
- Match Recorder → Match Statistics: records matches
- Match Recorder → Replay Recorder: records replay
- Replay Recorder → Replay Files: writes recording
- Replay Exporter → Replay Files: reads recording
- Replay Exporter → Replay HTML: creates HTML
- Replay HTML → Web Browser: opens replay
- Web Browser → Viewer Entry: loads page
- Viewer Entry → Replay App: mounts app
- Replay App → Replay Adapter: adapts replay
- Replay App → Replay Controls: renders controls
- Replay App → Replay Board: renders battlefield
- Replay Board → Card Images: loads card art
- Plugin Entry → Update Repository: checks updates