去掉 E 后缀(E begone)
移除新款 L、XL 飞船名称中的 E 后缀,隐藏旧款飞船蓝图,并将 Faulty Logic 中废弃的 Odysseus Vanguard 替换为新模型。适用于新存档;中途安装可能不会更新已有蓝图或废弃飞船。兼容 VRO。
为装备配置界面提供 API,供其他模组新增或替换界面分区。框架通过共享钩子依次执行已注册的 UI 模组,减少它们争夺原版界面函数的情况;不要求安装 Kuertee UIX,但可与其协作。
本框架提供 API,供其他模组在装备配置(Loadout)面板中新增或替换分区。
据作者了解,Kuertee UI Extension 为现有分区提供固定 API;作者需要一个更灵活的框架,让模组能够添加自定义界面分区。
menu.setupLoadoutInfoSubmenuRows 函数。在 content.xml 中声明框架依赖:
<dependency id="ws_3762934088" optional="false" name="Loadout UI Framework"/>
在 ui.xml 中声明:
<dependency name="ncd_loadout_ui" />
Kuertee UIX 是可选协作项,并非必需前置。
每个 UI 模组须提供两个函数,并确保两者之间的数据契约一致:
nil,框架会跳过该 UI 包。LoadoutUI.RegisterUIUI 模组通过此函数注册自身,可新增分区、替换现有分区,或同时执行两者。每项配置包含新名称、用于定位的目标分区名称、构建数据函数和构建函数。
local LoadoutUI = _G.LoadoutUI
LoadoutUI.RegisterUI("mod_id", function()
return {
add = {
{
newname = "New section name",
targetname = "Original section name",
builddata = function(vanillaparams) end,
buildfunction = function(vanillaparams, builddata) end,
},
},
replace = {
{
newname = "New name to replace or the original section name",
targetname = "Original section name",
builddata = function(vanillaparams) end,
buildfunction = function(vanillaparams, builddata) end,
},
},
}
end)
框架会取得 menu.setupLoadoutInfoSubmenuRows 的函数实例及其参数,并将参数打包后传给相关函数。构建数据函数可以不使用这些参数,但仍会收到它们。
local vanillaparams = {
menu = menu, -- UI 菜单实例引用
mode = mode,
inputtable = inputtable,
inputobject = inputobject,
instance = instance,
}
框架会记录 UI 模组注册以及同一 UI 分区的重复注册,例如:
[Loadout UI][RegisterUI] ...
这些消息仅用于调试,不会解决冲突。
可通过 GetService 获取共享状态或函数。
local service = {
data = {},
GetData = function(...) end,
SetData = function(...) end,
}
LoadoutUI.RegisterService("mod_id", "service_id", service)
local service = LoadoutUI.GetService("service_id")
service.GetData(...)
前往 N 网打开所选文件。安装与下载要求以原作者及平台说明为准。
<!-- aoe-mods-source:nexusmods:x4foundations:2253 -->