You are viewing a potentially older version of this package. View all versions.
Largo-POG_Config-1.0.13 icon

POG Config

In-game MOD SETTINGS panel for Pit of Goblin mods. Provides toggles, sliders with numeric input, options lists, and keybind entries. Dependency for other POG mods.

Date uploaded 2 weeks ago
Version 1.0.13
Download link Largo-POG_Config-1.0.13.zip
Downloads 58
Dependency string Largo-POG_Config-1.0.13

This mod requires the following mods to function

LavaGang-MelonLoader-0.7.2 icon
LavaGang-MelonLoader

The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono

Preferred version: 0.7.2

README

POG Config

One shared MOD SETTINGS panel for Pit of Goblin mods, plus an editor for the game's own key binds.

Mods that support POG Config add their settings to this panel, so you get one place to change everything instead of editing config files.

Install: Thunderstore Mod Manager / r2modman, or put POGConfig.dll into the game's Mods folder (MelonLoader required).

Source and developer Wiki: github.com/largoz/POGConfig (Wiki) · Thunderstore Wiki


For players

  • A MODS button in the main menu and in the pause menu, styled like the game's own buttons, with mouse, keyboard and gamepad navigation.
  • A sidebar with every mod that registered settings, with a search box.
  • VANILLA BINDS tab: the game's own controls, editable. Each action has two keyboard slots and one mouse slot, exactly like the game's Controls screen. Changes go straight into the game's settings.
  • RESTORE DEFAULTS on every page, including the vanilla binds.
  • Settings are saved automatically.
  • Esc cancels what you are doing (typing a value, waiting for a key) and otherwise closes the panel.

For mod authors

Click to expand

Reference

<Reference Include="POGConfig">
  <HintPath>..\..\Mods\POGConfig.dll</HintPath>
  <Private>false</Private>
</Reference>

Add using POGMods.Config; and declare a dependency on Largo-POG_Config in your Thunderstore manifest.

Registering

Register once, usually from OnInitializeMelon(). Load order does not matter: Register only stores your entries, and the panel is built the first time it opens.

Wrapping the call in a NoInlining helper keeps POG Config optional: your mod still loads if POG Config is not installed.

using System.Collections.Generic;
using System.Runtime.CompilerServices;
using POGMods.Config;

public override void OnInitializeMelon()
{
    try { TryRegisterConfig(); } catch { }
}

[MethodImpl(MethodImplOptions.NoInlining)]
private static void TryRegisterConfig()
{
    POGConfig.Register("My Mod", new List<ConfigEntry>
    {
        new HeaderEntry("General"),
        new ToggleEntry("Enable Feature", () => _enabled, v => _enabled = v, "Enabled"),
        new SliderEntry("Speed", () => _speed, v => _speed = v, 0f, 10f, v => $"{v:F1}", "Speed"),
        new HeaderEntry("Input"),
        new KeyEntry("Hotkey", () => _key, v => _key = v, "Hotkey"),
    }, new ModInfo("1.0.0", "Short description", "You"));
}
  • The mod name is the sidebar label and the MelonPreferences category (spaces become _). Keep it stable across releases.
  • The values your fields hold when you call Register are the defaults that RESTORE DEFAULTS goes back to. Set them first.
  • Calling Register again with the same name replaces your earlier page instead of adding a second one.

Entry types

Type What it shows
HeaderEntry(label) A section heading. No value.
ToggleEntry(label, get, set[, prefKey]) A checkbox.
SliderEntry(label, get, set, min, max[, fmt, prefKey, originValue, showFill, wholeNumbers, stepPointsCount]) A slider with a value box you can type into.
OptionsSliderEntry(label, get, set, options[, prefKey]) A slider that picks one of several named options.
KeyEntry(label, get, set[, prefKey]) One key bind slot.
KeyEntry(label, get(slot), set(slot, key), prefKey, slotCount) Up to 3 key bind slots.
ButtonEntry(label, buttonText, onClick) A button that runs an action. New in 1.0.12.

get is polled while the panel is open, so the row follows changes your mod makes on its own. set is called when the player changes the value.

SliderEntry

new SliderEntry(
    string label, Func<float> get, Action<float> set,
    float min, float max,
    Func<float, string> fmt = null,   // display text; default v => v.ToString("F1")
    string prefKey          = null,
    float  originValue      = 0f,     // the fill bar grows from here, in both directions
    bool   showFill         = true,
    bool   wholeNumbers     = false,  // snap to integers
    int    stepPointsCount  = 0)      // 2 or more draws evenly spaced dots on the track
  • Click the value box to type a number. Enter or a click elsewhere applies it, Esc cancels. A suffix from your formatter (43s, 80%) is ignored when parsing. Values are clamped to [min, max].
  • Column widths default to 35 % label, 15 % value box, the rest slider. Override with { LabelFraction = 0.45f, ValueFraction = 0.10f }.
