From a11458d226ec41caa22d30b6d76893362389e3e1 Mon Sep 17 00:00:00 2001 From: Lenheart <947330670@qq.com> Date: Wed, 17 Dec 2025 19:08:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A3=85=E5=A4=87=E8=9E=8D?= =?UTF-8?q?=E5=90=88=E4=BD=BF=E7=94=A8=E6=96=B0=E7=89=88slot=E6=A7=BD=20?= =?UTF-8?q?=E5=8F=AF=E9=A2=84=E8=A7=88=E8=9E=8D=E5=90=88=E5=90=8E=E8=A3=85?= =?UTF-8?q?=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Base/UI/Lenheart_UI_Class.nut | 6 -- Project/ItemTool/ItemFusion/ItemFusion.nut | 101 ++++++++++++--------- 2 files changed, 59 insertions(+), 48 deletions(-) diff --git a/Base/UI/Lenheart_UI_Class.nut b/Base/UI/Lenheart_UI_Class.nut index de0c57d..19f3ba9 100644 --- a/Base/UI/Lenheart_UI_Class.nut +++ b/Base/UI/Lenheart_UI_Class.nut @@ -1535,12 +1535,6 @@ class LenheartNewUI_ItemSlot extends LenheartNewUI_CommonUi { } } } - //悬停光效 - if (isInRect) { - L_sq_SetDrawImgModel(2, 0); - Rindro_Image_GlobalMap["lenheartui"].DrawPng(353, X - 2, Y - 2); - L_sq_ReleaseDrawImgModel(); - } } function SetItem(item) { diff --git a/Project/ItemTool/ItemFusion/ItemFusion.nut b/Project/ItemTool/ItemFusion/ItemFusion.nut index 84128c5..7c27ba8 100644 --- a/Project/ItemTool/ItemFusion/ItemFusion.nut +++ b/Project/ItemTool/ItemFusion/ItemFusion.nut @@ -5,11 +5,11 @@ 文件用途: */ -class ItemFusionC_ItemSlot extends LenheartNewUI_CommonUi { +class ItemFusionC_ItemSlot extends LenheartNewUI_ItemSlot { WindowImg = Rindro_Image("interface2/itemtoolwindow/itemfusion/itemfusion.img"); - Item = null; + ItemInfo = null; //覆写悬停Flag HoverFlag = false; @@ -18,20 +18,19 @@ class ItemFusionC_ItemSlot extends LenheartNewUI_CommonUi { UseFlag = true; constructor(X, Y) { - LenheartNewUI_CommonUi.constructor(X, Y, 46, 47); + LenheartNewUI_ItemSlot.constructor(X, Y); } - function Show(obj) { - WindowImg.DrawPng(9, X, Y); + WindowImg.DrawPng(9, X - 9, Y - 10); + LenheartNewUI_ItemSlot.Show(obj); - - //如果槽里面有道具 绘制道具 - if (Item) { - if (Item.rawin("itemAddress")) Parent.TemporaryDrawItemAddress = Item.itemAddress; - Parent.DrawItemBase(X + 9, Y + 10, Item.itemId, 1); - if (Item.rawin("itemAddress")) Parent.TemporaryDrawItemAddress = null; - } + // //如果槽里面有道具 绘制道具 + // if (Item) { + // if (Item.rawin("itemAddress")) Parent.TemporaryDrawItemAddress = Item.itemAddress; + // Parent.DrawItemBase(X + 9, Y + 10, Item.itemId, 1); + // if (Item.rawin("itemAddress")) Parent.TemporaryDrawItemAddress = null; + // } CheckInRect(); @@ -40,10 +39,10 @@ class ItemFusionC_ItemSlot extends LenheartNewUI_CommonUi { function CheckInRect() { local MousePos_X = IMouse.GetXPos(); local MousePos_Y = IMouse.GetYPos(); - if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X + 9, Y + 10, 24, 24)) { + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, 30, 30)) { //绘制悬停框 L_sq_SetDrawImgModel(2, 0); - Rindro_Image_GlobalMap["lenheartui"].DrawPng(353, X + 8, Y + 8); + Rindro_Image_GlobalMap["lenheartui"].DrawPng(353, X, Y); L_sq_ReleaseDrawImgModel(); HoverFlag = true; } else HoverFlag = false; @@ -59,30 +58,32 @@ class ItemFusionC_ItemSlot extends LenheartNewUI_CommonUi { function DiscardItem(info) { if (HoverFlag) { if (info) { - Item = info; - + local ItemObject = Rindro_Item(); + ItemObject.LoadByAddress(info.itemAddress); + ItemInfo = info; + SetItem(ItemObject); } return true; } } - //鼠标右键按下回调 - function OnMouseRbDown(MousePos_X, MousePos_Y) { - if (!UseFlag) return; - if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X + 9, Y + 10, 24, 24)) { - Item = null; - if (Parent.ItemInfoDrawS) { - L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0); - Parent.ItemInfoDrawS = null; - Parent.ResetFocus(); - } - if (Parent.Slot[2].Item != null) { - Parent.Msg = 0; - Parent.Slot[2].Item = null; - } - } - } + // //鼠标右键按下回调 + // function OnMouseRbDown(MousePos_X, MousePos_Y) { + // if (!UseFlag) return; + // if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X + 9, Y + 10, 24, 24)) { + // Item = null; + // if (Parent.ItemInfoDrawS) { + // L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0); + // Parent.ItemInfoDrawS = null; + // Parent.ResetFocus(); + // } + // if (Parent.Slot[2].Item != null) { + // Parent.Msg = 0; + // Parent.Slot[2].Item = null; + // } + // } + // } } class ItemFusionC extends LenheartNewUI_Windows { @@ -93,7 +94,7 @@ class ItemFusionC extends LenheartNewUI_Windows { // NoWindow = true; //是否可见 - Visible = false; + // Visible = false; Slot = null; @@ -125,10 +126,26 @@ class ItemFusionC extends LenheartNewUI_Windows { local Jso = Json.Decode(Chunk); Msg = Jso.msg; if (Jso.rawin("value")) { - print(Jso.value[0]); - Slot[2].Item = { - itemId = Jso.value[0] - } + //构造一个新装备 + local ItemObject = Rindro_Item(); + ItemObject.LoadById(Jso.value[0]); + + //读取 + local MaterialItemObject = Slot[0].ItemObject; + local Upgrade = MaterialItemObject.GetUpgrade(); + local Amplification = MaterialItemObject.GetAmplification(); + local Forging = MaterialItemObject.GetForging(); + local ForgingAttribute = MaterialItemObject.GetForgingAttribute(); + local Enchanting = MaterialItemObject.GetEnchanting(); + + ItemObject.SetUpgrade(Upgrade); + ItemObject.SetAmplification(Amplification); + ItemObject.SetForging(Forging); + ItemObject.SetForgingAttribute(ForgingAttribute); + ItemObject.SetEnchanting(Enchanting); + + // Item = ItemObject; + Slot[2].SetItem(ItemObject); } }.bindenv(this)); @@ -191,7 +208,7 @@ class ItemFusionC extends LenheartNewUI_Windows { AddChild(ConfirmButton); //创建槽 - Slot = [ItemFusionC_ItemSlot(49, 58), ItemFusionC_ItemSlot(150, 58), ItemFusionC_ItemSlot(99, 182)]; + Slot = [ItemFusionC_ItemSlot(58, 68), ItemFusionC_ItemSlot(159, 68), ItemFusionC_ItemSlot(108, 192)]; foreach(value in Slot) { AddChild(value); } @@ -213,7 +230,7 @@ class ItemFusionC extends LenheartNewUI_Windows { local SlotEnableCount = 0; for (local i = 0; i< 2; i++) { local value = Slot[i]; - if (value.Item != null) SlotEnableCount++; + if (value.ItemInfo != null) SlotEnableCount++; } WindowImg.DrawPng(0 + SlotEnableCount, X + 8, Y + 30); WindowImg.DrawPng(3, X + 8, Y + 32); @@ -280,11 +297,11 @@ class ItemFusionC extends LenheartNewUI_Windows { local Ret = Value.DiscardItem(info); if (Ret) { R_Utils.PlaySound("CHANGE_ALERT"); - if (Slot[0].Item && Slot[1].Item) { + if (Slot[0].ItemInfo && Slot[1].ItemInfo) { local T = { op = 21006001, - item1 = Slot[0].Item, - item2 = Slot[1].Item, + item1 = Slot[0].ItemInfo, + item2 = Slot[1].ItemInfo, } SendPackEx(T); }