更新装备融合使用新版slot槽 可预览融合后装备

This commit is contained in:
Lenheart 2025-12-17 19:08:18 +08:00
parent 66a3e9f49b
commit a11458d226
2 changed files with 59 additions and 48 deletions

View File

@ -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) { function SetItem(item) {

View File

@ -5,11 +5,11 @@
文件用途: 文件用途:
*/ */
class ItemFusionC_ItemSlot extends LenheartNewUI_CommonUi { class ItemFusionC_ItemSlot extends LenheartNewUI_ItemSlot {
WindowImg = Rindro_Image("interface2/itemtoolwindow/itemfusion/itemfusion.img"); WindowImg = Rindro_Image("interface2/itemtoolwindow/itemfusion/itemfusion.img");
Item = null; ItemInfo = null;
//覆写悬停Flag //覆写悬停Flag
HoverFlag = false; HoverFlag = false;
@ -18,20 +18,19 @@ class ItemFusionC_ItemSlot extends LenheartNewUI_CommonUi {
UseFlag = true; UseFlag = true;
constructor(X, Y) { constructor(X, Y) {
LenheartNewUI_CommonUi.constructor(X, Y, 46, 47); LenheartNewUI_ItemSlot.constructor(X, Y);
} }
function Show(obj) { function Show(obj) {
WindowImg.DrawPng(9, X, Y); WindowImg.DrawPng(9, X - 9, Y - 10);
LenheartNewUI_ItemSlot.Show(obj);
// //如果槽里面有道具 绘制道具
//如果槽里面有道具 绘制道具 // if (Item) {
if (Item) { // if (Item.rawin("itemAddress")) Parent.TemporaryDrawItemAddress = Item.itemAddress;
if (Item.rawin("itemAddress")) Parent.TemporaryDrawItemAddress = Item.itemAddress; // Parent.DrawItemBase(X + 9, Y + 10, Item.itemId, 1);
Parent.DrawItemBase(X + 9, Y + 10, Item.itemId, 1); // if (Item.rawin("itemAddress")) Parent.TemporaryDrawItemAddress = null;
if (Item.rawin("itemAddress")) Parent.TemporaryDrawItemAddress = null; // }
}
CheckInRect(); CheckInRect();
@ -40,10 +39,10 @@ class ItemFusionC_ItemSlot extends LenheartNewUI_CommonUi {
function CheckInRect() { function CheckInRect() {
local MousePos_X = IMouse.GetXPos(); local MousePos_X = IMouse.GetXPos();
local MousePos_Y = IMouse.GetYPos(); 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); 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(); L_sq_ReleaseDrawImgModel();
HoverFlag = true; HoverFlag = true;
} else HoverFlag = false; } else HoverFlag = false;
@ -59,30 +58,32 @@ class ItemFusionC_ItemSlot extends LenheartNewUI_CommonUi {
function DiscardItem(info) { function DiscardItem(info) {
if (HoverFlag) { if (HoverFlag) {
if (info) { if (info) {
Item = info; local ItemObject = Rindro_Item();
ItemObject.LoadByAddress(info.itemAddress);
ItemInfo = info;
SetItem(ItemObject);
} }
return true; return true;
} }
} }
//鼠标右键按下回调 // //鼠标右键按下回调
function OnMouseRbDown(MousePos_X, MousePos_Y) { // function OnMouseRbDown(MousePos_X, MousePos_Y) {
if (!UseFlag) return; // if (!UseFlag) return;
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 + 9, Y + 10, 24, 24)) {
Item = null; // Item = null;
if (Parent.ItemInfoDrawS) { // if (Parent.ItemInfoDrawS) {
L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0); // L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0);
Parent.ItemInfoDrawS = null; // Parent.ItemInfoDrawS = null;
Parent.ResetFocus(); // Parent.ResetFocus();
} // }
if (Parent.Slot[2].Item != null) { // if (Parent.Slot[2].Item != null) {
Parent.Msg = 0; // Parent.Msg = 0;
Parent.Slot[2].Item = null; // Parent.Slot[2].Item = null;
} // }
} // }
} // }
} }
class ItemFusionC extends LenheartNewUI_Windows { class ItemFusionC extends LenheartNewUI_Windows {
@ -93,7 +94,7 @@ class ItemFusionC extends LenheartNewUI_Windows {
// NoWindow = true; // NoWindow = true;
//是否可见 //是否可见
Visible = false; // Visible = false;
Slot = null; Slot = null;
@ -125,10 +126,26 @@ class ItemFusionC extends LenheartNewUI_Windows {
local Jso = Json.Decode(Chunk); local Jso = Json.Decode(Chunk);
Msg = Jso.msg; Msg = Jso.msg;
if (Jso.rawin("value")) { if (Jso.rawin("value")) {
print(Jso.value[0]); //构造一个新装备
Slot[2].Item = { local ItemObject = Rindro_Item();
itemId = Jso.value[0] 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)); }.bindenv(this));
@ -191,7 +208,7 @@ class ItemFusionC extends LenheartNewUI_Windows {
AddChild(ConfirmButton); 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) { foreach(value in Slot) {
AddChild(value); AddChild(value);
} }
@ -213,7 +230,7 @@ class ItemFusionC extends LenheartNewUI_Windows {
local SlotEnableCount = 0; local SlotEnableCount = 0;
for (local i = 0; i< 2; i++) { for (local i = 0; i< 2; i++) {
local value = Slot[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(0 + SlotEnableCount, X + 8, Y + 30);
WindowImg.DrawPng(3, X + 8, Y + 32); WindowImg.DrawPng(3, X + 8, Y + 32);
@ -280,11 +297,11 @@ class ItemFusionC extends LenheartNewUI_Windows {
local Ret = Value.DiscardItem(info); local Ret = Value.DiscardItem(info);
if (Ret) { if (Ret) {
R_Utils.PlaySound("CHANGE_ALERT"); R_Utils.PlaySound("CHANGE_ALERT");
if (Slot[0].Item && Slot[1].Item) { if (Slot[0].ItemInfo && Slot[1].ItemInfo) {
local T = { local T = {
op = 21006001, op = 21006001,
item1 = Slot[0].Item, item1 = Slot[0].ItemInfo,
item2 = Slot[1].Item, item2 = Slot[1].ItemInfo,
} }
SendPackEx(T); SendPackEx(T);
} }