Stonewards
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
last week
Downloads
388
Size
89KB

stonewards-admin-menu

A BepInEx plugin for Stonewards that adds an in-game admin/cheat menu, following the same conventions as the author's existing Stonewards mods. The menu is toggled with a hotkey (F1 by default) and presents a polished, aesthetically pleasing UI rather than a bare debug panel. It exposes common admin actions such as resurrecting or killing players, spawning items, god mode, infinite stamina, and a super pickaxe.

Features

  • Players tab — revive, heal, or kill any connected player, teleport to them, or (as host) bring them to you. Health and alive/dead status update live. Stats opens a per-player editor for every stat level-up rings raise, showing each current value and letting you set it. Go to campfire takes you to the level's campfire.
  • Items tab — search and browse the item catalog and spawn any item, with an amount next to each one.
  • Resources tab — add meta currency to your save, spawn any kind of treasure chest in front of you, and spawn dug-up resources and scrap.
  • Cheats tab — toggle god mode, infinite stamina, infinite arrows & bombs, a super pickaxe (25x dig strength) and a super speed pickaxe (3x digging speed).
  • A themed, tabbed panel matching the game's own menus, not a raw debug list.

Opening the menu

Press F1 to open and close the admin menu. Escape also closes it by default (configurable, see below).

Rebinding

Settings are stored in BepInEx/config/com.darkharasho.stonewards.adminmenu.cfg and can be edited by hand or, if darkharasho-ModSettings is installed, from the in-game Mods settings panel:

Section Key Default Description
General Enabled true Allow the admin menu to be opened.
General TrustedAdmins the mod author's Steam ID Steam IDs, comma-separated, that may use the admin menu in games you host. Everyone else only gets it as host. Clear it to remove the author.
Controls ToggleKey F1 Key that opens and closes the admin menu.
Controls CloseOnEscape true Also close the admin menu with Escape, instead of opening the pause menu.
Cheats GodMode false Keep your health topped up and block incoming damage.
Cheats InfiniteStamina false Never run out of stamina when sprinting, climbing or blocking.
Cheats InfiniteAmmo false Arrows, ballista bolts, bombs and other throwables are never used up. You need at least one to start with.
Cheats SuperPickaxe false Dig with 25x strength, including the heavy dig bonus.
Cheats SuperSpeedPickaxe false Dig 3x faster.

Multiplayer notes

The admin menu is host-only. The exception is players whose Steam IDs are listed in TrustedAdmins, which by default holds the mod author (darkharasho). When the host runs this mod, the host's list decides and is shared with the lobby, and a trusted client's host-only actions (Bring, stat changes) are carried out by the host. When the host doesn't run it, the joining player's own list decides, and only the actions the game already accepts from clients work.

Positions are owned by each player's own client, so Go to works for anyone but Bring needs the host, either you or a host running this mod.

Stat changes have to reach both the host and the player they're for, since the host decides health, defense and damage while each player's own game decides movement, digging and attack speed. The admin menu sends them itself, so for full effect both of those need the admin menu installed. As a client you can only edit stats when the host has it.

Damage in Stonewards is decided on the server. As a result, god mode blocks hits outright when you're the host, but on a plain client it works by healing you back up immediately after you're hit, since the client can't veto damage the host has already applied.

Development

Requires the .NET SDK, Stonewards, and an r2modman profile with BepInExPack 5.4.2305 installed.

  • dotnet build src/AdminMenu/AdminMenu.csproj builds the plugin. src/AdminMenu/AdminMenu.csproj targets netstandard2.1 and resolves its <Reference> items through $(BepInExCorePath) and $(ManagedPath), which default to this machine's game install (GamePath) and r2modman profile (ProfilePath) — override them with -p:GamePath=... -p:ProfilePath=..., or with a gitignored Local.props importing your own GamePath/ProfilePath properties. After a build with the game found, the DLL is copied into the profile's BepInEx/plugins/darkharasho-AdminMenu.
  • When $(ManagedPath)/Assembly-CSharp.dll doesn't exist (no game installed, e.g. in CI), or with -p:UseRefs=true, the build falls back to the reference-only assemblies checked into lib/refs instead of the real game/BepInEx DLLs.
  • lib/refs is generated by scripts/update-refs.sh, which needs the JetBrains.Refasmer.CliTool (dotnet tool install -g JetBrains.Refasmer.CliTool). Rerun it after a game update that changes APIs the mod uses, or when adding a <Reference>.
  • dotnet test tests/AdminMenu.Tests runs the unit tests; the test project never references game or BepInEx assemblies.
  • scripts/package.sh builds Release and writes a Thunderstore zip to dist/. It fails if the versions in thunderstore/manifest.json, Plugin.cs and the .csproj differ, or if CHANGELOG.md has no entry for that version.

Releases

Pushing a v* tag runs .github/workflows/release.yml. It checks the tag matches thunderstore/manifest.json, runs scripts/package.sh, creates a GitHub release with the zip and that version's changelog entry, and publishes the zip to Thunderstore with scripts/thunderstore-publish.sh (using the THUNDERSTORE_TOKEN repo secret; versions already on Thunderstore are skipped). Bump the version in the manifest, Plugin.cs, the .csproj and CHANGELOG.md first, then git tag vX.Y.Z && git push origin vX.Y.Z.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.