new SliderEntry("Volume", () => vol, v => vol = v, 0f, 1f, v => $"{v * 100:F0}%", "Volume")

new SliderEntry("Points", () => pts, v => pts = v, 0f, 8f, v => $"{v:F0}",
    "Points", 0f, false, true, 9)   // whole numbers, 9 dots, no fill

OptionsSliderEntry

new OptionsSliderEntry("Difficulty", () => _difficulty, v => _difficulty = v,
    new[] { "Easy", "Normal", "Hard" }, "Difficulty")

The value is the option index. Saved as an int.

KeyEntry

// One slot
new KeyEntry("Toggle Key", () => _toggleKey, v => _toggleKey = v, "ToggleKey")

// Up to three slots
private static readonly KeyCode[] _fire = { KeyCode.Mouse0, KeyCode.None, KeyCode.None };
new KeyEntry("Fire", slot => _fire[slot], (slot, v) => _fire[slot] = v, "Fire", 3)
  • Click a slot, then press a key or a mouse button. Esc cancels. The small x unbinds the slot (KeyCode.None).
  • Every slot accepts keyboard keys and mouse buttons. Set { AllowMouseButtons = false } for a keyboard-only entry.
  • Slot 1 is saved under prefKey, slots 2 and 3 under prefKey_2 and prefKey_3.
  • Treat KeyCode.None as "no hotkey": if (_toggleKey != KeyCode.None && Input.GetKeyDown(_toggleKey)).

ButtonEntry

new ButtonEntry("Statistics", "RESET", () => _stats.Clear())

Runs onClick when pressed. It has no value, is not saved, and RESTORE DEFAULTS leaves it alone. An exception thrown by onClick is logged, not rethrown.

Panel state and events

public static bool PanelOpen { get; }
public static event Action PanelOpened;
public static event Action PanelClosed;

Check PanelOpen before handling your hotkeys, so keys pressed inside the panel don't trigger game actions:

if (!POGConfig.PanelOpen && Input.GetKeyDown(_toggleKey)) Toggle();

PanelClosed fires after any value still being typed has been applied. Use it for settings that are expensive to apply one change at a time:

POGConfig.PanelClosed += RebuildOverlay;

Saving

Entries with a prefKey load their saved value during Register and save on change.

Entry Saved as
ToggleEntry bool
SliderEntry float
OptionsSliderEntry int (option index)
KeyEntry string (key name)

Changes are written to UserData/MelonPreferences.cfg half a second after the last change, when the panel closes, and when the game quits. Dragging a slider no longer writes the file every frame.

Only changes made through the panel are saved. If your mod changes a value itself (for example through a hotkey), the panel shows the new value but your mod is responsible for saving it.

Custom entry types

ConfigEntry's build and update hooks are internal, so other assemblies cannot add new entry types. If you need one, open an issue on GitHub.

CHANGELOG

Changelog

1.1.1

Fixes

  • Section headings: the yellow line under a heading ran through the lower part of its letters. It now sits under the text.

1.1.0

New

  • ChoiceRow: a setting picked from a list. The row shows the current item; a click opens a list over the page, with a search field, filter buttons and a line of explanation per item. Type to search; arrows, Page Up/Down, Home/End, Enter and the wheel work; Esc or a click outside closes it without a change. Only the visible items are drawn, so a list of thousands is as fast as a list of ten. The value is the item's key, so changing the list never turns a saved choice into another one. See README, "ChoiceRow".
  • Bigger panel and text, and one number to scale them. The panel is larger (1040 x 650 units) and everything in it is scaled by UIScale in [POG_Config] of MelonPreferences.cfg: 1.35 by default, 0.75 to 2, applied at once. 1 is the size before this version.
  • Rows can be taller than the standard height when they need it (a ChoiceRow with a long description).

Fixes

  • The sidebar and the separator next to it started above the content area and touched the title; they now start under the title bar.
  • A mod's description in the page header was cut off with an ellipsis. Version and author now have their own line and the description wraps underneath.
  • Slimmer, less bright scrollbar.

Compatibility

  • Nothing was removed or renamed. Checked in game: Goblin Overhead HUD 1.0.1 and POG POV Changer 1.0.2 (which finds KeyEntry by reflection) register their settings as before.

