diff --git a/Base/_Tool/Item_Class.nut b/Base/_Tool/Item_Class.nut index ab33cfd..76abc73 100644 --- a/Base/_Tool/Item_Class.nut +++ b/Base/_Tool/Item_Class.nut @@ -131,6 +131,8 @@ class Rindro_Item_DrawInfo { GuidanceInformation = null; //指导信息标志位 GuidanceInformationFlag = 0; + //分割线计数 + GuidanceDivCount = 0; //信息 InfoList = null; @@ -149,12 +151,11 @@ class Rindro_Item_DrawInfo { } function Init() { - //读取强化等级 local UpgradeLevel = Item.GetUpgrade(); //读取名字 local Name = Item.GetName(); - local UpgradeStr = UpgradeLevel > 0 ? (UpgradeLevel + " ") : ""; + local UpgradeStr = UpgradeLevel > 0 ? ("+" + UpgradeLevel + " ") : ""; local NameStr = Name.len() > 0 ? (Name + " ") : "未定名"; AddContent((UpgradeStr + Name), Padding, Padding, Rindro_BaseToolClass.GetRarityColor(Item.GetRarity())); @@ -182,9 +183,10 @@ class Rindro_Item_DrawInfo { AddContent(RealStr, 215 - StrLength - Padding, 0, info.Color); } } else { + GuidanceDivCount++; AddDividing(26, 15); //第二道分割线下面 - if (GuidanceInformationFlag > 4) { + if (GuidanceDivCount > 1) { //有自定义的代理内容则添加 if (getroottable()["NewItemInfoWindow_Obj"].CustomDrawDelegate.len() > 0) { //真正达成条件需要代理的Item @@ -207,6 +209,7 @@ class Rindro_Item_DrawInfo { } } + //增加内容 function AddContent(Content, X, Y, Color) { InfoList.append({ diff --git a/Project/NewItemInfoWindow/NewItemInfoWindow.nut b/Project/NewItemInfoWindow/NewItemInfoWindow.nut index b034896..8745d1e 100644 --- a/Project/NewItemInfoWindow/NewItemInfoWindow.nut +++ b/Project/NewItemInfoWindow/NewItemInfoWindow.nut @@ -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); \ No newline at end of file +getroottable()["LenheartBaseFuncTab"].rawset("NewItemInfoWindowFuncN", Lenheart_NewItemInfoWindow_Fun); \ No newline at end of file