DebugHUD
API for showing dynamic values on an HUD updated every frame, compatible with BepInEx mods and Official API.
截圖 共 3 張
模組介紹 作者原文
AGDDebugHUD - Plugin & API Guide
AGDDebugHUD is a BepInEx plugin that displays a real-time debug overlay in the top-left corner of the screen.
It comes with built-in player stats and a public API so your own plugins/mods can register custom debug lines.
Compatible with BepInEx plugins and Official API mods.
Images
Built-in display
Once installed, the HUD appears automatically when the GameSingleton awakens. Press F3 (configurable) to toggle the overlay on/off.
Game
| Line | Content |
|---|---|
| FPS | Frame time in ms + FPS |
| HUD Time | HUD processing time in ms + FPS impact |
Network
| Line | Content |
|---|---|
| Ping | Current network ping in ms |
Movement
| Line | Content |
|---|---|
| Velocity | Current movement speed in m/s + X/Y/Z components |
| Position | World-space coordinates |
Physics
| Line | Content |
|---|---|
| Ragdoll State | Whether the player is currently ragdolled |
Status
| Line | Content |
|---|---|
| State | Grounded, Aiming, Alive, NoClip booleans |
| Status Effects | Count and names of active status effects (e.g. Invincible, RecentlyHardHit) |
All default values are sourced from SessionManager.Instance.LocalPlayer. Each section and individual line can be disabled via the BepInEx config file.
Configuration
All settings live in BepInEx/config/com.unii.debugHud.cfg.
| Setting | Default | Description |
|---|---|---|
| Enabled | true | Master toggle for the entire HUD |
| ToggleKey | F3 | Key to show/hide the overlay |
Section and line toggles (all default true):
- EnableGameSection / EnableFPS / EnableHUDFPS
- EnableNetworkSection / EnablePing
- EnableMovementSection / EnableVelocity / EnablePosition
- EnablePhysicsSection / EnableRagdollState
- EnableStatusSection / EnableState / EnableStatusEffects
Disabling a section hides all its lines regardless of their individual toggles.
Compatibility
This plugin is made to be as easy to implement as possible.
It is natively compatible with BepInEx plugins AND mods using the Official modding API.
API reference
The public API lives in the static class AGDDebugHUD.DebugHUDAPI (assembly AGDDebugHUD).
RegisterHeader(string label)
Creates a section header — a bold, gold-colored label displayed above grouped lines. Returns a Header object to pass into RegisterCustomLine.
- label - display text for the header (e.g. "--- MyPlugin ---").
RegisterCustomLine(string label, Func getter)
RegisterCustomLine(string label, Func getter, Header header)
Registers a new line in the overlay. The label serves as both the display name and a unique key.
- label - unique identifier for the line. Also used as the GameObject name.
- getter - a Func called every frame (during Update) to fetch the current value. Return null to hide the line entirely.
- header (optional) - the Header returned by RegisterHeader. Lines sharing the same header appear grouped together under it.
Best practice is to register (RegisterCustomLine) during your own plugin's Awake.
EnableLine(string label)
Re-enables a line that was previously disabled.
DisableLine(string label)
Hides the line (GameObject set inactive). The getter is not called while disabled.
FreezeLine(string label)
Keeps the last visible text on screen but stops calling the getter.
How to use from your own plugin
Your plugin does not need a hard reference to AGDDebugHUD.dll.
Use reflection to call the API, this avoids compile-time dependency and keeps your plugin perfectly functional even if the HUD isn't installed.
Generic template (line only)
BepInEx:
private void RegisterDebugHUD()
{
var apiType = Type.GetType("AGDDebugHUD.DebugHUDAPI, AGDDebugHUD");
if (apiType == null) return; // HUD not installed
var registerMethod = apiType.GetMethod("RegisterCustomLine");
if (registerMethod == null) return;
Func myGetter = () => { / your logic / return "MyLabel: someValue"; };
registerMethod.Invoke(null, new object { "MyLabel", myGetter });
}
Generic template (header + lines)
private void RegisterDebugHUD()
{
var apiType =
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。