Native Settings UI Lib
This is a library mod for YAPYAP that lets mod developers seamlessly add custom settings directly into the game’s native Settings UI.
It hooks into the built-in UISettings screen, automatically creates a dedicated tab and section, and provides simple helper APIs for generating common UI controls.
FEATURES
- Integrates directly into YAPYAP’s built-in Settings screen
- Registers a custom tab on the left and a matching content section on the right
- Controls can appear in the main menu, in-game, or both
- Easily create:
- Buttons
- Toggles
- Dropdowns
- Sliders
- Labels
- Input fields
- Built-in Chinese / English switching with automatic refresh on language change
- Safely access UI elements once they actually exist
- Uses settingKey (PlayerPrefs) for automatic value saving and loading
- No replacement of core UI logic; hooks cleanly into existing systems
More detailed overview of Native Settings UI Lib Features
Tab & Section Injection
Registering a tab automatically:
- Adds a tab button to the Settings sidebar
- Creates a matching content section
- Handles tab switching internally via UISettings.sections
No manual wiring needed.
LocalText – Lightweight Localization
LocalText stores Chinese and English variants of a string:
- Displays Chinese when the system language is Chinese
- Displays English for all other languages
- Automatically refreshes when the game language changes
Perfect for bilingual UIs without a full localization pipeline.
UiRef<T> – Deferred UI Access
UI components may not exist at Awake.
Each CreateXxx() method returns a UiRef<T> that:
- Tells you when the real UI object is ready
- Prevents null-reference issues
- Allows safe runtime modification of UI elements
Supported Controls
The library provides helpers to create common settings controls, including:
- Buttons (click actions)
- Labels (localized or runtime-updated text)
- Toggles (boolean settings with persistence)
- Dropdowns (string-based option lists)
- Sliders (integer ranges)
- Input Fields (string input with automatic saving)
All controls support:
- Optional in-game visibility
- Optional size overrides
- Optional fine-tuned position offsets
Persistent Settings (settingKey)
Each control can be bound to a persistent key:
- Automatically loads saved values
- Automatically saves on change
- Uses the game’s settings system (PlayerPrefs)
Requires: BepInEx 5
Made by: XiaohaiMod
How to Install
- Install BepInEx if it is not yet installed.
- Download and unzip the mod to YAPYAP\BepInEx\plugins
If you have any problems installing this or any other mod for YAPYAP, read this guide.




