新的Item绘制

This commit is contained in:
2026-02-02 13:30:37 +08:00
parent 21d18deac6
commit baea2ffbfc
2 changed files with 33 additions and 18 deletions

View File

@@ -13,27 +13,18 @@ class NewItemInfoWindowC extends Rindro_BaseToolClass {
//Script信息
ScriptInfoMap = null;
//需要添加绘制HOOK的List
NeedDrawHookList = null;
//自定义绘制代理
CustomDrawDelegate = null;
Img = Rindro_Image("soulweapon/main.img");
constructor() {
DrawInfoMap = {};
ScriptInfoMap = {};
CustomDrawDelegate = {};
NeedDrawHookList = {};
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;
})
}
@@ -48,6 +39,16 @@ class NewItemInfoWindowC extends Rindro_BaseToolClass {
DrawInfoMap[EquipAddress].Show(XPos, YPos);
}
function Proc() {
//鼠标没有悬停东西的时候直接清空绘制信息
if (NativePointer(0x1AE45B4).readInt() == 0) {
DrawInfoMap = {};
}
if (KeyPress.isKeyPress(OPTION_HOTKEY_TOOLTIP_)) {
DrawInfoMap = {};
}
}
function AddDelegate(Name, Height, Func, CheckFunc) {
CustomDrawDelegate.rawset(Name, {
//代理区域高度
@@ -59,10 +60,18 @@ class NewItemInfoWindowC extends Rindro_BaseToolClass {
})
}
function AddHookItemId(Index) {
NeedDrawHookList.rawset(Index, true);
}
function RemoveDelegate(Name) {
CustomDrawDelegate.rawdelete(Name);
}
function RemoveHookItemId(Index) {
NeedDrawHookList.rawdelete(Index);
}
function Fix() {
NativePointer(0xF363D9).writeByteArray(array(16, 0x90))
Rindro_Haker.LoadHook(0xF363D0, ["int", "int", "int", "void"],
@@ -136,7 +145,8 @@ class NewItemInfoWindowC extends Rindro_BaseToolClass {
if (NativePointer(args[1]).readUnicodeString().len() <= 0) {
local EquipmentAddress = NativePointer(Rindro_Haker.CpuContext.ecx).add(0x178).readInt();
//是装备才做这个事
if (NativePointer(EquipmentAddress).add(0x4).readInt() == 2) {
local Id = NativePointer(EquipmentAddress).add(0x1c).readInt();
if (NativePointer(EquipmentAddress).add(0x4).readInt() == 2 || NeedDrawHookList.rawin(Id)) {
args[2] = 947330670;
args[3] = EquipmentAddress;
return args;
@@ -153,6 +163,7 @@ class NewItemInfoWindowC extends Rindro_BaseToolClass {
}
getroottable().rawdelete("NewItemInfoWindow_Obj");
@@ -161,6 +172,7 @@ function Lenheart_NewItemInfoWindow_Fun(obj) {
if (!RootTab.rawin("NewItemInfoWindow_Obj")) {
RootTab.rawset("NewItemInfoWindow_Obj", NewItemInfoWindowC());
}
RootTab["NewItemInfoWindow_Obj"].Proc();
}
getroottable()["LenheartFuncTab"].rawset("NewItemInfoWindowFuncN", Lenheart_NewItemInfoWindow_Fun);
getroottable()["LenheartBaseFuncTab"].rawset("NewItemInfoWindowFuncN", Lenheart_NewItemInfoWindow_Fun);