融合装备更新NPC注册打开

This commit is contained in:
Lenheart 2025-12-10 14:41:47 +08:00
parent 345ac1400d
commit e3add47a71
1 changed files with 54 additions and 0 deletions

View File

@ -103,6 +103,7 @@ class ItemFusionC extends LenheartNewUI_Windows {
AniFlag = false; AniFlag = false;
SoundFlag = false; SoundFlag = false;
NPCList = null;
Msg = 0; Msg = 0;
@ -115,6 +116,8 @@ class ItemFusionC extends LenheartNewUI_Windows {
RegisterWidget(); RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
InifPvf();
RegNpc();
DiscardItemCallBackFunc.rawset("RecoveryC", DiscardItem.bindenv(this)); DiscardItemCallBackFunc.rawset("RecoveryC", DiscardItem.bindenv(this));
@ -310,12 +313,63 @@ class ItemFusionC extends LenheartNewUI_Windows {
} }
return null; return null;
} }
function InifPvf() {
Rindro_Script.GetFileData("etc/rindro/itemtool/itemfusion/itemfusion.etc", function(DataTable, Data) {
while (!Data.Eof()) {
local Fragment = Data.Get();
if (Fragment == "[NPC]") {
NPCList = [];
while (true) {
local Fbuf = Data.Get();
if (Fbuf == "[/NPC]") {
break;
}
NPCList.append(Fbuf);
}
}
}
});
}
function RegNpc() {
local EachManager = getroottable()["L_Each_Obj"];
foreach(id in NPCList) {
//先清空注册
EachManager.RemoveEachForNpc(id);
EachManager.AddEachForNpc(id, function(SThis) {
//关闭按钮
local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3);
ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img";
ApplyEngagementButton.IconIdx = 49;
ApplyEngagementButton.Str = "融合";
ApplyEngagementButton.Data = SThis.NPC_Index;
ApplyEngagementButton.OnClick = function(Button) {
InitWindow();
//打开背包
L_sq_Open_ExWindow(0x1ADE090, 0, 0, 1);
Button.Parent.CloseAllEach();
Button.Parent.CloseWindow();
ResetFocus();
R_Utils.PlaySound("WINDOW_SHOW");
}.bindenv(this);
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
SThis.AddChild(ApplyEngagementButton);
}.bindenv(this));
}
}
function InitWindow() {
Visible = true;
}
} }
L_Windows_List <- []; L_Windows_List <- [];
getroottable().rawdelete("LenheartPluginsInitFlag"); getroottable().rawdelete("LenheartPluginsInitFlag");
getroottable().rawdelete("EventList_Obj") getroottable().rawdelete("EventList_Obj")
getroottable().rawdelete("ItemFusion_Obj"); getroottable().rawdelete("ItemFusion_Obj");
getroottable().rawdelete("L_Each_Obj");
function Lenheart_ItemFusion_Fun(obj) { function Lenheart_ItemFusion_Fun(obj) {
local RootTab = getroottable(); local RootTab = getroottable();