Compare commits
No commits in common. "main" and "backup" have entirely different histories.
|
|
@ -99,11 +99,7 @@ function L_drawMainCustomUI_All() {
|
||||||
// MemoryTool.EncodeMemoryData(0x304bdc00+0x1054,7);
|
// MemoryTool.EncodeMemoryData(0x304bdc00+0x1054,7);
|
||||||
// TTTAAA <- null;
|
// TTTAAA <- null;
|
||||||
|
|
||||||
|
// L_NewWindows("Lenheart", 56, 0x1);
|
||||||
|
|
||||||
// L_NewWindows("Lenheart", 412, 0x1);
|
|
||||||
|
|
||||||
|
|
||||||
// L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], 0x01ADE090, 56, 0, 0);
|
// L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], 0x01ADE090, 56, 0, 0);
|
||||||
// getroottable().Lsnzz <- Clock();
|
// getroottable().Lsnzz <- Clock();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -342,26 +342,6 @@ class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//绘制道具带道具信息
|
|
||||||
function DrawItemObject(X, Y, Object) {
|
|
||||||
if (!Object) return;
|
|
||||||
L_Sq_DrawItem(X, Y, Object.ItemId, Object.Count, 0, 0, 0);
|
|
||||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X, Y, 30, 30)) {
|
|
||||||
//打开道具信息窗口
|
|
||||||
if (!ItemInfoDrawS) {
|
|
||||||
ItemInfoDrawS = L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], L_sq_RA(0x1A5FB20), 275, Object.ItemAddress, 41);
|
|
||||||
//校准道具信息窗口位置
|
|
||||||
L_Sq_CallFunc(0xF3B3B0, "int", FFI_THISCALL, ["int", "int", "int", "int", "int"], ItemInfoDrawS, IMouse.GetXPos(), IMouse.GetYPos(), 28, 28);
|
|
||||||
//我自己UI打开的道具信息窗口需要把渲染队列改为下层 以显示我打开的道具
|
|
||||||
getroottable().WindowsShowABFlag <- false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (ItemInfoDrawS) {
|
|
||||||
L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0);
|
|
||||||
ItemInfoDrawS = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//绘制标题
|
//绘制标题
|
||||||
function DrawWindowTitle(Width) {
|
function DrawWindowTitle(Width) {
|
||||||
|
|
@ -1498,74 +1478,3 @@ class Yosin_ScrollBar {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class LenheartNewUI_ItemSlot extends LenheartNewUI_CommonUi {
|
|
||||||
|
|
||||||
ItemId = null;
|
|
||||||
ItemCount = null;
|
|
||||||
ItemObject = null;
|
|
||||||
ItemInfoWindow = null;
|
|
||||||
|
|
||||||
//禁止点击
|
|
||||||
NoClick = false;
|
|
||||||
|
|
||||||
RemoveCallBack = null;
|
|
||||||
|
|
||||||
constructor(X, Y) {
|
|
||||||
LenheartNewUI_CommonUi.constructor(X, Y, 30, 30);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function Show(obj) {
|
|
||||||
if (ItemObject) {
|
|
||||||
L_Sq_DrawItem(X, Y, ItemId, ItemCount, 0, 0, 0);
|
|
||||||
if (isInRect) {
|
|
||||||
//打开道具信息窗口
|
|
||||||
if (!ItemInfoWindow) {
|
|
||||||
ItemInfoWindow = L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], L_sq_RA(0x1A5FB20), 275, ItemObject.C_Object, 41);
|
|
||||||
//校准道具信息窗口位置
|
|
||||||
L_Sq_CallFunc(0xF3B3B0, "int", FFI_THISCALL, ["int", "int", "int", "int", "int"], ItemInfoWindow, IMouse.GetXPos(), IMouse.GetYPos(), 28, 28);
|
|
||||||
//我自己UI打开的道具信息窗口需要把渲染队列改为下层 以显示我打开的道具
|
|
||||||
getroottable().WindowsShowABFlag <- false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (ItemInfoWindow) {
|
|
||||||
L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0);
|
|
||||||
ItemInfoWindow = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function SetItem(item) {
|
|
||||||
ItemObject = item;
|
|
||||||
ItemId = item.GetIndex();
|
|
||||||
ItemCount = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function RemoveItem()
|
|
||||||
{
|
|
||||||
ItemObject = null;
|
|
||||||
ItemId = null;
|
|
||||||
ItemCount = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function SetRemoveCallBack(Func){
|
|
||||||
RemoveCallBack = Func;
|
|
||||||
}
|
|
||||||
|
|
||||||
//鼠标右键按下回调
|
|
||||||
function OnMouseRbDown(MousePos_X, MousePos_Y) {
|
|
||||||
if(NoClick)return;
|
|
||||||
if (isInRect) {
|
|
||||||
if(ItemObject){
|
|
||||||
RemoveItem();
|
|
||||||
}
|
|
||||||
if (ItemInfoWindow) {
|
|
||||||
L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0);
|
|
||||||
ItemInfoWindow = null;
|
|
||||||
}
|
|
||||||
if(RemoveCallBack)RemoveCallBack(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,371 +0,0 @@
|
||||||
/*
|
|
||||||
文件名:Hacker_RegApi.nut
|
|
||||||
路径:Base/_Tool/Hacker_RegApi.nut
|
|
||||||
创建日期:2024-09-25 18:31
|
|
||||||
文件用途:注册API
|
|
||||||
*/
|
|
||||||
//工具类
|
|
||||||
class R_Utils {
|
|
||||||
|
|
||||||
String = {
|
|
||||||
FindLastSubstring = function(str, substring) {
|
|
||||||
local strLen = str.len();
|
|
||||||
local subLen = substring.len();
|
|
||||||
local lastIndex = -1;
|
|
||||||
for (local i = 0; i <= strLen - subLen; i++) {
|
|
||||||
local found = true;
|
|
||||||
for (local j = 0; j< subLen; j++) {
|
|
||||||
if (str[i + j] != substring[j]) {
|
|
||||||
found = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (found) {
|
|
||||||
lastIndex = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return lastIndex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//播放音效
|
|
||||||
function PlaySound(SoundName) {
|
|
||||||
L_Sq_CallFunc(0x75BD70, "void", FFI_MS_CDECL, ["pointer", "int", "int", "int"], Memory.allocUtf8String(SoundName).C_Object, -1, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//读取文件内容
|
|
||||||
function ReadScript(Path, Size, CodePage) {
|
|
||||||
local ReadPath = L_sq_P2I(Memory.allocUtf8String(Path).C_Object);
|
|
||||||
local Reader = Memory.alloc(Size);
|
|
||||||
local ReadBuffer = L_sq_P2I(Reader.C_Object);
|
|
||||||
L_Sq_CallFunc(0x11A2030, "int", FFI_FASTCALL, ["int", "int", "int", "int", "int", "int"], 0x1D17638, 0, ReadPath, ReadBuffer, 0x100000, 0x19DAF4);
|
|
||||||
|
|
||||||
|
|
||||||
if (CodePage == "utf8")
|
|
||||||
return Reader.readUtf8String();
|
|
||||||
if (CodePage == "unicode")
|
|
||||||
return Reader.readUnicodeString();
|
|
||||||
if (CodePage == "big5")
|
|
||||||
return Reader.readBig5String();
|
|
||||||
}
|
|
||||||
|
|
||||||
//读取文件
|
|
||||||
function GetScriptFileReader(Path, ...) {
|
|
||||||
local AllocSize = 102400;
|
|
||||||
if (vargc > 0) AllocSize = vargv[0];
|
|
||||||
//读取路径
|
|
||||||
local ReadPath = L_sq_P2I(Memory.allocUtf8String(Path).C_Object);
|
|
||||||
//读取缓存
|
|
||||||
local Reader = Memory.alloc(AllocSize);
|
|
||||||
local ReadBuffer = L_sq_P2I(Reader.C_Object);
|
|
||||||
//实际读取大小
|
|
||||||
local ReadSizeer = Memory.alloc(4);
|
|
||||||
local ReadSizeBuffer = L_sq_P2I(ReadSizeer.C_Object);
|
|
||||||
|
|
||||||
local Flag = L_Sq_CallFunc(0x59E3D0, "bool", FFI_MS_CDECL, ["int", "int", "int", "int"], ReadPath, ReadBuffer, AllocSize, ReadSizeBuffer);
|
|
||||||
if (Flag) {
|
|
||||||
return {
|
|
||||||
Buffer = Reader,
|
|
||||||
Size = ReadSizeer.readInt()
|
|
||||||
};
|
|
||||||
} else return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//读取配置表
|
|
||||||
function ReadScriptConfig(Path, Size, ...) {
|
|
||||||
local CodePage = "utf8";
|
|
||||||
if (vargc > 0) CodePage = vargv[0];
|
|
||||||
local Script = R_Utils.ReadScript(Path, Size, CodePage);
|
|
||||||
local Func = compilestring("return " + Script);
|
|
||||||
local Ret = Func();
|
|
||||||
return Ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取一个指定装备的角色对象
|
|
||||||
function GetCharacByEqu(Job, GrowType, Equ) {
|
|
||||||
local Obj = sq_CreateCharacter(Job, GrowType);
|
|
||||||
local ObjAddress = L_Sq_GetObjectAddress(Obj);
|
|
||||||
foreach(value in Equ) {
|
|
||||||
local ItemObject = L_sq_GetItem(value);
|
|
||||||
// L_Sq_CallFunc(0x825570, "void", FFI_THISCALL, ["int", "int"], ObjAddress, ItemObject);
|
|
||||||
L_Sq_CallFunc(0x8265A0, "void", FFI_THISCALL, ["int", "int", "int"], ObjAddress, ItemObject, -1);
|
|
||||||
}
|
|
||||||
return sq_GetCNRDObjectToSQRCharacter(Obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取装备编号的得文件路径
|
|
||||||
function GetEquPath(Equ) {
|
|
||||||
local EquPathAddress = L_Sq_CallFunc(0x1219E80, "int", FFI_THISCALL, ["int", "int"], 0x1d7993c, Equ);
|
|
||||||
if (EquPathAddress) {
|
|
||||||
return NativePointer(EquPathAddress).readUnicodeString();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取Lst文件的返回Array
|
|
||||||
function GetLstArr(Path, Header) {
|
|
||||||
local Arr = [];
|
|
||||||
local LstBuf = R_Utils.GetScriptFileReader(Path);
|
|
||||||
if (LstBuf) {
|
|
||||||
local IO = Sq_Point2Blob(L_sq_P2I(LstBuf.Buffer.C_Object), LstBuf.Size);
|
|
||||||
local i = 2;
|
|
||||||
while (i< LstBuf.Size) {
|
|
||||||
if ((LstBuf.Size - i) >= 10) {
|
|
||||||
IO.seek(i + 6); //内容指示位
|
|
||||||
local FindKey = IO.readn('i');
|
|
||||||
local Key = Rindro_Script.GetBinString(FindKey);
|
|
||||||
if (Key) {
|
|
||||||
local StrFilePath = Header + Key.tolower();
|
|
||||||
Arr.append(StrFilePath);
|
|
||||||
}
|
|
||||||
} else break;
|
|
||||||
i += 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
//通过处理函数获取文件Table
|
|
||||||
function GetFileTableByHandle(Path, Func) {
|
|
||||||
local Data = {};
|
|
||||||
local FileData = R_Utils.GetScriptFileReader(Path);
|
|
||||||
if (FileData) {
|
|
||||||
if (FileData.Size >= 7) {
|
|
||||||
//创建Blob对象
|
|
||||||
local IO = Sq_Point2Blob(L_sq_P2I(FileData.Buffer.C_Object), FileData.Size);
|
|
||||||
//以5为单步从第二位开始遍历字节
|
|
||||||
local i = 2;
|
|
||||||
while (true) {
|
|
||||||
if (i< FileData.Size && FileData.Size - i >= 5) {
|
|
||||||
i = Func(Data, IO, i);
|
|
||||||
} else break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//根据List读取文件地址
|
|
||||||
// Rindro_Haker.LoadHook(0x1219E80, ["int", "int", "int"],
|
|
||||||
// function(args) {
|
|
||||||
// // print(format("%02x", args[0]));
|
|
||||||
|
|
||||||
// // print(args[2]);
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// function(args) {
|
|
||||||
// // print(666);
|
|
||||||
// // print(format("%02x", args.pop()));
|
|
||||||
// // TTTAni <- args.pop();
|
|
||||||
|
|
||||||
|
|
||||||
// // local Path = NativePointer(L_sq_I2P(args.pop())).readUnicodeString();
|
|
||||||
// // if (Path != "character/swordman/weapon/katana/kat_lowkogaras.equ" && Path != "new_elvengard.twn") {
|
|
||||||
// // print(args[0]);
|
|
||||||
// // print(args[1]);
|
|
||||||
// // // print(format("%02x", args[1]));
|
|
||||||
// // print(Path);
|
|
||||||
// // }
|
|
||||||
// return null;
|
|
||||||
// });
|
|
||||||
|
|
||||||
//可能是构造装备以及构造其他东西
|
|
||||||
// Rindro_Haker.LoadHook(0x972220, ["int", "int", "int", "int"],
|
|
||||||
// function(args) {
|
|
||||||
// // print(format("%02x", args[0]));
|
|
||||||
// // local AniPath = NativePointer(L_sq_I2P(args[0])).readUnicodeString();
|
|
||||||
// if (args[0] == 10402) {
|
|
||||||
// print(args[0]);
|
|
||||||
// print(args[1]);
|
|
||||||
// print(args[2]);
|
|
||||||
// }
|
|
||||||
// // print(args[2]);
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// function(args) {
|
|
||||||
// // print(666);
|
|
||||||
// // print(format("%02x", args.pop()));
|
|
||||||
// // TTTAni <- args.pop();
|
|
||||||
// return null;
|
|
||||||
// });
|
|
||||||
|
|
||||||
//绘制字符
|
|
||||||
getroottable().DrawCodeCallBackFunc <- {};
|
|
||||||
getroottable().DrawCodeChangeMap <- {};
|
|
||||||
// Rindro_Haker.LoadHook(0x1206BD0, ["int", "int", "int", "pointer", "int", "void"],
|
|
||||||
// function(args) {
|
|
||||||
// // print("nut:" + format("%02x", args[3]));
|
|
||||||
|
|
||||||
// if (args[3]) {
|
|
||||||
// // for (local i = 0; i< 10000; i++) {
|
|
||||||
// local DrawCode = NativePointer(args[3]).readUnicodeString();
|
|
||||||
|
|
||||||
// if (DrawCode.find("^1^") != null) {
|
|
||||||
|
|
||||||
// args[3] = Str_Ptr("AAAAAA");
|
|
||||||
// args[2] = sq_RGBA(255, 0, 240, 255);;
|
|
||||||
// return args;
|
|
||||||
// }
|
|
||||||
// else if (DrawCode.find("^2^") != null) {
|
|
||||||
// print(DrawCode);
|
|
||||||
|
|
||||||
// args[3] = Str_Ptr("BBBBBB");
|
|
||||||
// args[2] = sq_RGBA(200, 100, 20, 255);;
|
|
||||||
// return args;
|
|
||||||
// }
|
|
||||||
// // if (DrawCode in DrawCodeCallBackFunc)
|
|
||||||
// // DrawCodeCallBackFunc[DrawCode](args);
|
|
||||||
// // }
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// function(args) {
|
|
||||||
// // print(666);
|
|
||||||
// // print(format("%02x", args.pop()));
|
|
||||||
// // TTTAni <- args.pop();
|
|
||||||
// return null;
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
//绘制城镇回调
|
|
||||||
getroottable().DrawTownCallBackFunc <- {};
|
|
||||||
Rindro_Haker.LoadHook(0x1108700, ["int", "void"],
|
|
||||||
function(args) {
|
|
||||||
// print("nut:" + format("%02x", args[3]));
|
|
||||||
// print(format("%02x", args[0]));
|
|
||||||
foreach(Func in DrawTownCallBackFunc) {
|
|
||||||
Func();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
function(args) {
|
|
||||||
// print(666);
|
|
||||||
// print(format("%02x", args.pop()));
|
|
||||||
// TTTAni <- args.pop();
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//顺图
|
|
||||||
function Rindro_Gm_MoveMap(obj) {
|
|
||||||
if (sq_IsKeyDown(OPTION_HOTKEY_PAUSE_IN_TOWER, ENUM_SUBKEY_TYPE_ALL) && RINDROLOCAL) {
|
|
||||||
if (KeyPress.isKeyPress(0)) L_sq_MoveMap(2);
|
|
||||||
if (KeyPress.isKeyPress(1)) L_sq_MoveMap(0);
|
|
||||||
if (KeyPress.isKeyPress(2)) L_sq_MoveMap(3);
|
|
||||||
if (KeyPress.isKeyPress(3)) L_sq_MoveMap(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
getroottable()["LenheartFuncTab"].rawset("Rindro_Gm_MoveMapFuncN", Rindro_Gm_MoveMap);
|
|
||||||
|
|
||||||
|
|
||||||
//丢弃物品回调
|
|
||||||
getroottable().DiscardItemCallBackFunc <- {};
|
|
||||||
|
|
||||||
function Sq_DiscardItem(Item) {
|
|
||||||
local Flag = true;
|
|
||||||
foreach(Func in DiscardItemCallBackFunc) {
|
|
||||||
local Ret = Func(Item);
|
|
||||||
if (!Ret) Flag = false;
|
|
||||||
}
|
|
||||||
return Flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
//从exe获取字符串
|
|
||||||
getroottable()["Sq_GetExeStr_Map"] <- {};
|
|
||||||
|
|
||||||
function Sq_GetExeStr_Event(Index) {
|
|
||||||
if (Index in getroottable()["Sq_GetExeStr_Map"]) {
|
|
||||||
return getroottable()["Sq_GetExeStr_Map"][Index](Index);
|
|
||||||
}
|
|
||||||
return Index;
|
|
||||||
}
|
|
||||||
|
|
||||||
getroottable().DrawAppendCallBackFunc <- {};
|
|
||||||
Rindro_Haker.LoadHook(0x67C560, ["pointer", "int", "int", "int", "int", "void"],
|
|
||||||
function(args) {
|
|
||||||
foreach(Func in DrawAppendCallBackFunc) {
|
|
||||||
Func(args);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
function(args) {
|
|
||||||
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
local Flag = L_Sq_CallFunc(0x59E3D0, "bool", FFI_MS_CDECL, ["int", "int", "int", "int"], ReadPath, ReadBuffer, AllocSize, ReadSizeBuffer);
|
|
||||||
if (Flag) {
|
|
||||||
return {
|
|
||||||
Buffer = Reader,
|
|
||||||
Size = ReadSizeer.readInt()
|
|
||||||
};
|
|
||||||
} else return null;
|
|
||||||
*/
|
|
||||||
|
|
||||||
// HOOK读取AP脚本
|
|
||||||
// Rindro_Haker.LoadHook(0x121A100, ["int", "int", "int", "int", "int","bool"],
|
|
||||||
// function(args) {
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// function(args) {
|
|
||||||
// print(NativePointer(L_sq_I2P(args[1])).readUnicodeString());
|
|
||||||
// if (NativePointer(L_sq_I2P(args[1])).readUnicodeString() == "SQR/../etc/rindro/ancientrelic/ancientrelic.nut") {
|
|
||||||
// printf("加载AP脚本");
|
|
||||||
// local str = "function sq_AddFunctionName(appendage)\n{\n}\n print(778899);";
|
|
||||||
// NativePointer(L_sq_I2P(args[4])).writeInt(str.len());
|
|
||||||
// NativePointer(L_sq_I2P(args[2])).writeByteArray(str);
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// getroottable().onAttackParentCallBackFunc <- {};
|
|
||||||
// Rindro_Haker.LoadHook(0x9CFF50, ["pointer", "int", "int", "int", "int", "int"],
|
|
||||||
// function(args) {
|
|
||||||
// foreach(Func in onAttackParentCallBackFunc) {
|
|
||||||
// Func(args);
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// function(args) {
|
|
||||||
|
|
||||||
// return null;
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// //hook打开窗口
|
|
||||||
// Rindro_Haker.LoadHook(0xE6E070, ["int","int","int","int","void"],
|
|
||||||
// function(args) {
|
|
||||||
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// function(args) {
|
|
||||||
// // print(666);
|
|
||||||
// // print(format("%02x", args.pop()));
|
|
||||||
// // TTTAni <- args.pop();
|
|
||||||
// return null;
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// Rindro_Haker.LoadHook(0xE6E070, ["int", "int", "int", "int", "int"],
|
|
||||||
// function(args) {
|
|
||||||
// print("nut:" + format("%02x", args[0]));
|
|
||||||
// print("nut:" + format("%02x", args[1]));
|
|
||||||
// print("nut:" + format("%02x", args[2]));
|
|
||||||
// print("nut:" + format("%02x", args[3]));
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// function(args) {
|
|
||||||
// // print(666);
|
|
||||||
// // print(format("%02x", args.pop()));
|
|
||||||
// // TTTAni <- args.pop();
|
|
||||||
// return null;
|
|
||||||
// });
|
|
||||||
|
|
@ -40,4 +40,4 @@ function _Hook_Register_Currency_Func_(AddressString, ArgRetArr, TableName) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _Hook_Register_Currency_Func_(0xE6E070, ["int", "int", "int", "int"], "Cb_OpenWindow_");
|
_Hook_Register_Currency_Func_(0xE6E070, ["int", "int", "int", "int"], "Cb_OpenWindow_");
|
||||||
|
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
|
|
||||||
class Rindro_Item {
|
|
||||||
C_Object = null;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function LoadById(Index) {
|
|
||||||
local itemBuffer = Memory.alloc(0xD0);
|
|
||||||
L_Sq_CallFunc(0x65DE50, "pointer", FFI_FASTCALL, ["pointer", "int"], itemBuffer.C_Object, 0); //Fastcall 补位
|
|
||||||
C_Object = L_Sq_CallFunc(0x972220, "int", FFI_MS_CDECL, ["int", "pointer", "int"], Index, itemBuffer.C_Object, 1); //ID 后面的1未知
|
|
||||||
}
|
|
||||||
|
|
||||||
function LoadByAddress(Address) {
|
|
||||||
C_Object = Address;
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取ID
|
|
||||||
function GetIndex() {
|
|
||||||
return NativePointer(C_Object).add(0x1C).readInt();
|
|
||||||
}
|
|
||||||
//设置ID
|
|
||||||
function SetIndex(Index) {
|
|
||||||
NativePointer(C_Object).add(0x1C).writeInt(Index);
|
|
||||||
}
|
|
||||||
//获取强化值
|
|
||||||
function GetUpgrade() {
|
|
||||||
return MemoryTool.DecodeMemoryData(C_Object + 0x1054);
|
|
||||||
}
|
|
||||||
//设置强化值
|
|
||||||
function SetUpgrade(Upgrade) {
|
|
||||||
MemoryTool.EncodeMemoryData(C_Object + 0x1054, Upgrade);
|
|
||||||
}
|
|
||||||
//获取增幅属性
|
|
||||||
function GetAmplification() {
|
|
||||||
return MemoryTool.DecodeMemoryData(C_Object + 0x10A8);
|
|
||||||
}
|
|
||||||
//设置增幅属性
|
|
||||||
function SetAmplification(Amplification) {
|
|
||||||
MemoryTool.EncodeMemoryData(C_Object + 0x10A8, Amplification);
|
|
||||||
}
|
|
||||||
//获取锻造等级
|
|
||||||
function GetForging() {
|
|
||||||
return MemoryTool.DecodeMemoryData(C_Object + 0x10E8);
|
|
||||||
}
|
|
||||||
//设置锻造等级
|
|
||||||
function SetForging(Forging) {
|
|
||||||
MemoryTool.EncodeMemoryData(C_Object + 0x10E8, Forging);
|
|
||||||
}
|
|
||||||
//获取锻造属性
|
|
||||||
function GetForgingAttribute() {
|
|
||||||
return MemoryTool.DecodeMemoryData(C_Object + 0xE1C);
|
|
||||||
}
|
|
||||||
//设置锻造属性
|
|
||||||
function SetForgingAttribute(ForgingAttribute) {
|
|
||||||
MemoryTool.EncodeMemoryData(C_Object + 0xE1C, ForgingAttribute);
|
|
||||||
}
|
|
||||||
//获取附魔卡片ID
|
|
||||||
function GetEnchanting() {
|
|
||||||
return MemoryTool.DecodeMemoryData(C_Object + 0x1084);
|
|
||||||
}
|
|
||||||
//设置附魔卡片ID
|
|
||||||
function SetEnchanting(Enchanting) {
|
|
||||||
MemoryTool.EncodeMemoryData(C_Object + 0x1084, Enchanting);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
"Base/_Tool/Script_Class.nut",
|
"Base/_Tool/Script_Class.nut",
|
||||||
"Base/_Tool/Image_Class.nut",
|
"Base/_Tool/Image_Class.nut",
|
||||||
"Base/_Tool/Animation_Class.nut",
|
"Base/_Tool/Animation_Class.nut",
|
||||||
"Base/_Tool/Item_Class.nut",
|
|
||||||
"Base/CallBack/PackControl.nut",
|
"Base/CallBack/PackControl.nut",
|
||||||
"Base/CallBack/DrawMain.nut",
|
"Base/CallBack/DrawMain.nut",
|
||||||
"Base/CallBack/DrawHudMain.nut",
|
"Base/CallBack/DrawHudMain.nut",
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,28 @@ class ItemCrossoverC extends LenheartNewUI_Windows {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//绘制道具带道具信息
|
||||||
|
function DrawItemObject(X, Y, Object) {
|
||||||
|
if (!Object) return;
|
||||||
|
L_Sq_DrawItem(X, Y, Object.ItemId, Object.Count, 0, 0, 0);
|
||||||
|
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X, Y, 30, 30)) {
|
||||||
|
//打开道具信息窗口
|
||||||
|
if (!ItemInfoDrawS) {
|
||||||
|
ItemInfoDrawS = L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], L_sq_RA(0x1A5FB20), 275, Object.ItemAddress, 41);
|
||||||
|
//校准道具信息窗口位置
|
||||||
|
L_Sq_CallFunc(0xF3B3B0, "int", FFI_THISCALL, ["int", "int", "int", "int", "int"], ItemInfoDrawS, IMouse.GetXPos(), IMouse.GetYPos(), 28, 28);
|
||||||
|
//我自己UI打开的道具信息窗口需要把渲染队列改为下层 以显示我打开的道具
|
||||||
|
getroottable().WindowsShowABFlag <- false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (ItemInfoDrawS) {
|
||||||
|
L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0);
|
||||||
|
ItemInfoDrawS = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function Show(obj) {
|
function Show(obj) {
|
||||||
DrawMain(obj);
|
DrawMain(obj);
|
||||||
LenheartNewUI_Windows.Show(obj);
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
@ -251,7 +273,6 @@ class ItemCrossoverC extends LenheartNewUI_Windows {
|
||||||
}
|
}
|
||||||
|
|
||||||
function RegNpc() {
|
function RegNpc() {
|
||||||
print("REGREGREG")
|
|
||||||
local EachManager = Lenheart_Get_EachObj();
|
local EachManager = Lenheart_Get_EachObj();
|
||||||
foreach(id in NPCList) {
|
foreach(id in NPCList) {
|
||||||
//先清空注册
|
//先清空注册
|
||||||
|
|
@ -289,11 +310,11 @@ class ItemCrossoverC extends LenheartNewUI_Windows {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// L_Windows_List <- [];
|
L_Windows_List <- [];
|
||||||
// getroottable().rawdelete("LenheartPluginsInitFlag");
|
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||||||
// getroottable().rawdelete("EventList_Obj")
|
getroottable().rawdelete("EventList_Obj")
|
||||||
// getroottable().rawdelete("ItemCrossover_Obj");
|
getroottable().rawdelete("ItemCrossover_Obj");
|
||||||
// getroottable().rawdelete("L_Each_Obj");
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
||||||
function Lenheart_ItemCrossover_Fun(obj) {
|
function Lenheart_ItemCrossover_Fun(obj) {
|
||||||
local RootTab = getroottable();
|
local RootTab = getroottable();
|
||||||
|
|
|
||||||
|
|
@ -5,76 +5,84 @@
|
||||||
文件用途:
|
文件用途:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ItemFusionC_ItemSlot extends LenheartNewUI_ItemSlot {
|
class ItemFusionC_ItemSlot extends LenheartNewUI_CommonUi {
|
||||||
|
|
||||||
MyIndex = null;
|
|
||||||
WindowImg = Rindro_Image("interface2/itemtoolwindow/itemfusion/itemfusion.img");
|
WindowImg = Rindro_Image("interface2/itemtoolwindow/itemfusion/itemfusion.img");
|
||||||
|
|
||||||
ItemInfo = null;
|
Item = null;
|
||||||
|
|
||||||
//覆写悬停Flag
|
//覆写悬停Flag
|
||||||
HoverFlag = false;
|
HoverFlag = false;
|
||||||
|
|
||||||
|
//UseFlag
|
||||||
|
UseFlag = true;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
constructor(X, Y, Index) {
|
|
||||||
MyIndex = Index;
|
|
||||||
=======
|
|
||||||
constructor(X, Y) {
|
constructor(X, Y) {
|
||||||
>>>>>>> a11458d226ec41caa22d30b6d76893362389e3e1
|
LenheartNewUI_CommonUi.constructor(X, Y, 46, 47);
|
||||||
LenheartNewUI_ItemSlot.constructor(X, Y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Show(obj) {
|
|
||||||
WindowImg.DrawPng(9, X - 9, Y - 10);
|
|
||||||
LenheartNewUI_ItemSlot.Show(obj);
|
|
||||||
|
|
||||||
// //如果槽里面有道具 绘制道具
|
function Show(obj) {
|
||||||
// if (Item) {
|
WindowImg.DrawPng(9, X, Y);
|
||||||
// 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);
|
||||||
|
}
|
||||||
|
|
||||||
CheckInRect();
|
CheckInRect();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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, Y, 30, 30)) {
|
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X + 9, Y + 10, 24, 24)) {
|
||||||
//绘制悬停框
|
//绘制悬停框
|
||||||
L_sq_SetDrawImgModel(2, 0);
|
L_sq_SetDrawImgModel(2, 0);
|
||||||
Rindro_Image_GlobalMap["lenheartui"].DrawPng(353, X, Y);
|
Rindro_Image_GlobalMap["lenheartui"].DrawPng(353, X + 8, Y + 8);
|
||||||
L_sq_ReleaseDrawImgModel();
|
L_sq_ReleaseDrawImgModel();
|
||||||
HoverFlag = true;
|
HoverFlag = true;
|
||||||
} else HoverFlag = false;
|
} else HoverFlag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//override
|
||||||
|
function OnMouseProc(Flag, MousePos_X, MousePos_Y) {
|
||||||
|
if (!Visible) return;
|
||||||
|
//调用原生方法
|
||||||
|
LenheartNewUI_CommonUi.OnMouseProc(Flag, MousePos_X, MousePos_Y);
|
||||||
|
}
|
||||||
|
|
||||||
function DiscardItem(info) {
|
function DiscardItem(info) {
|
||||||
if (HoverFlag) {
|
if (HoverFlag) {
|
||||||
if (info) {
|
if (info) {
|
||||||
local ItemObject = Rindro_Item();
|
Item = info;
|
||||||
ItemObject.LoadByAddress(info.itemAddress);
|
|
||||||
ItemInfo = info;
|
|
||||||
SetItem(ItemObject);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function RemoveItem() {
|
|
||||||
LenheartNewUI_ItemSlot.RemoveItem();
|
|
||||||
ItemInfo = null;
|
|
||||||
|
|
||||||
if (MyIndex != 2) {
|
//鼠标右键按下回调
|
||||||
Parent.Slot[2].ItemInfo = null;
|
function OnMouseRbDown(MousePos_X, MousePos_Y) {
|
||||||
Parent.Slot[2].RemoveItem();
|
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 {
|
class ItemFusionC extends LenheartNewUI_Windows {
|
||||||
|
|
@ -85,7 +93,7 @@ class ItemFusionC extends LenheartNewUI_Windows {
|
||||||
// NoWindow = true;
|
// NoWindow = true;
|
||||||
|
|
||||||
//是否可见
|
//是否可见
|
||||||
// Visible = false;
|
Visible = false;
|
||||||
|
|
||||||
Slot = null;
|
Slot = null;
|
||||||
|
|
||||||
|
|
@ -117,26 +125,9 @@ 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")) {
|
||||||
//构造一个新装备
|
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));
|
||||||
|
|
||||||
|
|
@ -199,11 +190,11 @@ class ItemFusionC extends LenheartNewUI_Windows {
|
||||||
AddChild(ConfirmButton);
|
AddChild(ConfirmButton);
|
||||||
|
|
||||||
//创建槽
|
//创建槽
|
||||||
Slot = [ItemFusionC_ItemSlot(58, 68, 0), ItemFusionC_ItemSlot(159, 68, 1), ItemFusionC_ItemSlot(108, 192, 2)];
|
Slot = [ItemFusionC_ItemSlot(49, 58), ItemFusionC_ItemSlot(150, 58), ItemFusionC_ItemSlot(99, 182)];
|
||||||
foreach(value in Slot) {
|
foreach(value in Slot) {
|
||||||
AddChild(value);
|
AddChild(value);
|
||||||
}
|
}
|
||||||
Slot[2].NoClick = true;
|
Slot[2].UseFlag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//绘制主界面
|
//绘制主界面
|
||||||
|
|
@ -221,7 +212,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.ItemInfo != null) SlotEnableCount++;
|
if (value.Item != 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);
|
||||||
|
|
@ -288,11 +279,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].ItemInfo && Slot[1].ItemInfo) {
|
if (Slot[0].Item && Slot[1].Item) {
|
||||||
local T = {
|
local T = {
|
||||||
op = 21006001,
|
op = 21006001,
|
||||||
item1 = Slot[0].ItemInfo,
|
item1 = Slot[0].Item,
|
||||||
item2 = Slot[1].ItemInfo,
|
item2 = Slot[1].Item,
|
||||||
}
|
}
|
||||||
SendPackEx(T);
|
SendPackEx(T);
|
||||||
}
|
}
|
||||||
|
|
@ -369,9 +360,6 @@ class ItemFusionC extends LenheartNewUI_Windows {
|
||||||
}
|
}
|
||||||
|
|
||||||
function InitWindow() {
|
function InitWindow() {
|
||||||
foreach (obj in Slot) {
|
|
||||||
obj.RemoveItem();
|
|
||||||
}
|
|
||||||
Visible = true;
|
Visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
创建日期:2025-12-15 15:03
|
创建日期:2025-12-15 15:03
|
||||||
文件用途:
|
文件用途:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ItemInheritC extends LenheartNewUI_Windows {
|
class ItemInheritC extends LenheartNewUI_Windows {
|
||||||
//调试模式
|
//调试模式
|
||||||
// DeBugMode = true;
|
// DeBugMode = true;
|
||||||
|
|
@ -19,58 +18,25 @@ class ItemInheritC extends LenheartNewUI_Windows {
|
||||||
|
|
||||||
Img = Rindro_Image("interface2/ui/newitemtool/newitemtool.img");
|
Img = Rindro_Image("interface2/ui/newitemtool/newitemtool.img");
|
||||||
|
|
||||||
//材料装备
|
|
||||||
MaterialItem = null;
|
|
||||||
MaterialItemSlot = null;
|
|
||||||
//目标装备
|
|
||||||
TargetItem = null;
|
|
||||||
TargetItemSlot = null;
|
|
||||||
//继承结果装备
|
|
||||||
ResultItem = null;
|
|
||||||
ResultItemSlot = null;
|
|
||||||
|
|
||||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
Childrens = [];
|
Childrens = [];
|
||||||
//注册控件
|
//注册控件
|
||||||
RegisterWidget();
|
RegisterWidget();
|
||||||
|
|
||||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
DiscardItemCallBackFunc.rawset("ItemCrossoverC", DiscardItem.bindenv(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function RegisterWidget() {
|
function RegisterWidget() {
|
||||||
//关闭按钮
|
// //关闭按钮
|
||||||
local CloseButton = LenheartNewUI_BaseButton(274, 4, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
// local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
CloseButton.OnClick = function() {
|
// CloseButton.OnClick = function() {
|
||||||
this.Visible = false;
|
// this.Visible = false;
|
||||||
}.bindenv(this);
|
// }.bindenv(this);
|
||||||
Childrens.append(CloseButton);
|
// Childrens.append(CloseButton);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MaterialItemSlot = LenheartNewUI_ItemSlot(56, 87);
|
|
||||||
MaterialItemSlot.SetRemoveCallBack(function(obj) {
|
|
||||||
MaterialItem = null;
|
|
||||||
PlaceItem();
|
|
||||||
}.bindenv(this));
|
|
||||||
AddChild(MaterialItemSlot);
|
|
||||||
|
|
||||||
TargetItemSlot = LenheartNewUI_ItemSlot(211, 87);
|
|
||||||
TargetItemSlot.SetRemoveCallBack(function(obj) {
|
|
||||||
TargetItem = null;
|
|
||||||
PlaceItem();
|
|
||||||
}.bindenv(this));
|
|
||||||
AddChild(TargetItemSlot);
|
|
||||||
|
|
||||||
ResultItemSlot = LenheartNewUI_ItemSlot(133, 132);
|
|
||||||
ResultItemSlot.NoClick = true;
|
|
||||||
// ResultItemSlot.SetItem(ItemR);
|
|
||||||
AddChild(ResultItemSlot);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//绘制主界面
|
//绘制主界面
|
||||||
function DrawMain(obj) {
|
function DrawMain(obj) {
|
||||||
//背景框
|
//背景框
|
||||||
|
|
@ -91,6 +57,7 @@ class ItemInheritC extends LenheartNewUI_Windows {
|
||||||
function Show(obj) {
|
function Show(obj) {
|
||||||
DrawMain(obj);
|
DrawMain(obj);
|
||||||
LenheartNewUI_Windows.Show(obj);
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//逻辑入口
|
//逻辑入口
|
||||||
|
|
@ -98,100 +65,15 @@ class ItemInheritC extends LenheartNewUI_Windows {
|
||||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//遍历背包查找Item
|
|
||||||
function FindItemPosByForeachInven(FindAddress) {
|
|
||||||
local Inven = L_sq_RA(0x1A5FB24);
|
|
||||||
local InvenAdd = L_sq_RA(Inven + 56);
|
|
||||||
InvenAdd += 36;
|
|
||||||
for (local z = 0; z< 5; z++) {
|
|
||||||
for (local i = 0; i< 48; i++) {
|
|
||||||
local ItemAdd = L_sq_RA(InvenAdd + ((i + (z * 48)) * 4));
|
|
||||||
if (ItemAdd == FindAddress) {
|
|
||||||
local NamePointer = L_sq_RA(FindAddress + 0x20);
|
|
||||||
if (z != 0) {
|
|
||||||
if (ItemInfoDrawS) {
|
|
||||||
L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0);
|
|
||||||
ItemInfoDrawS = null;
|
|
||||||
ResetFocus();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
Type = z,
|
|
||||||
Pos = i,
|
|
||||||
Vis = false,
|
|
||||||
Count = MemoryTool.DecodeMemoryData(FindAddress + 0x1A4),
|
|
||||||
ItemId = L_sq_RA(FindAddress + 0x1c),
|
|
||||||
ItemAddress = FindAddress,
|
|
||||||
Name = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString()
|
|
||||||
Rarity = L_sq_RA(FindAddress + 0xF4),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//回收道具回调
|
|
||||||
function DiscardItem(ItemAddress) {
|
|
||||||
local MousePos_X = IMouse.GetXPos();
|
|
||||||
local MousePos_Y = IMouse.GetYPos();
|
|
||||||
if (!sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) return true;
|
|
||||||
if (!Visible) return true;
|
|
||||||
else {
|
|
||||||
local ItemInfo = FindItemPosByForeachInven(ItemAddress);
|
|
||||||
local ItemObject = Rindro_Item();
|
|
||||||
ItemInfo.ItemObject <- ItemObject;
|
|
||||||
ItemObject.LoadByAddress(ItemInfo.ItemAddress);
|
|
||||||
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X + 56, Y + 87, 30, 30)) {
|
|
||||||
MaterialItem = ItemInfo;
|
|
||||||
MaterialItemSlot.SetItem(ItemObject);
|
|
||||||
} else if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X + 211, Y + 87, 30, 30)) {
|
|
||||||
TargetItem = ItemInfo;
|
|
||||||
TargetItemSlot.SetItem(ItemObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
PlaceItem();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//物品被放置的回调
|
|
||||||
function PlaceItem() {
|
|
||||||
//两个都放上去了
|
|
||||||
if (MaterialItem && TargetItem) {
|
|
||||||
//获取材料装备的强化 增幅 附魔 锻造
|
|
||||||
local MaterialItemObject = MaterialItem.ItemObject;
|
|
||||||
local Upgrade = MaterialItemObject.GetUpgrade();
|
|
||||||
local Amplification = MaterialItemObject.GetAmplification();
|
|
||||||
local Forging = MaterialItemObject.GetForging();
|
|
||||||
local ForgingAttribute = MaterialItemObject.GetForgingAttribute();
|
|
||||||
local Enchanting = MaterialItemObject.GetEnchanting();
|
|
||||||
|
|
||||||
//创建一个目标装备
|
|
||||||
ResultItem = Rindro_Item();
|
|
||||||
ResultItem.LoadById(TargetItem.ItemObject.GetIndex());
|
|
||||||
ResultItem.SetUpgrade(Upgrade);
|
|
||||||
ResultItem.SetAmplification(Amplification);
|
|
||||||
ResultItem.SetForging(Forging);
|
|
||||||
ResultItem.SetForgingAttribute(ForgingAttribute);
|
|
||||||
ResultItem.SetEnchanting(Enchanting);
|
|
||||||
ResultItemSlot.SetItem(ResultItem);
|
|
||||||
} else {
|
|
||||||
ResultItem = null;
|
|
||||||
ResultItemSlot.RemoveItem();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// L_Windows_List <- [];
|
L_Windows_List <- [];
|
||||||
// getroottable().rawdelete("LenheartPluginsInitFlag");
|
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||||||
// getroottable().rawdelete("EventList_Obj")
|
getroottable().rawdelete("EventList_Obj")
|
||||||
// getroottable().rawdelete("ItemInherit_Obj");
|
getroottable().rawdelete("ItemInherit_Obj");
|
||||||
// getroottable().rawdelete("L_Each_Obj");
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
||||||
function Lenheart_ItemInherit_Fun(obj) {
|
function Lenheart_ItemInherit_Fun(obj) {
|
||||||
|
|
||||||
sq_IsValidActiveStatus(obj, 1);
|
|
||||||
local RootTab = getroottable();
|
local RootTab = getroottable();
|
||||||
if (!RootTab.rawin("ItemInherit_Obj")) {
|
if (!RootTab.rawin("ItemInherit_Obj")) {
|
||||||
RootTab.rawset("ItemInherit_Obj", true);
|
RootTab.rawset("ItemInherit_Obj", true);
|
||||||
|
|
|
||||||
|
|
@ -364,11 +364,11 @@ class NpcTransactionC extends LenheartNewUI_Windows {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// L_Windows_List <- [];
|
L_Windows_List <- [];
|
||||||
// getroottable().rawdelete("LenheartPluginsInitFlag");
|
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||||||
// getroottable().rawdelete("EventList_Obj")
|
getroottable().rawdelete("EventList_Obj")
|
||||||
// getroottable().rawdelete("NpcTransaction_Obj");
|
getroottable().rawdelete("NpcTransaction_Obj");
|
||||||
// getroottable().rawdelete("L_Each_Obj");
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
||||||
function Lenheart_NpcTransaction_Fun(obj) {
|
function Lenheart_NpcTransaction_Fun(obj) {
|
||||||
local RootTab = getroottable();
|
local RootTab = getroottable();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue