From e3add47a712b40a3b74e7db1c2599fde74574b71 Mon Sep 17 00:00:00 2001 From: Lenheart <947330670@qq.com> Date: Wed, 10 Dec 2025 14:41:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=9E=8D=E5=90=88=E8=A3=85=E5=A4=87=E6=9B=B4?= =?UTF-8?q?=E6=96=B0NPC=E6=B3=A8=E5=86=8C=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project/ItemTool/ItemFusion/ItemFusion.nut | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/Project/ItemTool/ItemFusion/ItemFusion.nut b/Project/ItemTool/ItemFusion/ItemFusion.nut index 4a739aa..c2ed676 100644 --- a/Project/ItemTool/ItemFusion/ItemFusion.nut +++ b/Project/ItemTool/ItemFusion/ItemFusion.nut @@ -103,6 +103,7 @@ class ItemFusionC extends LenheartNewUI_Windows { AniFlag = false; SoundFlag = false; + NPCList = null; Msg = 0; @@ -115,6 +116,8 @@ class ItemFusionC extends LenheartNewUI_Windows { RegisterWidget(); LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + InifPvf(); + RegNpc(); DiscardItemCallBackFunc.rawset("RecoveryC", DiscardItem.bindenv(this)); @@ -310,12 +313,63 @@ class ItemFusionC extends LenheartNewUI_Windows { } 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 <- []; getroottable().rawdelete("LenheartPluginsInitFlag"); getroottable().rawdelete("EventList_Obj") getroottable().rawdelete("ItemFusion_Obj"); +getroottable().rawdelete("L_Each_Obj"); function Lenheart_ItemFusion_Fun(obj) { local RootTab = getroottable();