MTDUI

v1.1.0·Updated 2023-06-12

A simple UI library for 20 Minutes Till Dawn.

About this mod Author’s original text

MTDUI

A simple UI library for 20 Minutes Till Dawn.

For Developers

MTDUI is primarily meant to be used in conjunction with the BepInEx configuration system.

NOTE: MTDUI is still in early development, and as such only currently supports a few types of config options:

| ConfigEntry Type | Supported |

| ------------- | ------------- |

| Enum | ✅ |

| Int | ✅ |

| Float | ✅ |

| Bool | ✅ |

| String | ❌ |

| Others? | ❌ |

Support for new ConfigEntry types will be added as the library matures.

Example Usage

using MTDUI;

// Create a new configuration file using the BepInEx config system

var customFile = new ConfigFile(Path.Combine(Paths.ConfigPath, "GameSpeed.cfg"), true);

// Add a config option

var gameSpeed = customFile.Bind("General", "Game Speed", 1, "The speed at which the game runs.");

// Register the config option with MTDUI's in-game mod settings

// 1, 2, 3, 4, 5, and 10 are valid options that can be selected

// NOTE: Enums and Bools will have this list automatically filled, but you need to manually add values for ints/floats

// This is visible on the title screen and pause menu by default

ModOptions.Register(gameSpeed, new List(){ 1, 2, 3, 4, 5, 10 });

// gameSpeed should now be updated when changed in the ingame UI (or when the cfg file is manually modified)

// Use gameSpeed.Value when you want to actually use the value

// Other options:

// You can control which menu a setting will appear on by using ConfigEntryLocationType

// This can be useful if you have settings you don't want people to change mid-run

ModOptions.Register(gameSpeed, new List(){ 1, 2, 3, 4, 5, 10 }, ConfigEntryLocationType.PauseOnly); // only appears in the in-game pause menu

ModOptions.Register(gameSpeed, new List(){ 1, 2, 3, 4, 5, 10 }, ConfigEntryLocationType.MainOnly); // only appears on the title screen

// You can make the option appear on a custom sub-menu by passing a string

ModOptions.Register(gameSpeed, new List(){ 1, 2, 3, 4, 5, 10 }, ConfigEntryLocationType.Everywhere, "Custom SubMenu"); // appears in a "Custom SubMenu" tab

// You can use RegisterOptionInModList to add configs to a "Mod List" subpanel

// This section is mostly intended to be used for activation/deactivation, as to not clutter up the submenu with inactive mods

// The expected usage is to disable the rest of the plugin if enabled

activateMod = Config.Bind("General", "Activation", true, "If false, the mod does not load");

ModOptions.RegisterOptionInModList(activateMod);

if (!activateMod.Value) return;

For more information on how the BepInEx config system works, check out the official documentation.

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:

BepInExPackMTD-BepInExPack_20MTD

File & checksum

Filename
MTDUI-1.1.0.zip
File size
19.3 KiB