How illusionmods/kkmanager works
1. Overall shape
- KKManager is a multi-project .NET desktop solution centered on a WinForms-style GUI.
- The main application is KKManager, with reusable domain and UI infrastructure in KKManager.Core.
- Two side projects extend the toolchain: KKManager.Updater handles online update operations, and StandaloneUpdater is a separate bootstrap executable for replacing files outside the main process.
2. Top-level application shell
- KKManager/Program.cs starts the desktop app and opens MainWindow.
- The main window hosts the primary navigation into “content” areas for cards, plugins, sideloader mods, and sardine mods.
- Most user actions flow through modal dialogs and tool windows such as path selection, rename cards, log viewer, and property inspectors.
3. Core UI and shared controls
- KKManager.Core contains reusable WinForms controls and dialogs, including logging and process-wait UI.
- These are shared across the main app and updater so the UI behavior is consistent for progress reporting, waiting on external processes, and logging.
- The Controls, Util, and Windows-style components act as the presentation-layer foundation.
4. File-system centered domain model
- The app is built around local game folders, installed mods, plugins, and card files rather than a server-backed database.
- Common abstractions like IFileInfoBase and ModInfoBase model discovered files and installed assets.
- PathTools, InstallDirectoryHelper, and related utilities indicate that path discovery and filesystem normalization are central concerns.
5. Game content parsing
- A large portion of KKManager.Core/Data/Cards is devoted to parsing different card formats for multiple Illusion games.
- Each game family has its own subfolder and model types: AI, KK, KKS, EC, HC, RG, SVS, AC.
- CardLoader, Card, UnknownCard, and CardType provide the common entry point and type discrimination, while per-game classes deserialize the game-specific payloads.
6. Installed mod and plugin inventory
- Data/Zipmods, Data/Plugins, and Data/Sardines represent the supported installed-package formats the app can browse and inspect.
- Sideloader mods have manifest/version handling, migration metadata, and custom version comparison logic.
- Plugin metadata and “sardine” mod metadata are loaded separately, then surfaced in the main content windows and property viewers.
7. External-data extraction
- Data/ExtData parses embedded side-loaded metadata using pluggable deserializers.
- This is the boundary where raw archive or file content is converted into richer mod metadata.
- The design suggests the app can inspect files without fully installing them, which is important for browsing and update detection.
8. Update pipeline
- KKManager.Updater is a distinct subsystem responsible for discovering, downloading, and applying updates.
- UpdateSourceManager coordinates multiple backend source types: FTP, Mega, S3, torrent, and ZIP-based update sources.
- The update flow is modeled in Data/UpdateInfo, UpdateItem, UpdateTask, and downloader status types, then executed through UpdateDownloadCoordinator.
9. Installation and repair actions
- Functions/ModInstaller, ZipmodTools, and SelfUpdater show that the app can not only identify updates but also apply them locally.
- DeleteFileUpdateItem and migration-related types imply the updater can handle destructive or transform-style changes, not just additive downloads.
- ModInstaller is the bridge between discovered update content and changes to the game directory.
10. User-facing tool windows
- The main app includes dedicated windows for browsing cards, sideloader mods, plugins, and sardine mods.
- Property tool windows provide type-specific inspection, with separate viewers for cards, plugins, sardines, and generic objects.
- This is where parsed metadata from the core layer becomes actionable UI.
11. Modpack tooling
- KKManager/ModpackTool is a separate in-app utility for creating, editing, and verifying modpack-related structures.
- It includes processors, validators, manifest editors, and verification windows.
- This subsystem operates on zipmod entry data and configuration objects, so it sits between raw archive contents and update/distribution metadata.
12. SB3UGS integration
- KKManager.SB3UGS appears to be an adapter or initializer layer for the bundled SB3UGS tooling in src/libs/SB3UGS.
- The bundled binaries and plugin XML suggest the app can reuse external utility executables for game asset or model-related operations.
- This is a clearly separated integration boundary rather than a core dependency of the main manager logic.
13. Cross-cutting concerns
- Localization is pervasive: most UI forms have .resx files for Japanese, Russian, Simplified Chinese, and Traditional Chinese.
- LanguageManager, Resources, and generated resource classes indicate the UI text and some dialog content are localized.
- Logging is also first-class, with shared log controls and log viewer windows.
14. Build, release, and validation
- The solution includes CI via GitHub Actions, a release script, and a small Tests project.
- The tests currently focus on version comparison behavior, which is important because update selection depends on correct semver-like ordering.
- PortableSettingsProvider is a small support project, likely for user settings persistence across installs.
15. How data flows through the system
- The typical flow is: detect local game/install paths → scan files on disk → parse cards/mods/plugins into domain models → present them in the UI → optionally fetch updates from remote sources → download/apply changes → refresh the local inventory view.
- The architecture is therefore centered on local filesystem state plus remote update metadata, with the UI as a thin orchestrator over parsing, update, and install services.
Main entry points: MainWindow.cs Main Window · Data Mod Metadata · ToolWindows Tool Windows · Functions File Tools
Components 19
Main app
Primary desktop shell and user-facing content windows.
- Program · Starts the desktop application and opens the main window.
src/KKManager/Program.cs - Main Window · Primary WinForms shell and navigation hub.
src/KKManager/Windows/MainWindow.cs - Content Views · Browsers for cards, plugins, sideloader mods, and sardine mods.
src/KKManager/Windows/Content - Tool Windows · Log viewer and property inspectors for parsed domain objects.
src/KKManager/Windows/ToolWindows - Dialogs · Path selection, rename, and other task-focused dialogs.
src/KKManager/Windows/Dialogs
Core library
Shared parsing, filesystem, and UI infrastructure.
- Shared UI · Reusable controls, loading UI, process wait UI, and log display.
src/KKManager.Core/Controls - File Tools · Path discovery, install directory handling, process helpers, and installer actions.
src/KKManager.Core/Functions - Card Parsers · Common card abstractions plus per-game parsers for multiple Illusion game families.
src/KKManager.Core/Data/Cards - Mod Metadata · Sideloader, plugin, and sardine loaders for installed-package browsing.
src/KKManager.Core/Data - Ext Data · Pluggable deserializers for embedded sideloader metadata.
src/KKManager.Core/Data/ExtData - Localization · Language manager and localized resource sets used across UI.
src/KKManager.Core/Properties
Updater
Remote update discovery, download, and apply pipeline.
- Updater App · Standalone updater runtime for fetching and applying updates.
src/KKManager.Updater - Update Sources · FTP, Mega, S3, torrent, and ZIP-backed update source implementations.
src/KKManager.Updater/Sources - Update Flow · UpdateInfo, UpdateItem, UpdateTask, and download status coordination.
src/KKManager.Updater/Data - Download Coordinator · Orchestrates source selection, transfers, and download state.
src/KKManager.Updater/Downloader
Tooling
In-app utilities and bootstrap executables.
- Modpack Tool · In-app workflow for creating, editing, and verifying modpack data.
src/KKManager/ModpackTool
Support
Build, tests, settings, and bundled external tooling.
Connections 24
- Program → Main Window: opens · Application startup creates the primary shell.
- Main Window → Content Views: navigates to · Main shell hosts the content browsing views.
- Main Window → Tool Windows: opens · Main shell launches inspection and log tool windows.
- Main Window → Dialogs: uses · Main shell invokes modal dialogs for focused actions.
- Content Views → Card Parsers: reads · Content windows render parsed card inventories.
- Content Views → Mod Metadata: reads · Content windows render installed mod and plugin inventories.
- Tool Windows → Mod Metadata: inspects · Property viewers show parsed metadata objects.
- Tool Windows → Card Parsers: inspects · Card viewer presents parsed card details.
- Tool Windows → Shared UI: shares · Tool windows reuse shared logging and waiting controls.
- Dialogs → File Tools: operates on · Dialogs support path selection and filesystem-based actions.
- Modpack Tool → Mod Metadata: processes · Modpack tooling works over zipmod entries and manifests.
- Modpack Tool → File Tools: verifies · Tooling validates archive and configuration structures.
- Updater App → Update Sources: loads · Updater selects among remote source adapters.
- Updater App → Update Flow: models · Updater uses task and item models to describe work.
- Updater App → Download Coordinator: executes · Downloader coordinates transfer and status reporting.
- Download Coordinator → Update Sources: pulls from · Coordinator fetches data through source implementations.
- Download Coordinator → Update Flow: updates · Download state is reflected in update tasks and statuses.
- Update Sources → File Tools: applies to · Update sources eventually modify local files through installer flows.
- Mod Metadata → Ext Data: parses with · Mod loaders extract embedded metadata through extension parsers.
- Shared UI → Localization: localizes with · Shared controls and dialogs use translated resources.
- Main Window → Localization: localizes with · Main UI strings are resource-driven.
- File Tools → SB3UGS: integrates with · File and asset workflows can hand off to bundled tooling.
- Tests → Mod Metadata: checks · Tests validate sideloader version comparison behavior.
- Settings → Main Window: persists · Settings support desktop user preferences and state.