huoyan1231-WK_huoyan1231COMLib icon

WK huoyan1231COMLib

Common library for huoyan1231's White Knuckle mods. Provides shared leaderboard management utilities — automatically disables leaderboards when any dependent mod exceeds the vanilla Trinket budget, and restores them after each run.

Last updated 5 hours ago
Total downloads 54
Total rating 0 
Categories Libraries
Dependency string huoyan1231-WK_huoyan1231COMLib-1.0.0
Dependants 2 other packages depend on this package

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

README

WK_huoyan1231COMLib

White Knuckle BepInEx Common Library — Shared utilities for huoyan1231's White Knuckle mods
White Knuckle BepInEx 公共组件库 — huoyan1231 系列 White Knuckle Mod 的共享工具库


English

What is this?

WK_huoyan1231COMLib is a shared BepInEx library (plugin) used by huoyan1231's White Knuckle mods.
It provides common utilities that multiple mods can share, avoiding code duplication.

Features

Leaderboard Management

Ported and extended from WKUnlimitedTrinkets:

  • Automatic leaderboard disabling: When any dependent mod requests it (e.g. when the Trinket budget is exceeded), the library sets CL_Leaderboard.WK_Leaderboard_Core.disableLeaderboards = true
  • Multi-mod coordination: Multiple mods can register/unregister disable requests independently. Leaderboards are only restored when all requesters have cleared their requests.
  • Auto-reset on run end: Leaderboard state is fully reset after each run (M_Gamemode.Finish) to prevent state leaking into subsequent runs.

Public API for Mod Developers

Other mods can use the LeaderboardManager static class:

// Disable leaderboards for this run (call from your StartFreshGamemode patch)
LeaderboardManager.DisableForThisRun("your.mod.guid");

// Re-enable your request (will only restore if all other mods also cleared)
LeaderboardManager.TryRestore("your.mod.guid");

// Check if the current Trinket selection exceeds vanilla budget
bool exceeded = LeaderboardManager.IsTrinketBudgetExceeded(trinketNamesList);

Installation

  1. Ensure BepInEx 5.x is installed (via Gale, R2MM, or manual)
  2. Place WK_huoyan1231COMLib.dll in:
    <Game Root>/BepInEx/plugins/
    
  3. Install any dependent mods that require this library

Configuration

A config file will be generated in BepInEx/config/ after first run:

huoyan1231.whiteknuckle.comlib.cfg
Setting Default Description
EnableLeaderboardManagement true Set to false to disable all leaderboard management patches

Dependencies

Mod Purpose
WKUnlimitedTrinkets Leaderboard logic was ported from here

中文

这是什么?

WK_huoyan1231COMLib 是一个 BepInEx 共享库插件,供 huoyan1231 的 White Knuckle 系列 Mod 使用。
它提供多个 Mod 可复用的公共工具,避免重复实现相同逻辑。

功能

排行榜管理

WKUnlimitedTrinkets 移植并扩展:

  • 自动禁用排行榜:当任意依赖本库的 Mod 发起请求时(例如 Trinket 预算超限),库会将 CL_Leaderboard.WK_Leaderboard_Core.disableLeaderboards 设为 true
  • 多 Mod 协调:多个 Mod 可独立注册/撤销禁用请求;只有所有请求者都撤销后,排行榜才会恢复
  • 局结束自动重置:每局结束(M_Gamemode.Finish)后完全重置排行榜状态,防止污染后续局

面向 Mod 开发者的公共 API

其他 Mod 可使用 LeaderboardManager 静态类:

// 禁用排行榜(在你的 StartFreshGamemode Patch 中调用)
LeaderboardManager.DisableForThisRun("your.mod.guid");

// 撤销你的禁用请求(只有所有 Mod 都撤销后才真正恢复)
LeaderboardManager.TryRestore("your.mod.guid");

// 检查当前 Trinket 组合是否超出原版预算
bool exceeded = LeaderboardManager.IsTrinketBudgetExceeded(trinketNamesList);

安装

  1. 确保已安装 BepInEx 5.x(通过 Gale、R2MM 或手动安装)
  2. WK_huoyan1231COMLib.dll 放入:
    <游戏根目录>/BepInEx/plugins/
    
  3. 安装依赖本库的其他 Mod

配置

首次运行后会在 BepInEx/config/ 生成配置文件:

huoyan1231.whiteknuckle.comlib.cfg
配置项 默认值 说明
EnableLeaderboardManagement true 设为 false 可禁用所有排行榜管理补丁

Build / 构建

Requires .NET SDK (>= 6.0) / 需要 .NET SDK (>= 6.0)

dotnet build WK_huoyan1231COMLib.csproj -c Release

Output / 输出:bin/Release/net471/WK_huoyan1231COMLib.dll


Origin / 代码来源

The leaderboard management logic is ported from WKUnlimitedTrinkets and extended to support multiple mod coordination.

排行榜管理逻辑从 WKUnlimitedTrinkets 移植而来,并扩展为支持多 Mod 协调的公共接口。


License / 许可证

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

本项目采用 GNU 通用公共许可证第三版 (GPL-3.0) 授权。

See LICENSE file for full text. / 完整许可证文本见 LICENSE 文件。


AI Generated Notice / AI 生成声明

This code was generated with assistance from AI (WorkBuddy).

  • Purpose / 用途: White Knuckle BepInEx common library, leaderboard management ported from WKUnlimitedTrinkets
  • Generated Date / 生成日期: 2026-04-25

本代码在 AI(WorkBuddy)辅助下生成。所有代码经项目维护者审查。