Skip to content
modlist-orgPublic

About

Pretty Unity uGUI + input toolkit for mods, extracted from Overlayer v5

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

O5Kit

O5Kit Logo

⟡ Pretty controls for every mod. ⟡

Pretty Unity uGUI + input toolkit for mods, extracted from Overlayer v5!

🛠️ Installation

📦 From source

Important

You must clone with submodules. Without them the build fails at CheckLitMotion.

  1. Clone with submodules (or init them afterwards):
    git clone --recurse-submodules <this-repo-url>
    # or: git submodule update --init --depth 1
  2. Copy Directory.Build.example.props to Directory.Build.props and fill in your game paths (GamePath/GameData, optionally Il2CppPath/Il2CppData).
  3. Build the configuration that matches your game:
    dotnet build src/O5Kit/O5Kit.csproj -c Release_Mono
    dotnet build src/O5Kit/O5Kit.csproj -c Release_IL2CPP
  4. Native math lib (needs zig 0.17+): ./native/build.sh (./native/build.sh x86_64-windows to cross). Output lands in native/zig-out/lib as O5KitNative.<os>.<ext>.

⌨️ Usage

Setup

  • Configure once: Call O5Boot.Configure(...) at startup with your O5Config, O5Theme, ISpriteProvider, IFontProvider. The tween backend defaults to AutoTweenRunner: LitMotion first (compiled-in on IL2CPP, game-shipped via reflection otherwise — always probed before use, never throws), then the built-in GTweens backend.
    O5Kit.Core.O5Boot.Configure(
        config: new O5Kit.Core.O5Config { UIScale = 1f },
        sprites: new MySpriteProvider(),
        fonts: new MyFontProvider());
  • Or zero-setup: O5Kit.Core.O5Boot.EnsureDefaults() installs bundled artwork, fonts and the built-in tween backend. No adapters needed to try controls.
  • Theme: swap presets or derive your own at runtime:
    O5Kit.Core.O5Boot.SetTheme(O5Kit.Core.O5Theme.Dark with { PanelBG = new Color(0.1f, 0.1f, 0.15f, 1f) });
    Applies to subsequently created controls; rebuild UI to restyle. Presets: Dark, Light, Overlayer.
  • Fonts: load custom font files (missing slots fall back gracefully):
    O5Kit.Core.O5Boot.Configure(fonts: new O5Kit.Core.FileFontProvider(regularBytes, monoBytes));
  • Create controls: Use O5Kit.Factory.O5Factory (e.g. Button(parent, onClick, "Hello", "btn_hello")) or instantiate controls (O5Button, ...) directly.
  • Windows: Use O5Kit.Core.O5WindowManager for multi-window UI. O5Kit manages structure and z-order; visibility and open/close animation are yours (the close button raises CloseRequested instead of closing):
    var windows = O5Kit.Core.O5WindowManager.Create(modRoot);
    var win = windows.Create(new O5Kit.Core.O5WindowOptions { Title = "Hello", Icon = null });
    win.CloseRequested += w => w.Rect.gameObject.SetActive(false);
    win.Rect.gameObject.SetActive(true);
    var row = O5Kit.Factory.O5Factory.Row(win.Content);
  • Tick every frame: Call O5Kit.Core.O5Object.TickAll() and O5Kit.Core.O5Tooltip.Tick() from your update loop.
  • Hotkeys: register named shortcuts (press + optional hold) and pump them:
    O5Kit.Input.O5ShortcutManager.Register("toggle", new O5Kit.Input.O5KeyCombo(KeyCode.BackQuote, KeyCode.LeftAlt), 0.4f, onPressed: _ => Toggle(), onHeld: _ => Reset());
    Pump with O5ShortcutManager.HandleUpdate() each frame; gate with IsSuspended. Combos stay rebindable via Get(id).Combo.

Note

O5Kit targets netstandard2.1 (Mono) and net6.0 (IL2CPP). *_IL2CPP configurations define the IL2CPP symbol automatically, which enables the MelonLoader/Il2CppInterop code paths (RegisterTypeInIl2Cpp, DelegateSupport, TryCast — same pattern as Overlayer's ML && IL2CPP blocks). IL2CPP builds reference the MelonLoader/net6 assemblies via GamePath. IL2CPP support is implemented for the future; it has not been verified against an IL2CPP game yet.

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 provide the resource adapters.

⚖️ Licenses

O5Kit

  • O5Kit is licensed under LGPL-3.0-or-later.
  • SPDX-License-Identifier: LGPL-3.0-or-later
  • Copyright (C) 2026 modlist-org contributors.

Logo

  • The O5Kit logo is a placeholder. o5kit_logo.svg at the repository root will be replaced with the final logo before the first release.

Artwork

  • O5Kit bundled UI shapes and icons (src/O5Kit/Asset) are modlist-org's own artwork, canonical here and consumed by Overlayer from O5Kit (see NOTICE.md). Same license terms as O5Kit (LGPL-3.0-or-later).
  • O5Kit bundled fonts (SUIT, JetBrains Mono) under OFL-1.1.

Third-Party Code

  • LitMotion: Submodule under lib/LitMotion, compiled from source (Runtime only)
  • GTweens: Submodule under lib/GTweens, used as the built-in tween backend (O5Kit.Core.GTweenRunner, picked by AutoTweenRunner when LitMotion is unavailable). Built from a patched snapshot embedded under src/O5Kit/ThirdParty/GTweens (see its README.md for the deviations)
  • UniverseLib: Parts of input handling logic in src/O5Kit/Input are referenced and derived from UniverseLib.
  • 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!

About

Pretty Unity uGUI + input toolkit for mods, extracted from Overlayer v5

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages