/* 文件名:NewItemInfoWindow.nut 路径:Project/NewItemInfoWindow/NewItemInfoWindow.nut 创建日期:2026-01-18 11:22 文件用途: */ class NewItemInfoWindowC extends Rindro_BaseToolClass { //绘制信息Map DrawInfoMap = null; //Script信息 ScriptInfoMap = null; //自定义绘制代理 CustomDrawDelegate = null; Img = Rindro_Image("soulweapon/main.img"); constructor() { DrawInfoMap = {}; ScriptInfoMap = {}; CustomDrawDelegate = {}; Fix(); AddDelegate("测试代理", 28, function(X, Y, Item) { L_sq_DrawCode("灵魂救赎阶段: 1 / 3", X + 6, Y + 15, sq_RGBA(255, 0, 240, 255), 0, 1); L_sq_DrawCode("封印灵魂数: ", X + 6, Y + 30, sq_RGBA(104, 213, 237, 255), 0, 1); L_sq_DrawCode("100%", X + 180, Y + 30, sq_RGBA(255, 119, 0, 255), 0, 1); Img.DrawPng(0, X + 70, Y + 34); Img.DrawPng(1, X + 72, Y + 36); }.bindenv(this), function(Item) { if (Item.GetIndex() == 104000046) return true; return false; }) } //绘制Info function Show(InfoList, EquipAddress, XPos, YPos) { if (!DrawInfoMap.rawin(EquipAddress)) { local ItemObject = Rindro_Item(); ItemObject.LoadByAddress(EquipAddress); ItemObject.ConstructDrawingInformation(InfoList); DrawInfoMap.rawset(EquipAddress, ItemObject); } DrawInfoMap[EquipAddress].Show(XPos, YPos); } function AddDelegate(Name, Height, Func, CheckFunc) { CustomDrawDelegate.rawset(Name, { //代理区域高度 Height = Height, //代理回调函数 Func = Func, //代理条件 CheckFunc = CheckFunc }) } function RemoveDelegate(Name) { CustomDrawDelegate.rawdelete(Name); } function Fix() { NativePointer(0xF363D9).writeByteArray(array(16, 0x90)) Rindro_Haker.LoadHook(0xF363D0, ["int", "int", "int", "void"], function(args) { //先获取到 DrawItemContent_F36110 的 a3参数 local a3 = L_sq_P2I(Rindro_Haker.CpuContext.ecx) + 0x17c; //计算 //数据头尾指针 一个元素 72字节 local Start = NativePointer(a3).add(0x4).readInt(); local End = NativePointer(a3).add(0x8).readInt(); //数据数组长度 local Length = ((End - Start) / 72); //原数据 local InfoList = []; //获取装备编号 (遍历所有数据块 找到标志位 读取装备指针) local EquipAddress = 0; for (local i = 1; i< Length; i++) { local Info = {}; local Str = null; if (NativePointer(Start).add(72 * i + 0x24).readInt()< 8) { local StrPointer = NativePointer(Start).add(72 * i + 0x10); if (L_sq_P2I(StrPointer.C_Object) > 0x400000) { Str = StrPointer.readUnicodeString(); } } else { local StrPointer = NativePointer(Start).add(72 * i + 0x10).readInt(); if (StrPointer > 0x400000) { Str = NativePointer(StrPointer).readUnicodeString(); } } Info.Str <- Str; Info.Flag <- NativePointer(Start).add(72 * i).readInt(); local Pos = NativePointer(Start).add(72 * i + 0x4).readInt(); local Color = NativePointer(Start).add(72 * i + 0x8).readInt(); //特殊的位置信息 作为标志位的时候 颜色是装备指针 if (Pos == 947330670) { EquipAddress = Color; } Info.Color <- Color; InfoList.append(Info); } if (EquipAddress != 0) { // printf("装备编号: " + NativePointer(EquipAddress).add(0x1c).readInt()); local XPos = NativePointer(L_sq_P2I(Rindro_Haker.CpuContext.esi) + 0x14).readInt(); local YPos = NativePointer(L_sq_P2I(Rindro_Haker.CpuContext.esi) + 0x18).readInt(); Show(InfoList, EquipAddress, XPos, YPos); //HOOK原逻辑不执行 NativePointer(0xF363D9).writeByteArray(array(16, 0x90)) } return null; }.bindenv(this), function(args) { //还原原逻辑 NativePointer(0xF363D9).writeByteArray([0x80, 0xBE, 0x90, 0x01, 0x00, 0x00, 0x00, 0x74, 0x0E, 0xC6, 0x86, 0x90, 0x01, 0x00, 0x00, 0x00]); return null; }.bindenv(this)); //构造信息时 Rindro_Haker.LoadHook(0xF542F0, ["int", "int", "int", "int", "int"], function(args) { //找到新增分割线的构造时机 将标志位写入位置参数 将Item地址写入颜色参数 if (args[0] > 0) { if (NativePointer(args[1]).readUnicodeString().len() <= 0) { local EquipmentAddress = NativePointer(Rindro_Haker.CpuContext.ecx).add(0x178).readInt(); //是装备才做这个事 if (NativePointer(EquipmentAddress).add(0x4).readInt() == 2) { args[2] = 947330670; args[3] = EquipmentAddress; return args; } } } }.bindenv(this), function(args) { return null; }.bindenv(this)); } } getroottable().rawdelete("NewItemInfoWindow_Obj"); function Lenheart_NewItemInfoWindow_Fun(obj) { local RootTab = getroottable(); if (!RootTab.rawin("NewItemInfoWindow_Obj")) { RootTab.rawset("NewItemInfoWindow_Obj", NewItemInfoWindowC()); } } getroottable()["LenheartFuncTab"].rawset("NewItemInfoWindowFuncN", Lenheart_NewItemInfoWindow_Fun);