Details

Last Updated
8 months ago
First Uploaded
8 months ago
Downloads
9.1K
Likes
1
Size
97KB
Dependency string
jinxOAO-BuildBarTool-1.0.1
Dependants

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开发者和玩家使用。

image.png

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允许玩家自定义建造菜单(包括第二行)。

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