You are viewing a potentially older version of this package. View all versions.
RicketyWrecked-AdminMenuButtonPositionFix-1.4.0 icon

AdminMenuButtonPositionFix

Fixes the Admin Menu button (h3nw-AdminMenuButton) overlapping REPOConfig's Mods button in the pause menu by spacing every pause-menu button evenly - with or without Active Moons showing.

Date uploaded 2 days ago
Version 1.4.0
Download link RicketyWrecked-AdminMenuButtonPositionFix-1.4.0.zip
Downloads 660
Dependency string RicketyWrecked-AdminMenuButtonPositionFix-1.4.0

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100
nickklmao-MenuLib-2.5.4 icon
nickklmao-MenuLib

A library for creating UI!

Preferred version: 2.5.4
h3nw-AdminMenuButton-1.0.0 icon
h3nw-AdminMenuButton

Adds an Admin Menu button to the escape menu that opens RepoAdminMenu.

Preferred version: 1.0.0
proferabg-RepoAdminMenu-1.0.16 icon
proferabg-RepoAdminMenu

The best admin menu for R.E.P.O.

Preferred version: 1.0.16

README

Admin Menu Button Position Fix

Fixes a visual bug in the pause menu: the Admin Menu button and REPOConfig's Mods button draw on top of each other (and on top of Main Menu once Active Moons is showing), with their text overlapping and hard to click.

Requires RepoAdminMenu (the admin panel itself), AdminMenuButton (adds the pause menu button) and MenuLib. They install automatically as dependencies.

In plain terms

Mods that add pause-menu buttons each pick their own fixed position, and nothing stops two of them picking the same spot. REPOConfig's Mods button and AdminMenuButton's Admin Menu button landed almost on top of each other - and when the vanilla "Active Moons" button appears partway through a run and pushes the menu down a row, there's no free gap left at all.

Every time the pause menu opens, this now spaces all the buttons between Continue and Quit Game evenly, keeping their order. Continue and Quit stay exactly where they are. It works with or without Active Moons, and with any number of mod buttons, not just these two.

It doesn't touch the admin menu itself - no permission changes, it still only opens for the host (or in single player).

For the technically curious

MenuLib's CreateREPOButton has no layout or collision handling; REPOConfig hardcodes Mods at (126, 65) and AdminMenuButton uses (126, 62). Vanilla rows are 32 units apart, and with Active Moons showing Main Menu sits at y = 91, so Main Menu, Admin Menu and Mods all overlap with no gap to aim for.

A postfix on MenuPageEsc.Start snapshots the buttons that exist at that moment. It runs inside MenuLib's own hook on that method, before MenuLib adds mod buttons, so those are exactly the vanilla buttons. The highest and lowest become the column's top and bottom (Continue and Quit Game). One frame later, every active MenuButton on the page within the column's x position and inside that span is spaced evenly. Each button's private originalButtonPosition cache (restored by MenuButton.ResizeToText) is updated along with its transform. Everything is wrapped so an unexpected layout leaves the menu alone rather than breaking MenuLib's button building. A one-time log line lists every button and its position.

Good to know

  • Only changes where buttons are drawn; no effect on what any button does.
  • Built and tested with RepoAdminMenu 1.0.16, AdminMenuButton 1.0.0, MenuLib 2.5.4 and REPOConfig 1.2.6 on R.E.P.O v0.4.4.3.

Credits

Made by RicketyWrecked. Not affiliated with the R.E.P.O developers, h3nw, proferabg or nickklmao. This is an unofficial layout fix.

Questions, bug reports, or suggestions: Discord.

CHANGELOG

Changelog

1.4.0

  • The midpoint approach from 1.3.x couldn't work once Active Moons was showing - there's no gap between Main Menu and Mods to place the button in, so Main Menu, Admin Menu and Mods overlapped.
  • Now re-lays out the whole pause-menu column every time it opens: every button between Continue and Quit Game is spaced evenly, keeping its order. Works with or without Active Moons and with any number of mod buttons.

1.3.1

  • No functional changes. Fixes the website link (was blank on 1.3.0 due to a CI publishing bug) to point to the Discord.

1.3.0

  • The fixed position from 1.2.0 only worked when the vanilla "Active Moons" button was hidden; once a run progresses far enough for it to show, it pushes Main Menu down a row and the fixed position landed on top of Main Menu instead of the gap.
  • Now reads Main Menu's actual position from the menu each time it builds and places the button at the midpoint between that and Mods (which never moves), so it holds in both layouts.

1.2.0

  • Moved the Admin Menu button to (126, 94), measured from the real pause menu layout: the free gap between Main Menu (123) and REPOConfig's Mods (65).
  • Now lists RepoAdminMenu and AdminMenuButton as dependencies, since it does nothing without them.

1.1.0

  • Second attempt; added temporary position logging used to get the exact numbers.

1.0.0

  • Initial release.