Native Settings UI Lib

v1.0.1·Updated 2026-02-14

A utility library that streamlines custom UI creation by auto-injecting tabs and controls directly into the built-in settings menu

About this mod Machine translation

Yap Native Settings UI(Yap_NativeSettingsUI)

Simplified Chinese | English

-: Native_Settings_UI_Lib

  • GitHub: YapYap_Native-Settings-UI-Lib

warehouse structure

  • Library source code: YapYap_Native-Settings-UI-Lib/
  • Usage example (contains all components): YapYap_Native-Settings-UI-Demo/

Change log

  • 2026-02-15
  • Fix UI injection path: adapt new UI structure and object name, add multi-path fallback
  • Update DLL reference HintPath: solve compilation reference path problem
  • New sample project: YapYap_Native-Settings-UI-Demo covers all common controls

Simplified Chinese

A setting interface injection library for YapYap (BepInEx): In the game's own UISettings interface, it automatically creates custom Tabs and Sections, and generates controls such as buttons, switches, drop-downs, sliders, labels, and edit boxes.

This README focuses on the public interface and parameter meanings.

quick start

Typical usage:

var tab = NativeSettingsUI.RegisterTab(

guid: "com.yourmod.settings.tab",

title: new LocalText("TAB_TITLE", "My Settings", "My Settings"),

showInGame: true

);

tab.CreateToggle(

id: "Toggle_Enabled",

settingKey: "com.yourmod.Enabled",

title: new LocalText("ENABLED", "ENABLED", "Enabled"),

initialValue: true,

onChanged: v => enabled = v,

showInGame: true

);

core concepts

  • Tab / Section injection

RegisterTab(...) will automatically:

  • Create a button (Tab) in the left Tab list
  • Create a panel (Section) in the Section area on the right
  • Switch to this Section when clicking Tab (implemented by binding to UISettings.sections)
  • LocalText (simple localized text)

LocalText is used to provide two sets of "Chinese/English" texts:

new LocalText(key: "EXAMPLE", chinese: "中文", english: "English")

  • If you do not plan to make a multi-language UI, you can leave chinese or english blank, but at least provide a non-empty string
  • Display chinese when the current language is Chinese (Chinese/ChineseSimplified/ChineseTraditional)
  • Otherwise display english
  • The library will monitor language changes and automatically refresh the bound text
  • UiRef (delayed acquisition of real UI reference)

The object of UISettings does not exist immediately after Awake, the control will be cloned/created "later".

CreateXxx() returns UiRef:

  • IsReady: Whether the real UI component reference has been obtained
  • Value: real reference (null when not ready)
  • Ready: triggered when a real reference appears

UiRef labelRef = tab.CreateLabel(...);

labelRef.Ready += tmp =>

{

// tmp is the real TMP_Text

};

Public interface: NativeSettingsUI

Namespace: Yap_NativeSettingsUI

RegisterTab

public static SettingsTab RegisterTab(string guid, LocalText title, bool showInGame)

  • guid: the unique identifier of the Tab (it is recommended to use your ModId prefix). Repeated registration with the same guid will return the same Tab
  • title: Tab title (supports Chinese/English switching)
  • showInGame: Whether to also display the Tab in the "settings interface opened in the game" (if the Tab itself is not opened, the control will not be displayed again if it is opened)

BindText / UnbindText

Automatic refresh logic used to bind/unbind LocalText to a certain TMP_Text.

public static void BindText(TMP_Text tmp, LocalText text)

public static void UnbindText(TMP_Text tmp)

Applicable scenarios:

  • You want a certain text to follow language changes: use BindText
  • You want to change a certain tag to "runtime dynamic text" so that it will no longer be overwritten by localized refresh: UnbindText first and then tmp.text =...

Public interface: SettingsTab (create control)

RegisterTab(...) returns the SettingsTab on which all controls are created.

General parameter description

The following parameters are available in most controls:

  • id
  • Control object name (used to find/avoid duplicate creation)
  • It is recommended to keep it unique, for example: "Toggle_Enabled", "Button_Save"
  • showInGame
  • Whether the control is displayed in the "In-Game Settings Interface"
  • …

Install & use Install: follow the bundled instructions

  1. Unzip the archive from playbuff and read the bundled readme / instructions first.
  2. Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
  3. For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
  4. Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.

Install locations vary a lot between mods — the bundled readme is the most reliable guide.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack

File & checksum

Filename
Native_Settings_UI_Lib-1.0.1.zip
File size
160.6 KiB