Skip to content

Settings meta

Tom_XV edited this page Sep 23, 2026 · 3 revisions

English | 日本語

Experimental. This came in with core 1.2.0 (framework 1.2.0).

The Mods screen (Options → Mods → your mod → Settings) shows every BepInEx config entry a mod has. With SettingMeta and SectionMeta from the core (DragNWash.ModFramework) you can tell it how to show them: a display name, an order, whether an entry is advanced and whether a change needs a restart. Sections get the same kind of options. None of this is required. Without them, the page just lists the entries by section and key.

Use

Put an instance in the tags of the entry's ConfigDescription, like this:

_watch = Config.Bind("Reload", "WatchFiles", false,
    new ConfigDescription("Reloads a PNG when it changes on disk.", null,
        new SettingMeta { DisplayName = "Watch texture files", Advanced = true, Order = 20 },
        new SectionMeta { DisplayName = "Reloading", Description = "Only while developer tools are on.", Order = 10 }));

_size = Config.Bind("Fonts", "AtlasPointSize", 72,
    new ConfigDescription("How sharp fallback glyphs are.", new AcceptableValueRange<int>(24, 160),
        new SettingMeta { Advanced = true, RequiresRestart = true }));

SettingMeta

Property What the page does
string DisplayName Shown instead of the config key
int Order Position within the section, lowest first; ties keep the key order
bool Advanced Hidden until the player turns on Show advanced settings at the top of the page (the row appears only when a mod has an advanced entry)
bool RequiresRestart "Takes effect after the game restarts." is added under the description

SectionMeta

Put it in the tags of any one entry in that section. It applies to whichever section that entry belongs to.

Property What the page does
string DisplayName Shown instead of the section name
string Description Shown under the section heading
int Order Position among the sections, lowest first; ties keep the name order

Without a reference to the framework

The page reads the tags by member name, so any object with the same members works. That includes ConfigurationManager's attributes: IsAdvanced, DispName and Order are read the same way as Advanced, DisplayName and Order. If your mod already has ConfigurationManager attributes on its entries, you don't need to change anything.

What the Settings tab can edit

Each setting is a row on the mod's Settings tab, with its name and description on the left and its control on the right (1.5.0). The control depends on the entry's type:

  • A bool gets a switch.
  • A number with AcceptableValueRange gets a slider with - and +, and a box to type the number in (1.5.0). All of them stop at the same round steps, about a twentieth of the range rounded down to 1, 2 or 5 times a power of ten, so 0.1 to 8 moves by 0.2 and 0 to 100 by 5. Other numbers get - and + around a box you can type in, moving by 1 (0.1 for float, double and decimal).
  • An enum or an AcceptableValueList shows its choices as buttons side by side when there are four or fewer and they fit (1.5.0). Otherwise - and + step through them.
  • From core 1.2.0, text values too. That means strings, keyboard shortcuts, colours and anything else BepInEx writes to the config file as text. The value applies when you press Enter or leave the field. If the config parser won't take it, the old value comes back and the reason shows under the row. Back (Esc, or B on a gamepad) while typing puts the old value back and saves nothing (1.5.0).
  • A KeyboardShortcut also gets Change (it was called Capture key before 1.5.0). Click it, and the next key you press (with whatever modifiers you're holding) becomes the value. Esc stops without changing it. When another setting has the same key, a line under the row says so.
  • A Color gets a swatch next to its value (1.5.0).
  • A type BepInEx can't write as text is only shown, with a note to change it in the mod's config file.

There's still no page-wide "Reset all", on purpose. Each row has its own way back instead: when the value isn't the default, the row gets a dot, says what the default is, and its round-arrow button puts the default back. A mod with six settings or more gets a search field at the top of the tab (1.5.0).

Clone this wiki locally