RyLib

版本 v1.1.1·更新於 2026-10-09

Shared UI library for Holdfast client mods. Lets several mods add P menu tabs, a shared Mods tab, a battle map, player and kill log actions, key hints and world or minimap markers without colliding.

模組介紹 作者原文

RyLib

RyLib is a UI library for BepInEx client mods for Holdfast: Nations At

War. Mods register P menu tabs, buttons, key hints and markers with RyLib by name, and RyLib places them in the

game's UI. Several mods can add to the same menus and bars at once without overlapping.

RyLib adds nothing to the game by itself. Mods that use it list it as a dependency, and mod managers install it

with them.

Features

| Feature | Description |

| --- | --- |

| P menu tabs | Header tabs with pages of controls, a shared Mods tab with one sub tab per mod, and map pages. |

| Players tab bar | Controls in the bar under the players list, next to Admin Raygun. |

| Player row actions | Buttons on an expanded player row, in the same grid as the game's buttons. |

| Kill log actions | Actions for the killer and the victim when a kill log row is clicked. |

| Key hints | Entries in the free roam and spectating key bars. |

| World marks | Rings, beams, labels and a glow visible through walls, on players or positions. |

| Minimap marks | Markers on the game's minimap. |

| Map pages | An overhead image of the battle with every player drawn by class and faction. |

| Helpers | Faction colours, game icons in TextMeshPro text, and stock icon names. |

Using RyLib in a mod

Reference RyLib.dll, add the dependency, and register in your plugin's Awake:

[BepInPlugin(Guid, "MyMod", "1.0.0")]

[BepInDependency(RyLib.RyLibPlugin.Guid)]

public class MyMod: BaseUnityPlugin

{

public const string Guid = "com.example.mymod";

private void Awake()

{

RyLib.PlayerRow.AddAction(Guid, "Wave", RyLib.StockRowButton.Heal, playerId => Wave(playerId));

}

}

Add "Ryanlt-RyLib-1.0.0" to the dependencies in manifest.json.

Conventions

  • Every call takes your plugin GUID as owner. RyLib uses it in log messages and to keep each mod's

registrations separate.

  • Register everything in Awake. RyLib creates the UI when the game builds its own, and again after a map change.
  • Each callback runs inside its own try/catch. An exception is logged with your GUID and does not affect other

mods.

  • Registering the same label twice from one owner logs a warning and returns false.
  • Tabs, pages and mod tabs are looked up by name. Asking for an existing name returns the existing one, and

content from every mod is added to it. Asking for an existing name as a different kind of page is refused and

logged with both owners.

  • A Func visible parameter is called several times a second, and the UI shows or hides to match. null

means always visible.

P menu tabs

ModTab PMenu.ModTab(string owner, string name, string icon = null, bool adminOnly = true, Func visible = null)

HeaderTab PMenu.Header(string owner, string name, string icon = null)

Page HeaderTab.Page(string owner, string name, string icon = null, bool adminOnly = true, Func visible = null)

Page HeaderTab.MapPage(string owner, string name, string icon = null, Func visible = null)

bool ModTab.Section(string owner, string title, Action build)

bool Page.Section(string owner, string title, Action build)

PMenu.ModTab adds a sub tab to the shared Mods header tab. The Mods tab lists one button per mod on the

left and shows the selected mod's sections on the right.

RyLib.ModTab tab = RyLib.PMenu.ModTab(Guid, "MyMod", RyLib.StockIcon.Shield);

tab.Section(Guid, "Display", section =>

{

section.Toggle("Show rings", Settings.ShowRings, RyLib.StockIcon.Players);

section.Stepper("Ring size", Settings.RingSize, 0.5f, "0.0");

});

PMenu.Header adds a header tab of your own after the game's tabs. The game's tab names are reserved: Players,

Rules, Admin, Maps, Kill Log and Artillery. RyLib sizes every header label and icon to fit the bar,

including the game's.

A header tab holds pages. Page holds sections and MapPage holds a map. A header with more than one page shows

a row of icon buttons for switching between them. A header with no visible pages is hidden.

Pages and mod tabs with adminOnly set show only after the server accepts an rc login.

Section co

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

HoldfastModding-BepInExPack_Holdfast

檔案與校驗

檔案名稱
RyLib-1.1.1.zip
檔案大小
125.2 KiB