Pretty Unity uGUI + input toolkit for mods, extracted from Overlayer v5!
Tip
Using an AI coding agent with O5Kit? Point it at llms.txt (consumer API + copy-paste mod template) and AGENTS.md (build/IL2CPP invariants).
- Clone O5Kit (with submodules if building optional LitMotion support):
git clone --recurse-submodules <this-repo-url>
- Copy
Directory.Build.example.propstoDirectory.Build.propsand fill in your game or siblingO5Devpaths (GamePath/GameData, andIl2CppPath/Il2CppDatafor IL2CPP). - Build the configuration that matches your game (emits
O5Kit.{major}.{minor}.dlland XML docsO5Kit.{major}.{minor}.xml, e.g.O5Kit.1.1.dll):dotnet build src/O5Kit/O5Kit.csproj -c Release_Mono dotnet build src/O5Kit/O5Kit.csproj -c Release_IL2CPP
- Unit tests (no Unity player needed; uses
UnityEngine.CoreModule.dllfrom theGamePathset in step 2 for type layout only):./test.sh
- Optional native math library (needs
zig0.17+):./native/build.sh(./native/build.sh x86_64-windowsto cross). Output lands innative/zig-out/libasO5KitNative.<os>.<ext>. The native C ABI (o5_*) is frozen — additive only, gated byo5_abi_version— because all mods share one loaded copy (first-win). Managed binding resolves symbols explicitly from the loaded handle and falls back to C# when unavailable.
- Create an isolated
O5Context: Every consumer owns its own context (no shared statics across mods). Bundled sprites, scale-aware shape rasterizer, SUIT/JetBrains Mono fonts, and GTweens fallback work out of the box when optional parameters are omitted:var ctx = new O5Kit.Core.O5Context( config: new O5Kit.Core.O5Config { UIScale = 1f }, theme: O5Kit.Core.O5Theme.Overlayer // or O5Theme.Dark / O5Theme.Light );
- Theme: swap presets or derive single-hue monochrome variants with
O5Palette.FromMonochrome(...):Live controls update viactx.SetTheme(O5Kit.Core.O5Theme.Dark with { PanelBG = new Color(0.1f, 0.1f, 0.15f, 1f) });
ThemeTransitioned/ThemeChanged. - Fonts: load custom font files (missing slots fall back gracefully):
var ctx = new O5Kit.Core.O5Context(fonts: new O5Kit.Core.FileFontProvider(regularBytes, mediumBytes, monoBytes));
- Create controls: Use
O5Kit.Factory.O5Factorywith*Optionsor inline configure lambdas:Available controls:var btn = O5Kit.Factory.O5Factory.Button(ctx, row, "btn_hello", o => { o.Text = "Hello"; o.OnClick = () => MelonLogger.Msg("Clicked"); });
Button,Toggle,Slider,Input,DropDown<T>,MultiDropDown<T>,Segmented<T>,ColorPicker,Card,ScrollView, andO5SpriteEditor. - Windows: Use
O5Kit.Core.O5WindowManager(wrapsO5Canvas+O5ColorSpaceLinear/Gamma color parity +O5ShapeSpritesscale tracking). Visibility and open/close animation are yours (CloseRequestedfires when X is clicked):var windows = O5Kit.Core.O5WindowManager.Create(ctx, modRoot); var win = windows.Create(new O5Kit.Core.O5WindowOptions { Title = "Hello", Resizable = true }); win.CloseRequested += w => w.Rect.gameObject.SetActive(false); win.Rect.gameObject.SetActive(true); var (_, content, _) = O5Kit.Factory.O5Factory.ScrollView(ctx, win.Content, spacing: 8f);
- Tick every frame: Pump live controls, scale-aware sprites, tooltips, and shortcuts from
OnUpdate:O5Kit.Core.O5Object.TickAll(); ctx.Shapes.Tick(windows.Canvas.Canvas.scaleFactor); ctx.Tooltip.Tick(); O5Kit.Input.O5ShortcutManager.HandleUpdate();
- Hotkeys: register named shortcuts (press + optional hold):
O5Kit.Input.O5ShortcutManager.Register( "toggle", new O5Kit.Input.O5KeyCombo(KeyCode.BackQuote, KeyCode.LeftAlt), holdSeconds: 0.4f, onPressed: _ => Toggle(), onHeld: _ => Reset());
Note
O5Kit targets netstandard2.0 (Mono, Unity 2020.3+) and net6.0 (IL2CPP). *_IL2CPP configurations define IL2CPP and alias TMPro to Il2CppTMPro. In UserLibs/ on IL2CPP, MelonLoader does not scan [RegisterTypeInIl2Cpp]; new O5Context(...) registers all 7 O5Kit.Behaviour types automatically (see llms.txt).
Mono reference assemblies must target netstandard 2.0. Unity 2021.2+ Managed/ folders (including O5Dev's Unity 6 build) reference netstandard 2.1 and fail with CS1705; O5Kit picks $(GamePath)/CompatManaged (created by o5dev mod mono) automatically when present, or set ManagedRefPath to a netstandard 2.0 reference folder.
The game (Mono) loads a single assembly per simple name. Unsigned DLLs ignore versions too, so two O5Kit.dll files with different contents mean only the first-loaded one wins and the other mod dies with MissingMethodException/TypeLoadException. Same on UMM / MelonLoader / BepInEx.
Rule: put the version in the assembly name; mods on the same version share one copy. Renaming by version, not by mod, so 100 mods still mean only as many runtime copies as versions. The name is O5Kit.{major}.{minor} — patch excluded, drop-in replacement.
dotnet build src/O5Kit/O5Kit.csproj -c Release_Mono
# output: O5Kit.1.1.dll + O5Kit.1.1.xml for <Version>1.1.x (name auto-derived, namespaces stay O5Kit)- Mods referencing the same
O5Kit.{major}.{minor}share the first-loaded copy. Type identity is shared (mod-to-mod type exchange works), statics are shared (any mod pumpingTickAll()drives everything). Each mod ships the same file in its own folder (disk duplication only; single runtime load). - Different versions (
O5Kit.1.0vsO5Kit.1.1) load side by side. Old mods are untouched; only new mods use the new version. - Version policy: major/minor bumps move the assembly name along. Patch (1.0.0 -> 1.0.1) keeps the name, drop-in. Any minor-or-above change gets a new name. Because each name is isolated at runtime, a minor release may contain source-breaking API changes; see
CHANGELOG.mdbefore recompiling against a new minor. - Special cases (private fork, version pin): per-mod rename via
-p:O5KitAssemblyName=MyMod.O5Kit. - Mono API caution: netstandard references are not the game Mono. Only use APIs that actually exist in the game's
Managedfolder. (Example:IReadOnlyList<T>.ContainswithoutSystem.Linqbinds to netstandard'sMemoryExtensionsSpan overload and blows up at runtime.) - Native (
O5KitNative.*) is process-wide first-win shared + frozen ABI +o5_abi_versiongate, so its file names stay as-is (no rename needed). - LGPL: ship
LICENCE.md+ an O5Kit source link alongside the DLL.
O5Kit powers the settings UI of Overlayer v5. Overlayer consumes this library and keeps all game-specific logic (FxValue, tags, modules) on its own side.
Note
O5Kit is a library and cannot run standalone. Reference it from your mod and use O5Context + O5WindowManager.
- O5Kit is licensed under LGPL-3.0-or-later.
- SPDX-License-Identifier:
LGPL-3.0-or-later - Copyright (C) 2026 modlist-org contributors.
- The O5Kit logo is a placeholder.
o5kit_logo.svgat the repository root will be replaced with the final logo before the first release.
- O5Kit bundled UI shapes and icons (
src/O5Kit/Asset/Image,src/O5Kit/Asset/Icons) were created directly by the Overlayer team. Because they are simple geometric shapes, they are free for anyone to use, modify, or redistribute for any purpose without restriction (attribution is not required, though crediting the Overlayer team is greatly appreciated; seeNOTICE.md). - O5Kit bundled fonts (SUIT, JetBrains Mono) under OFL-1.1. Licence texts:
OFL-SUIT.txt,OFL-JetBrainsMono.txt.
- LitMotion: Submodule under
lib/LitMotion, compiled from source (Runtime only)- License: MIT
- GTweens: Submodule under
lib/GTweens, used as the built-in tween backend (O5Kit.Core.GTweenRunner, picked byAutoTweenRunnerwhen LitMotion is unavailable). Built from a patched snapshot embedded undersrc/O5Kit/ThirdParty/GTweens(see itsREADME.mdfor the deviations)- License: MIT
- UniverseLib: Parts of input handling logic in
src/O5Kit/Inputare referenced and derived from UniverseLib.- License: LGPL-2.1
- Unity assemblies (UnityEngine, Unity.Burst/Collections/Mathematics, TextMeshPro) are referenced from the game install and are not redistributed.
- All other external dependencies are managed and imported via NuGet.
Note
O5Kit is currently under active development!