群鸟绘卷 模板篇

⭐ — (0 endorsements) 📥 3,027 downloads 📅 4/2/2024
⚪ Last updated 2024

By 76561198426806125 · version:1.0, client_only_mod

⬇ Download Mod Source: Steam Workshop ↗ 📅 Updated: 4/2/2024 📅 Created: 4/2/2024

🔍 Analysis

  • 👍 0.0% endorsement rate

📋 About This Mod

此模组面向模组作者,别的玩家订阅了也没用~ 如果你是mod作者,想把自己的客户端mod功能绑定到面板,并实时更改设置。 或者想使用绘卷的高级设置页面,请参照此说明文档。 此模组的目录下`readme.md`是接口说明文档,允许其他mod注册按钮或者启用高级设置。 ### 1、导入模组库 ```lua local state, m_util = GLOBAL.pcall(require, "util/modutil") if state then print("启用了群鸟绘卷!") else print("未启用群鸟绘卷!") end ``` 说明:如果想在`modmain`中使用绘卷模组库, 请确保您的模组`priority` 小于 `1000`,或者在进入游戏后再加载绘卷模组库。 ### 2、添加图标到功能面板 此方法适用于您单纯想在功能面板塞一个按钮图标,并让它点击响应您的某个功能。 ```lua m_util:AddBindIcon(name, icondata, hover, closewindow, func_left, func_right) ``` + `name`: 按钮下方的名称(`string`类型) + `icondata`: 按钮的图片资源 1、 如果是饥荒原版就有的图标,直接填写`string`类型的`prefab`或者`skin`名字, 比如`abigail_flower`或者`abigail_flower_handmedown_level3` 2、 如果是您指定位置的自定义图标,需要填写`table`类型, 参数是`{xml = "您的xml文件路径", tex = "您的tex资源名"}` + `hover`: 鼠标移动到按钮上时,功能面板最上面的提示文字(`string`类型) + `closewindow`: 点击后是否自动关掉面板,为真时关闭(任意类型) + `func_left`: 左键点击触发函数(`function`类型) + `func_right`: 右键点击触发函数(`function`类型) 示例代码: ```lua m_util:AddBindIcon("物品整理", "greenamulet", "点击打开物品整理的高级设置", true, func_autosort) ``` 这个示例中,会生成一个名为“物品整理”的按钮,图标是建造护符,鼠标移动到到上面会显示“点击打开物品整理的高级设置”,左键点击后会自动关闭功能面板,并执行函数`func_autosort()` ### 3、绑定按键功能 ```lua m_util:AddBindConf(conf, fn, down, meta, modname) ``` 如果您想让您的功能可以在游戏内随时更改按键绑定,随时设置到功能面板,请用这个方法吧! + `conf`:模组配置文件`modinfo`中您设置的配置名(`string`类型) + `fn`: 按键触发的函数(`function`类型) + `down`: 按键是按下立即响应(为真),还是抬起按键时响应(为空) + `meta`: + 不填写(为`nil`): 表示无需注册功能到面板 + `table`类型,里面参数都是 `m_util:AddBindIcon` 中的参数,当`conf`的值为`biubiu`时会自动绑定到功能面板 + `modname`: 如果您在`modmain`中写代码,填写`modname`即可,如果在`require`或者控制台写代码, 请填写完整的模组路径, 比如`workshop-123456789` 示例代码: ```lua m_util:AddBindConf("sw_toggle", function() local mv = not Profile:GetMovementPredictionEnabled() ThePlayer:EnableMovementPrediction(mv) Profile:SetMovementPredictionEnabled(mv) u_util:Say(mv and "开启" or "关闭", mv and "延迟补偿已开启" or "延迟补偿已关闭", nil, mv and "春绿色" or "红色", true) end, nil, nil, nil, modname) ``` 这个案例是一键切换延迟补偿的完整代码,按下`modinfo`中绑定`sw_toggle`设置的按键后,抬起按键时触发后面的`function()` 再看一个示例: ```lua m_util:AddBindConf("sw_cookbook", fn, nil, {"烹饪指南", "cookbook", "菜谱"

📊 Mod Details

Game
Dont Starve Together Mods
Author
76561198426806125
Version
N/A
Downloads
3,027
Endorsements
0
Category
version:1.0, client_only_mod
Created
4/2/2024
Updated
4/2/2024

🔧 How to Install Don't Starve Together Mods

Subscribe on Steam Workshop. Mods auto-download and install. Launch the game to activate.

📖 Full step-by-step install guide for Don't Starve Together →

Visit the official mod page for specific installation instructions for this mod.

🎮 Need cheat codes or console commands? Check ur gaming wiki for Don't Starve Together commands, item IDs, and more.

Keep browsing — more Don't Starve Together mods await

📋 All Don't Starve Together Mods 🏆 Top 25 📂 More version:1.0, client_only_mod 👤 More by 76561198426806125 🔎 Similar Mods 🌐 Best version:1.0, client_only_mod (All Games) 🔀 Check Compatibility ⚖️ Compare Mods 🆕 New Mods