BuildBarTool

版本 v1.0.4·更新於 2026-01-30

Add a second row in build menu, allowing mod developers to bind their new items to the new row in build menu. 在建造菜單新增額外的一行,允許mod開發者將他們的新物品綁定在新的這行建造欄上。

截圖 共 1 張

模組介紹 作者原文

BuildBarTool / 建造欄工具

This mod add a new row to the build menu. MOD developers can bind their new items to the buttons in this new row.

這個mod添加了一行新的建造欄供mod開發者和玩家使用。

Examples -- For MOD Developers / 使用示例 -- 給MOD開發者

using BuildBarTool;

[BepInPlugin(GUID, NAME, VERSION)] // your mod info 你的mod信息

[BepInDependency(BuildBarToolPlugin.GUID)] // add this mod as hard dependency 將此mod作爲你mod的依賴

public class YourPlugin: BaseUnityPlugin

{

void Start()

{

// ******* Anything you do to register new items.

BuildBarTool.SetBuildBar(3, 4, 9554, true);

// for example, item 9554 will be bound to the button in the red circle (index 4 of top row) in category 3.

// "true" means the item will be bound to the top row (red square).

// 把物品9554綁定到紅圈所示的按鈕上。 true 代表着綁定在第二行上(紅框所示)

}

// Another way to use this MOD is to use ItemProto.SetBuildBar() after you registered your items

public static void MethodThatYouRegisterYourItems()

{

// ItemProto yourItem;

// **** Anything you do to register your items by CommonAPI or LDBTool.

yourItem.SetBuildBar(3, 4, true);

// This is another way you can bind your item to the build bar. 你也可以使用這另一種方法。

// DONNOT USE LDB.items.Select(id) to select an ItemProto to bind build bar. 絕不要使用LDB.items.Select(id)來獲取ItemProto進行綁定。

}

}

You can simply set your itemProto's buildIndex = category × 100 + index + 20, without adding this mod to your mod's hard dependency or using BuildBarTool;. In this case, only the players who has installed BuildBarTool will automatically bind that item to the buttons in the top row. Those who doesn't install the BuildBarTool can still play your mod.

你也可以直接把itemProto的buildIndex設置成category × 100 + index + 20**,而不需要using BuildBarTool;,也不需要把此mod作爲前置mod。若如此做,任何安裝了此mod的玩家可以自動將該物品綁定到對應的第二行建造菜單上,未安裝此mod的玩家也可以正常使用你的mod。

yourItem.buildIndex = 324;

// This is another way you can bind your item to the button in the red circle (index 4 of top row) in category 3.

Compatibility -- AND FOR PLAYERS / 兼容性 -- 以及致玩家

This mod is compatible with RebindBuildBar, and with that mod, players can customize their own build bar, even for the buttons in the top row.

此mod與RebindBuildBar 兼容,同時安裝這兩個mod允許玩家自定義建造菜單(包括第二行)。

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

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

xiaoye97-BepInExxiaoye97-LDBToolCommonAPI-DSPModSaveCommonAPI-CommonAPI

檔案與校驗

檔案名稱
BuildBarTool-1.0.4.zip
檔案大小
94.8 KiB