1.0.13

New

  • The MODS button speaks the game's language. The button in the main and pause menus now follows the language picked in the game's settings: МОДИ in Ukrainian, МОДЫ in Russian, 模组 in Simplified Chinese, MOD in Italian and Japanese, MODDAR in Swedish, and GOBBO HACKS in Goblin. English, French, German and Spanish keep MODS. A language the game adds later shows the English label until it gets its own. The label changes in the same frame as the game's own buttons.

1.0.12

Fixes

  • Esc cancels before it closes. Since 1.0.11 the game's own cancel input closed the whole panel on every Esc, even when that Esc was meant to cancel a key listen, a value being typed or the search box. Esc now cancels that first; a second Esc closes the panel.
  • Hidden rows no longer react to clicks. On a page long enough to scroll, rows scrolled out of view were only hidden: clicking the mod title or the header area above the list could start editing a hidden slider value, start listening on a hidden key slot, or clear a hidden bind. A row now only counts as clicked when the click is inside the visible list. The sidebar mod list had the same problem under the panel title and is fixed the same way.
  • Closing the panel ends any edit in progress. Closing with DONE, or the game leaving the menu, while a slider value was being typed or the search box was active left that edit open: the panel reopened still in edit mode with the typed text neither applied nor discarded. Closing now applies the typed value, cancels a key listen and leaves search edit mode. Switching pages does the same.
  • Registering the same mod name twice no longer breaks saving. The second call added a duplicate page, and MelonLoader refused to create the already existing preference keys, so that page's changes were never saved. A repeat Register now replaces the earlier page and reuses the existing keys.
  • Fewer disk writes. Settings were written to MelonPreferences.cfg on every slider tick while dragging. Changes are now saved half a second after the last change, when the panel closes, and when the game quits.
  • Slider handles stay on the track at the minimum and maximum. At the maximum the handle used to hang half off the end, where the list clipped it and it looked squashed.
  • Step-point dots render at the same size at every resolution and sit exactly where the handle stops for each step.
  • Key capture only scans keys on frames where something was pressed, instead of polling every key code each frame while a slot is listening.

New for mod authors

  • ButtonEntry(label, buttonText, onClick): a row with a button that runs an action, for things like "Reset stats" or "Reload".
  • POGConfig.PanelOpened and POGConfig.PanelClosed events. PanelClosed fires after any value still being typed has been applied, so it is the place to apply settings that are expensive to change one at a time.

Fully compatible with mods built against 1.0.x: the public API only gained members.

1.0.11

Fixed: the MOD SETTINGS panel would not open after the Pit of Goblin v1.0 update. The update removed NetworkMenuState.m_overrideCancelInput; setting it threw a MissingMethodException on every MODS-button click, so the panel never appeared. The panel no longer touches that field. Cancel/Esc while the panel is the active native state is now handled by overriding PogConfigState.OnCancelButton to drive our own close, so the panel behaves like a native menu without depending on internal fields that older game versions had. Thanks to GlitchApotamus for the OnCancelButton approach.

1.0.10

Fixed: the MODS button disappeared after changing the game language. Two causes, both in how the button was injected:

  • The template button was located by its label text (START, SETTINGS). Those labels are localized, so after a language switch the template could no longer be found and the button was never re-injected — which is why it stayed gone instead of coming back. Templates are now matched on their persistent onClick handler names (OnStartButton, OnSettingsButton, OnInviteButton), which are serialized prefab data and never localized. Label matching remains as a fallback.
  • The cloned button inherited the donor's I2 Localize component, which re-applies the donor's term on every language change — overwriting the "MODS" label with a second translated "START"/"SETTINGS". Those components are now stripped from the clone, and the label is re-asserted defensively while the menu is on screen.

Template lookup also now skips POGConfig's own clones, so a clone can never be picked as the template for itself.

1.0.9

Native config window. The MOD SETTINGS panel is now a real injected NetworkMenuState that the game switches to via NetworkMenu.SetState, the same mechanism used for its own Settings/Credits/etc. screens. The game hides the underlying menu on its own and treats the panel as the current screen instead of an overlay drawn on top of it, so Esc/cancel behaves like a native screen transition rather than two separate systems racing each other. Falls back automatically to the previous plain-overlay behavior if the injected state can't be registered.

