新的Item绘制
This commit is contained in:
parent
21d18deac6
commit
baea2ffbfc
|
|
@ -131,6 +131,8 @@ class Rindro_Item_DrawInfo {
|
||||||
GuidanceInformation = null;
|
GuidanceInformation = null;
|
||||||
//指导信息标志位
|
//指导信息标志位
|
||||||
GuidanceInformationFlag = 0;
|
GuidanceInformationFlag = 0;
|
||||||
|
//分割线计数
|
||||||
|
GuidanceDivCount = 0;
|
||||||
//信息
|
//信息
|
||||||
InfoList = null;
|
InfoList = null;
|
||||||
|
|
||||||
|
|
@ -149,12 +151,11 @@ class Rindro_Item_DrawInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Init() {
|
function Init() {
|
||||||
|
|
||||||
//读取强化等级
|
//读取强化等级
|
||||||
local UpgradeLevel = Item.GetUpgrade();
|
local UpgradeLevel = Item.GetUpgrade();
|
||||||
//读取名字
|
//读取名字
|
||||||
local Name = Item.GetName();
|
local Name = Item.GetName();
|
||||||
local UpgradeStr = UpgradeLevel > 0 ? (UpgradeLevel + " ") : "";
|
local UpgradeStr = UpgradeLevel > 0 ? ("+" + UpgradeLevel + " ") : "";
|
||||||
local NameStr = Name.len() > 0 ? (Name + " ") : "未定名";
|
local NameStr = Name.len() > 0 ? (Name + " ") : "未定名";
|
||||||
|
|
||||||
AddContent((UpgradeStr + Name), Padding, Padding, Rindro_BaseToolClass.GetRarityColor(Item.GetRarity()));
|
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);
|
AddContent(RealStr, 215 - StrLength - Padding, 0, info.Color);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
GuidanceDivCount++;
|
||||||
AddDividing(26, 15);
|
AddDividing(26, 15);
|
||||||
//第二道分割线下面
|
//第二道分割线下面
|
||||||
if (GuidanceInformationFlag > 4) {
|
if (GuidanceDivCount > 1) {
|
||||||
//有自定义的代理内容则添加
|
//有自定义的代理内容则添加
|
||||||
if (getroottable()["NewItemInfoWindow_Obj"].CustomDrawDelegate.len() > 0) {
|
if (getroottable()["NewItemInfoWindow_Obj"].CustomDrawDelegate.len() > 0) {
|
||||||
//真正达成条件需要代理的Item
|
//真正达成条件需要代理的Item
|
||||||
|
|
@ -207,6 +209,7 @@ class Rindro_Item_DrawInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//增加内容
|
//增加内容
|
||||||
function AddContent(Content, X, Y, Color) {
|
function AddContent(Content, X, Y, Color) {
|
||||||
InfoList.append({
|
InfoList.append({
|
||||||
|
|
|
||||||
|
|
@ -13,27 +13,18 @@ class NewItemInfoWindowC extends Rindro_BaseToolClass {
|
||||||
//Script信息
|
//Script信息
|
||||||
ScriptInfoMap = null;
|
ScriptInfoMap = null;
|
||||||
|
|
||||||
|
//需要添加绘制HOOK的List
|
||||||
|
NeedDrawHookList = null;
|
||||||
|
|
||||||
//自定义绘制代理
|
//自定义绘制代理
|
||||||
CustomDrawDelegate = null;
|
CustomDrawDelegate = null;
|
||||||
|
|
||||||
Img = Rindro_Image("soulweapon/main.img");
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
DrawInfoMap = {};
|
DrawInfoMap = {};
|
||||||
ScriptInfoMap = {};
|
ScriptInfoMap = {};
|
||||||
CustomDrawDelegate = {};
|
CustomDrawDelegate = {};
|
||||||
|
NeedDrawHookList = {};
|
||||||
Fix();
|
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);
|
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) {
|
function AddDelegate(Name, Height, Func, CheckFunc) {
|
||||||
CustomDrawDelegate.rawset(Name, {
|
CustomDrawDelegate.rawset(Name, {
|
||||||
//代理区域高度
|
//代理区域高度
|
||||||
|
|
@ -59,10 +60,18 @@ class NewItemInfoWindowC extends Rindro_BaseToolClass {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function AddHookItemId(Index) {
|
||||||
|
NeedDrawHookList.rawset(Index, true);
|
||||||
|
}
|
||||||
|
|
||||||
function RemoveDelegate(Name) {
|
function RemoveDelegate(Name) {
|
||||||
CustomDrawDelegate.rawdelete(Name);
|
CustomDrawDelegate.rawdelete(Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function RemoveHookItemId(Index) {
|
||||||
|
NeedDrawHookList.rawdelete(Index);
|
||||||
|
}
|
||||||
|
|
||||||
function Fix() {
|
function Fix() {
|
||||||
NativePointer(0xF363D9).writeByteArray(array(16, 0x90))
|
NativePointer(0xF363D9).writeByteArray(array(16, 0x90))
|
||||||
Rindro_Haker.LoadHook(0xF363D0, ["int", "int", "int", "void"],
|
Rindro_Haker.LoadHook(0xF363D0, ["int", "int", "int", "void"],
|
||||||
|
|
@ -136,7 +145,8 @@ class NewItemInfoWindowC extends Rindro_BaseToolClass {
|
||||||
if (NativePointer(args[1]).readUnicodeString().len() <= 0) {
|
if (NativePointer(args[1]).readUnicodeString().len() <= 0) {
|
||||||
local EquipmentAddress = NativePointer(Rindro_Haker.CpuContext.ecx).add(0x178).readInt();
|
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[2] = 947330670;
|
||||||
args[3] = EquipmentAddress;
|
args[3] = EquipmentAddress;
|
||||||
return args;
|
return args;
|
||||||
|
|
@ -153,6 +163,7 @@ class NewItemInfoWindowC extends Rindro_BaseToolClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getroottable().rawdelete("NewItemInfoWindow_Obj");
|
getroottable().rawdelete("NewItemInfoWindow_Obj");
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -161,6 +172,7 @@ function Lenheart_NewItemInfoWindow_Fun(obj) {
|
||||||
if (!RootTab.rawin("NewItemInfoWindow_Obj")) {
|
if (!RootTab.rawin("NewItemInfoWindow_Obj")) {
|
||||||
RootTab.rawset("NewItemInfoWindow_Obj", NewItemInfoWindowC());
|
RootTab.rawset("NewItemInfoWindow_Obj", NewItemInfoWindowC());
|
||||||
}
|
}
|
||||||
|
RootTab["NewItemInfoWindow_Obj"].Proc();
|
||||||
}
|
}
|
||||||
|
|
||||||
getroottable()["LenheartFuncTab"].rawset("NewItemInfoWindowFuncN", Lenheart_NewItemInfoWindow_Fun);
|
getroottable()["LenheartBaseFuncTab"].rawset("NewItemInfoWindowFuncN", Lenheart_NewItemInfoWindow_Fun);
|
||||||
Loading…
Reference in New Issue