Keybind rework. KeyEntry supports up to 3 universal slots per action — any slot accepts a keyboard key or a mouse button (KeyCode.Mouse0–Mouse6), no fixed keyboard/mouse split. One slot by default; a mod opts into more via the new constructor KeyEntry(label, get(slot), set(slot, value), prefKey, slotCount). Slots sit right-aligned in a fixed 3-column grid, each with an inline clear button. The old single-key constructors still work exactly as before (source- and binary-compatible with 1.0.x mods). Slot 1 persists under the same prefKey as before, slots 2/3 under prefKey_2/prefKey_3. Also fixed: starting a rebind by clicking a slot could immediately capture that same mouse click as the bound button.

Vanilla Binds tab. A new "VANILLA BINDS" entry at the top of the sidebar shows the game's own controls — every user-assignable action with its keyboard (up to 2) and mouse (1) binds, read live from Rewired each time the tab opens. Binds are editable: click a slot, press a key (keyboard columns) or a mouse button (mouse column), and the change is written straight into the vanilla input system via the same Rewired API the game's Controls screen uses, then saved and verified by re-reading — the row always ends up showing the real state, and a warning is logged if an assignment did not stick. Keyboard/mouse column typing matches how the game itself stores binds, so nothing can be assigned here that the vanilla screen couldn't display.

Restore Defaults. Every mod page now has a RESTORE DEFAULTS button at the bottom that resets all of that mod's settings to the values the mod registered with (captured before saved preferences were applied), and persists the reset.

Pause menu & UI fixes.

  • The pause-menu MODS button is now a real NetworkMenuButton injected at the top of the pause button column — native yellow selector, hover, click sound and gamepad navigation, and the column layout spaces it automatically (same approach as the main menu since 1.0.7). The old floating overlay button remains only as a fallback if the injection target is not found.
  • Fixed: pressing Esc to close the MOD SETTINGS panel in the pause menu no longer also closes the pause menu itself with the same key press.
  • Toggle checkboxes are now square (22×22) instead of rectangular, and the yellow checkmark is drawn as a centred square so it no longer looks unevenly inset at fractional UI scales.

1.0.8

  • Fixed: hovering the MODS button in the main menu now shows the selector and yellow highlight exactly like the native buttons. The cloned button is now instantiated directly under the Buttons Panel so it resolves its internal NetworkMenu reference; the old manual hover workaround was removed.
  • Fixed: pressing Esc to cancel a search edit, a slider value edit, or a key-binding capture no longer also closes the whole panel with the same key press.
  • Added: Esc now cancels key-binding capture in KeyEntry (previously only the Cancel button worked).
  • Fixed: the sidebar mod list snaps back to the top when it is rebuilt (e.g. while typing a search query after scrolling down).

1.0.7

  • The MODS button in the main menu is now a real NetworkMenuButton injected into the in-game Buttons Panel (between START and SETTINGS) instead of a floating overlay. It matches the game's button style, sound, and selection visuals.
  • The pause-menu MODS button keeps the floating-overlay approach for now.
  • Vertical scrollbar fixed: the thumb is now draggable on both the mod list (sidebar) and the settings list (content), and clicking on the empty track centres the thumb on the cursor and starts a drag from that point. Mouse wheel now scrolls only the section the cursor is over.
  • Switching between mods in the sidebar resets the content scroll position back to the top.
  • Mouse and keyboard input on the underlying main/pause menu is suppressed while the config panel is open (Enter no longer triggers main-menu buttons by accident).
  • Pressing Esc now closes the config panel.

1.0.6

  • Added a full developer Wiki for POGConfig with entry-by-entry docs, architecture notes, runtime behavior details, persistence guidance, and troubleshooting pages.
  • Included CHANGELOG.md in the package build to ensure release notes are visible on Thunderstore.

1.0.3

  • SliderEntry now exposes LabelFraction and ValueFraction properties so mod authors can override the default column widths (35 % / 15 % / 50 %) via object initializer syntax.
  • KeyEntry now shows a Clear button to remove the keybind (KeyCode.None). Unbound keys display as — none —.

1.0.1

  • Added OptionsSliderEntry for discrete string option lists.
  • Added KeyEntry.AllowMouseButtons opt-in property to allow mouse button binding.
  • Added POGConfig.PanelOpen public property; other mods can suppress hotkeys while the panel is open.
  • Added vertical scrollbar; scroll wheel supported.
  • Added marquee text animation for long labels and value strings (hover to scroll).

1.0.0

  • Initial release: in-game settings UI framework for Pit of Goblin mods.
  • ToggleEntry, SliderEntry, KeyEntry.
  • MelonPreferences persistence via prefKey.