Compare commits
11 Commits
6431e2ef38
...
58c11ab741
| Author | SHA1 | Date |
|---|---|---|
|
|
58c11ab741 | |
|
|
df2ebd6501 | |
|
|
014f519bfc | |
|
|
baea2ffbfc | |
|
|
21d18deac6 | |
|
|
e8f9aa171b | |
|
|
9379203e96 | |
|
|
d8c12f3d52 | |
|
|
4e92ff8140 | |
|
|
58f5d5945c | |
|
|
778f9427f2 |
|
|
@ -86,8 +86,13 @@ function L_drawMainCustomUI_All() {
|
||||||
|
|
||||||
// if (!TTTAAA) TTTAAA = Rindro_Draw_Character(0, [601590000, 1751501, 601500069], "rest.ani", null);
|
// if (!TTTAAA) TTTAAA = Rindro_Draw_Character(0, [601590000, 1751501, 601500069], "rest.ani", null);
|
||||||
// if (TTTAAA) TTTAAA.Draw(120, 200);
|
// if (TTTAAA) TTTAAA.Draw(120, 200);
|
||||||
}
|
|
||||||
|
|
||||||
|
// Rindro_BaseToolClass.DrawNineBox(0, 0, 200, 200, "interface/lenheartwindowcommon.img", 213);
|
||||||
|
|
||||||
|
// print(sq_GetObjectId(obj))
|
||||||
|
// print(Clock());
|
||||||
|
// Rindro_Image_GlobalMap["interface/newstyle/windows/popup/popup.img"].DrawExPng(138, 205, 0, 0, sq_RGBA(255, 255, 255, 250), 13.0, 13.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -135,6 +140,39 @@ function L_drawMainCustomUI_All() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// function drawAppend_VirtualCharacter(a, b, c, d, e, f) {
|
||||||
|
// local obj = sq_GetMyMasterCharacter();
|
||||||
|
// // print(Clock());
|
||||||
|
// // Sout("a: %L",a);
|
||||||
|
// // Sout("b: %L",b);
|
||||||
|
// // Sout("c: %L",c);
|
||||||
|
// // Sout("d: %L",d);
|
||||||
|
// // Sout("e: %L",e);
|
||||||
|
// // Sout("f: %L",f);
|
||||||
|
// // print(a);
|
||||||
|
// // print(b);
|
||||||
|
// // print(c);
|
||||||
|
// // print(d);
|
||||||
|
// // print(e);
|
||||||
|
// // print(f);
|
||||||
|
|
||||||
|
// // print(c);
|
||||||
|
// // print(d);
|
||||||
|
// // L_sq_DrawImg("newtitle/nangua.img", 0, c - 132, d - 360);
|
||||||
|
// // Rindro_BaseToolClass.DrawAniEx(c - 140, d, "etc/rindro/newtitle/ani/chn_2021_chivarly_system3/chivalry_s3_bottom_00.ani");
|
||||||
|
// Rindro_BaseToolClass.DrawAniEx(c, d, "etc/rindro/newtitle/ani/jolin/180607_title_jolin_tsai_normal.ani");
|
||||||
|
// // Rindro_BaseToolClass.DrawAniEx(c, d, "etc/rindro/newtitle/ani/jolin/180607_title_jolin_tsai_dodge.ani");
|
||||||
|
// // if (!e) {
|
||||||
|
// // BasicsDrawTool.T_DrawDynamicAni(obj, "Character/Common/Animation/Aura/chn_2021_chivarly_system3/Chivalry_S3_Bottom_00.ani", c, d, "Server_AuctionSystemTimeP22");
|
||||||
|
// // BasicsDrawTool.T_DrawDynamicAni(obj, "Character/Common/Animation/Aura/chn_2021_chivarly_system3_2/Chivalry_S3_Text.ani", c, d, "Server_AuctionSystemTimeP");
|
||||||
|
// // BasicsDrawTool.T_DrawDynamicAni(obj, "Character/Common/Animation/Aura/chn_2021_chivarly_system3/Chivalry_S3_Text.ani", c, d - 50, "Server_AuctionSystemTimeP2");
|
||||||
|
// // BasicsDrawTool.T_DrawDynamicAni(obj, "Character/Common/Animation/Aura/chn_2021_chivarly_system3_3/Chivalry_S3_Text.ani", c, d - 100, "Server_AuctionSystemTimeP3");
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// local asos = sq_CreateAICharacter(900);
|
// local asos = sq_CreateAICharacter(900);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -188,3 +226,13 @@ function L_drawMainCustomUI_All() {
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// local AddressBuffer = 0x434C1400;
|
||||||
|
// for (local i = 0; i < 500; i++) {
|
||||||
|
// local offAddr = (AddressBuffer + (4 * 100));
|
||||||
|
// local value = MemoryTool.DecodeMemoryData(offAddr);
|
||||||
|
// if(value == 1768383901){
|
||||||
|
// print(i);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
@ -1094,7 +1094,8 @@ class LenheartNewUI_BaseInput extends LenheartNewUI_CommonUi {
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetStr(Value) {
|
function SetStr(Value) {
|
||||||
L_sq_SetInputBoxStr(InputController, Value);
|
str = Value;
|
||||||
|
// L_sq_SetInputBoxStr(InputController, Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,8 +148,7 @@ class Rindro_BaseToolClass {
|
||||||
Pack_Control.rawset(Id, CallBack);
|
Pack_Control.rawset(Id, CallBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
function RegisterHexPack(Id, CallBack)
|
function RegisterHexPack(Id, CallBack) {
|
||||||
{
|
|
||||||
Pack_Hex_Control.rawset(Id, CallBack);
|
Pack_Hex_Control.rawset(Id, CallBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -189,7 +188,29 @@ class Rindro_BaseToolClass {
|
||||||
return ani;
|
return ani;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//高级绘制文字(带换行)
|
||||||
|
function L_sq_DrawCode_ExRN(str, x, y, rgba, mb, jc) {
|
||||||
|
local strarr = [];
|
||||||
|
if (str.find("\\r\\n") == null) {
|
||||||
|
L_sq_DrawCode(str, x, y, rgba, mb, jc);
|
||||||
|
} else {
|
||||||
|
local Bpos = 0;
|
||||||
|
while (true) {
|
||||||
|
local Npos = str.find("\\r\\n", Bpos);
|
||||||
|
if (!Npos) {
|
||||||
|
local strbuff = str.slice(Bpos, str.len());
|
||||||
|
strarr.append(strbuff);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
local strbuff = str.slice(Bpos, Npos);
|
||||||
|
strarr.append(strbuff);
|
||||||
|
Bpos = Npos + 4;
|
||||||
|
}
|
||||||
|
for (local z = 0; z< strarr.len(); z++) {
|
||||||
|
L_sq_DrawCode(strarr[z], x, y + (z * 14), rgba, mb, jc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//初始化根表成员
|
//初始化根表成员
|
||||||
function InitClass(Name) {
|
function InitClass(Name) {
|
||||||
|
|
@ -295,21 +316,28 @@ class Rindro_BaseToolClass {
|
||||||
function GetRarityColor(rarity) {
|
function GetRarityColor(rarity) {
|
||||||
switch (rarity) {
|
switch (rarity) {
|
||||||
case 0:
|
case 0:
|
||||||
return sq_RGBA(255, 255, 255, 255);
|
return 0xFFFFFFFF;
|
||||||
case 1:
|
case 1:
|
||||||
return sq_RGBA(104, 213, 237, 255);
|
return 0xFFEDD568;
|
||||||
case 2:
|
case 2:
|
||||||
return sq_RGBA(179, 107, 254, 255);
|
return 0xFFFF6BB3;
|
||||||
case 3:
|
case 3:
|
||||||
return sq_RGBA(255, 0, 240, 255);
|
return 0xFFF000FF;
|
||||||
case 4:
|
case 4:
|
||||||
return sq_RGBA(255, 177, 0, 255);
|
return 0xFF00B1FF;
|
||||||
case 5:
|
case 5:
|
||||||
return sq_RGBA(255, 102, 102, 255);
|
return 0xFF6666FF;
|
||||||
case 6:
|
case 6:
|
||||||
return sq_RGBA(255, 50, 50, 255);
|
return 0xFF0055FF;
|
||||||
|
case 7:
|
||||||
|
return 0xFF9314FF;
|
||||||
|
case 8:
|
||||||
|
return 0xFF1CBC0C;
|
||||||
|
case 9:
|
||||||
|
return 0xFFACFF08;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//获取文字绘制长度
|
//获取文字绘制长度
|
||||||
class LenheartTextClass {
|
class LenheartTextClass {
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,15 @@ class R_Utils {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取APC编号的文件路径
|
||||||
|
function GetApcPath(ApcIndex) {
|
||||||
|
local ApcPathAddress = L_Sq_CallFunc(0x1219E80, "int", FFI_THISCALL, ["int", "int"], 0x1D90B60, ApcIndex);
|
||||||
|
if (ApcPathAddress) {
|
||||||
|
return NativePointer(ApcPathAddress).readUnicodeString();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
//获取Lst文件的返回Array
|
//获取Lst文件的返回Array
|
||||||
function GetLstArr(Path, Header) {
|
function GetLstArr(Path, Header) {
|
||||||
local Arr = [];
|
local Arr = [];
|
||||||
|
|
@ -341,34 +350,6 @@ Rindro_Haker.LoadHook(0x67C560, ["pointer", "int", "int", "int", "int", "void"],
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// //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;
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
//右边窗口公告
|
//右边窗口公告
|
||||||
|
|
@ -400,7 +381,7 @@ Rindro_Haker.LoadHook(0x7B64BA, ["int", "int", "bool"],
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
function(args) {
|
function(args) {
|
||||||
foreach (Func in WearOrRemoveEquipmentCallBackFunc) {
|
foreach(Func in WearOrRemoveEquipmentCallBackFunc) {
|
||||||
Func(args);
|
Func(args);
|
||||||
}
|
}
|
||||||
// print(666);
|
// print(666);
|
||||||
|
|
@ -410,6 +391,31 @@ Rindro_Haker.LoadHook(0x7B64BA, ["int", "int", "bool"],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
getroottable().WorldDrawVirtualCharacterCallBackFunc <- {};
|
||||||
|
Rindro_Haker.LoadHook(0x80CE30, ["int", "int", "int", "int", "int", "int", "int"],
|
||||||
|
function(args) {
|
||||||
|
local Layer = args[0];
|
||||||
|
local XPos = args[1];
|
||||||
|
local YPos = args[2];
|
||||||
|
local InfoAddress = NativePointer(Rindro_Haker.CpuContext.ecx).add(0x208).readInt();
|
||||||
|
local WorldId = NativePointer(InfoAddress).add(0x4).readUShort();
|
||||||
|
local NameAddress = NativePointer(InfoAddress).add(0x10).readInt();
|
||||||
|
local Name = NativePointer(NameAddress).readUnicodeString();
|
||||||
|
|
||||||
|
foreach(Func in WorldDrawVirtualCharacterCallBackFunc) {
|
||||||
|
Func(Layer, XPos, YPos, WorldId, Name);
|
||||||
|
}
|
||||||
|
// if (Layer == 0 && WorldId == 6)
|
||||||
|
//注意 这里的坐标如果出现负数 说明 在角色在屏幕外 不需要绘制 同理 超过 卷轴最大值也是 (不过性能影响不大直接绘制就行 避免称谓比角色大 突然显示)
|
||||||
|
// printf("绘制层级: " + Layer + " XPos: " + XPos + " YPos: " + YPos + " 角色名: " + Name + " 世界ID: " + WorldId);
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
function(args) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// Rindro_Haker.LoadHook(0x7FFA80, ["int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "void"],
|
// Rindro_Haker.LoadHook(0x7FFA80, ["int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "void"],
|
||||||
// function(args) {
|
// function(args) {
|
||||||
// if(args[0] == 0xA){
|
// if(args[0] == 0xA){
|
||||||
|
|
@ -442,5 +448,3 @@ Rindro_Haker.LoadHook(0x7B64BA, ["int", "int", "bool"],
|
||||||
// NativePointer(0x8266F5).writeShort(0x9090)
|
// NativePointer(0x8266F5).writeShort(0x9090)
|
||||||
// NativePointer(0x78FD37).writeShort(0x9090)
|
// NativePointer(0x78FD37).writeShort(0x9090)
|
||||||
// NativePointer(0x78FD3B).writeShort(0x9090)
|
// NativePointer(0x78FD3B).writeShort(0x9090)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ class Rindro_Image {
|
||||||
}
|
}
|
||||||
Rindro_Image_GlobalMap <- {};
|
Rindro_Image_GlobalMap <- {};
|
||||||
Rindro_Image_GlobalMap["lenheartui"] <- Rindro_Image("interface/lenheartwindowcommon.img");
|
Rindro_Image_GlobalMap["lenheartui"] <- Rindro_Image("interface/lenheartwindowcommon.img");
|
||||||
|
Rindro_Image_GlobalMap["popup"] <- Rindro_Image("interface/newstyle/windows/popup/popup.img");
|
||||||
/*
|
/*
|
||||||
local Png = TestImg.GetPng(0);
|
local Png = TestImg.GetPng(0);
|
||||||
Png.Draw(200, 200);
|
Png.Draw(200, 200);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
class Rindro_Item {
|
class Rindro_Item {
|
||||||
|
//C指针
|
||||||
C_Object = null;
|
C_Object = null;
|
||||||
|
//绘制信息结构体
|
||||||
|
DrawInfo = null;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
||||||
|
|
@ -24,6 +26,15 @@ class Rindro_Item {
|
||||||
function SetIndex(Index) {
|
function SetIndex(Index) {
|
||||||
NativePointer(C_Object).add(0x1C).writeInt(Index);
|
NativePointer(C_Object).add(0x1C).writeInt(Index);
|
||||||
}
|
}
|
||||||
|
//获取名字
|
||||||
|
function GetName() {
|
||||||
|
local NamePointer = NativePointer(C_Object).add(0x20).readInt();
|
||||||
|
return NativePointer(L_sq_I2P(NamePointer)).readUnicodeString();
|
||||||
|
}
|
||||||
|
//获取品级
|
||||||
|
function GetRarity() {
|
||||||
|
return NativePointer(C_Object).add(0xF4).readInt();
|
||||||
|
}
|
||||||
//获取强化值
|
//获取强化值
|
||||||
function GetUpgrade() {
|
function GetUpgrade() {
|
||||||
return MemoryTool.DecodeMemoryData(C_Object + 0x1054);
|
return MemoryTool.DecodeMemoryData(C_Object + 0x1054);
|
||||||
|
|
@ -64,4 +75,175 @@ class Rindro_Item {
|
||||||
function SetEnchanting(Enchanting) {
|
function SetEnchanting(Enchanting) {
|
||||||
MemoryTool.EncodeMemoryData(C_Object + 0x1084, Enchanting);
|
MemoryTool.EncodeMemoryData(C_Object + 0x1084, Enchanting);
|
||||||
}
|
}
|
||||||
|
//读取Uuid
|
||||||
|
function GetUuid() {
|
||||||
|
return NativePointer(C_Object).add(0x206).readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//是否为装备
|
||||||
|
function IsEquip() {
|
||||||
|
return NativePointer(C_Object).add(0x4).readInt() == 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
//是否为消耗品
|
||||||
|
function IsStack() {
|
||||||
|
return NativePointer(C_Object).add(0x4).readInt() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function ConstructDrawingInformation(...) {
|
||||||
|
if (!DrawInfo) {
|
||||||
|
DrawInfo = Rindro_Item_DrawInfo(this);
|
||||||
|
if (vargc > 0) {
|
||||||
|
DrawInfo.AddGuidanceInformation(vargv[0]);
|
||||||
|
}
|
||||||
|
DrawInfo.Init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(X, Y) {
|
||||||
|
//背景框
|
||||||
|
Rindro_BaseToolClass.DrawNineBox(X, Y, 214, DrawInfo.Height + 30, "interface2/common/mypopup/popup.img", 0);
|
||||||
|
// local C_Object = Rindro_Image_GlobalMap["popup"].GetPng(134);
|
||||||
|
// print(C_Object);
|
||||||
|
// L_Sq_CallFunc(0x11DF050, "void", FFI_FASTCALL, ["pointer", "int", "int", "int", "int", "int"], C_Object, 0, 10, 10, 10, 10);
|
||||||
|
|
||||||
|
foreach(info in DrawInfo.InfoList) {
|
||||||
|
//文字
|
||||||
|
if (info.Type == 0) {
|
||||||
|
L_sq_DrawCode(info.Content, X + info.X, Y + info.Y, info.Color, 0, 1);
|
||||||
|
} else if (info.Type == 1) {
|
||||||
|
Rindro_Image_GlobalMap["popup"].DrawPng(270, X + info.X, Y + info.Y);
|
||||||
|
} else if (info.Type == 2) {
|
||||||
|
info.Func(X + info.X, Y + info.Y, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Rindro_Item_DrawInfo {
|
||||||
|
//Item对象
|
||||||
|
Item = null;
|
||||||
|
//指导信息 (原装备生成的信息)
|
||||||
|
GuidanceInformation = null;
|
||||||
|
//指导信息标志位
|
||||||
|
GuidanceInformationFlag = 0;
|
||||||
|
//分割线计数
|
||||||
|
GuidanceDivCount = 0;
|
||||||
|
//信息
|
||||||
|
InfoList = null;
|
||||||
|
|
||||||
|
Height = 0;
|
||||||
|
|
||||||
|
Padding = 8;
|
||||||
|
|
||||||
|
constructor(gItem) {
|
||||||
|
Item = gItem;
|
||||||
|
InfoList = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加指导信息
|
||||||
|
function AddGuidanceInformation(info) {
|
||||||
|
GuidanceInformation = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Init() {
|
||||||
|
//读取强化等级
|
||||||
|
local UpgradeLevel = Item.GetUpgrade();
|
||||||
|
//读取名字
|
||||||
|
local Name = Item.GetName();
|
||||||
|
local UpgradeStr = UpgradeLevel > 0 ? ("+" + UpgradeLevel + " ") : "";
|
||||||
|
local NameStr = Name.len() > 0 ? (Name + " ") : "未定名";
|
||||||
|
|
||||||
|
AddContent((UpgradeStr + Name), Padding, Padding, Rindro_BaseToolClass.GetRarityColor(Item.GetRarity()));
|
||||||
|
|
||||||
|
if (isGm()) {
|
||||||
|
//读取编号
|
||||||
|
local Index = Item.GetIndex();
|
||||||
|
//读取uuid
|
||||||
|
local Uuid = Item.GetUuid();
|
||||||
|
local IndexStr = Index > 0 ? ("编号: [" + Index + "] ") : "";
|
||||||
|
local UuidStr = Uuid > 10000 ? ("uid: [" + Uuid + "] ") : "";
|
||||||
|
AddContent((IndexStr + UuidStr), Padding, 15, 0xffffffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (local i = 1; i< GuidanceInformation.len(); i++) {
|
||||||
|
local info = GuidanceInformation[i];
|
||||||
|
if (info.Str && info.Str.len() > 0) {
|
||||||
|
local RealStr = format(info.Str);
|
||||||
|
if (info.Flag != GuidanceInformationFlag) {
|
||||||
|
AddContent(RealStr, Padding, 15, info.Color);
|
||||||
|
}
|
||||||
|
//说明要绘制在右侧这个左侧信息已经绘制过了
|
||||||
|
else {
|
||||||
|
local StrLength = LenheartTextClass.GetStringLength(RealStr);
|
||||||
|
AddContent(RealStr, 215 - StrLength - Padding, 0, info.Color);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
GuidanceDivCount++;
|
||||||
|
AddDividing(26, 15);
|
||||||
|
//第二道分割线下面
|
||||||
|
if (GuidanceDivCount > 1) {
|
||||||
|
//有自定义的代理内容则添加
|
||||||
|
if (getroottable()["NewItemInfoWindow_Obj"].CustomDrawDelegate.len() > 0) {
|
||||||
|
//真正达成条件需要代理的Item
|
||||||
|
local RealCustomDrawDelegate = [];
|
||||||
|
//先遍历一遍检查条件是否成立
|
||||||
|
foreach(Name, Info in getroottable()["NewItemInfoWindow_Obj"].CustomDrawDelegate) {
|
||||||
|
if (Info.CheckFunc(Item) == true) RealCustomDrawDelegate.append(Info);
|
||||||
|
}
|
||||||
|
//需要代理的项
|
||||||
|
if (RealCustomDrawDelegate.len() > 0) {
|
||||||
|
foreach(Info in RealCustomDrawDelegate) {
|
||||||
|
AddDelegate(Info.Height, Info.Func);
|
||||||
|
}
|
||||||
|
AddDividing(26, 15);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GuidanceInformationFlag = info.Flag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//增加内容
|
||||||
|
function AddContent(Content, X, Y, Color) {
|
||||||
|
InfoList.append({
|
||||||
|
Type = 0,
|
||||||
|
Content = Content,
|
||||||
|
X = X,
|
||||||
|
Y = Y + Height,
|
||||||
|
Color = Color
|
||||||
|
});
|
||||||
|
|
||||||
|
Height += Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
//增加分割线
|
||||||
|
function AddDividing(X, Y) {
|
||||||
|
InfoList.append({
|
||||||
|
Type = 1,
|
||||||
|
X = X,
|
||||||
|
Y = Y + Height + 3,
|
||||||
|
});
|
||||||
|
|
||||||
|
Height += 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
//增加自定义代理
|
||||||
|
function AddDelegate(Y, Func) {
|
||||||
|
InfoList.append({
|
||||||
|
Type = 2,
|
||||||
|
X = 0,
|
||||||
|
Y = Height,
|
||||||
|
Func = Func
|
||||||
|
});
|
||||||
|
Height += Y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getroottable().rawdelete("NewItemInfoWindow_Obj");
|
||||||
|
|
@ -249,7 +249,8 @@ class Rindro_Script {
|
||||||
if (strobj.find(">") != null) {
|
if (strobj.find(">") != null) {
|
||||||
local strobjarr = split(strobj, ">");
|
local strobjarr = split(strobj, ">");
|
||||||
if (strobjarr.len() > 1) {
|
if (strobjarr.len() > 1) {
|
||||||
getroottable().RindroLoadStringTable[Type].rawset(strobjarr[0], Sq_ConvertWideChar(strobjarr[1], "big5"));
|
getroottable().RindroLoadStringTable[Type].rawset(strobjarr[0], strobjarr[1]);
|
||||||
|
// getroottable().RindroLoadStringTable[Type].rawset(strobjarr[0], Sq_ConvertWideChar(strobjarr[1], "big5"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -322,13 +323,10 @@ class Rindro_Script {
|
||||||
local Before = IO.readn('i');
|
local Before = IO.readn('i');
|
||||||
local Buf = Rindro_Script.GetBinString(after);
|
local Buf = Rindro_Script.GetBinString(after);
|
||||||
if (!Buf) {
|
if (!Buf) {
|
||||||
Buf = "";
|
return "";
|
||||||
} else {
|
} else {
|
||||||
Buf = "<" + Before + "::" + Buf + "`" + Rindro_Script.GetLoadString(Type, Buf) + "`>";
|
return Rindro_Script.GetLoadString(Type, Buf);
|
||||||
}
|
}
|
||||||
Buf = Buf + "\r\n";
|
|
||||||
out += Buf;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
IO.seek(-4, 'c');
|
IO.seek(-4, 'c');
|
||||||
|
|
@ -706,7 +704,7 @@ class Rindro_Script {
|
||||||
if (i< Length && Length - i >= 5) {
|
if (i< Length && Length - i >= 5) {
|
||||||
local str = Rindro_Script.UnpackData(IO, i, Type);
|
local str = Rindro_Script.UnpackData(IO, i, Type);
|
||||||
i += 5;
|
i += 5;
|
||||||
DataArr.push(str);
|
if(str != "")DataArr.push(str);
|
||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
Func(DataTable, _PVF_Data_(DataArr));
|
Func(DataTable, _PVF_Data_(DataArr));
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,57 @@
|
||||||
"CSBase/Interface.nut"
|
"CSBase/Interface.nut"
|
||||||
],
|
],
|
||||||
"ProjectScript": {
|
"ProjectScript": {
|
||||||
|
"异界装备升级": {
|
||||||
|
"Private": true,
|
||||||
|
"Script": [
|
||||||
|
"Project/ItemTool/ItemOtherWolrdUpgrade/ItemOtherWolrdUpgrade.nut"
|
||||||
|
],
|
||||||
|
"info": {
|
||||||
|
"ProjectAuthor": "官方 (期限:月)",
|
||||||
|
"ProjectVersion": "1.0.0",
|
||||||
|
"ProjectDescribe": "异界装备升级",
|
||||||
|
"ImageMini": "http://49.234.27.222:8651/dps/download2/Image:chengjiu.png"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"誉名录": {
|
||||||
|
"Private": true,
|
||||||
|
"Script": [
|
||||||
|
"Project/NewTitle/TitleButton.nut",
|
||||||
|
"Project/NewTitle/NewTitle.nut"
|
||||||
|
],
|
||||||
|
"info": {
|
||||||
|
"ProjectAuthor": "官方 (期限:月)",
|
||||||
|
"ProjectVersion": "1.0.0",
|
||||||
|
"ProjectDescribe": "新的称号簿",
|
||||||
|
"ImageMini": "http://49.234.27.222:8651/dps/download2/Image:chengjiu.png"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"新装备信息窗口": {
|
||||||
|
"Private": true,
|
||||||
|
"Script": [
|
||||||
|
"Project/NewItemInfoWindow/NewItemInfoWindow.nut"
|
||||||
|
],
|
||||||
|
"info": {
|
||||||
|
"ProjectAuthor": "官方 (期限:月)",
|
||||||
|
"ProjectVersion": "1.0.0",
|
||||||
|
"ProjectDescribe": "修复道具数量显示",
|
||||||
|
"ImageMini": "http://49.234.27.222:8651/dps/download2/Image:chengjiu.png"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"灵魂救赎武器": {
|
||||||
|
"Private": true,
|
||||||
|
"Script": [
|
||||||
|
"Project/SoulSalvation/SoulSalvation.nut",
|
||||||
|
"Project/SoulSalvation/SoulSalvation_Upgrade.nut",
|
||||||
|
"Project/SoulSalvation/SoulSalvation_Enchant.nut"
|
||||||
|
],
|
||||||
|
"info": {
|
||||||
|
"ProjectAuthor": "官方 (期限:月)",
|
||||||
|
"ProjectVersion": "1.0.0",
|
||||||
|
"ProjectDescribe": "灵魂救赎武器",
|
||||||
|
"ImageMini": "http://49.234.27.222:8651/dps/download2/Image:chengjiu.png"
|
||||||
|
}
|
||||||
|
},
|
||||||
"修复道具数量显示": {
|
"修复道具数量显示": {
|
||||||
"Private": true,
|
"Private": true,
|
||||||
"Script": [
|
"Script": [
|
||||||
|
|
@ -334,8 +385,7 @@
|
||||||
"ProjectAuthor": "100",
|
"ProjectAuthor": "100",
|
||||||
"ProjectVersion": "1.0.0",
|
"ProjectVersion": "1.0.0",
|
||||||
"ProjectDescribe": "🔥 打破原版桎梏,重塑世界 BOSS 核心乐趣",
|
"ProjectDescribe": "🔥 打破原版桎梏,重塑世界 BOSS 核心乐趣",
|
||||||
"ProjectDetails": [
|
"ProjectDetails": []
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"imgPath": "WorldBoss"
|
"imgPath": "WorldBoss"
|
||||||
},
|
},
|
||||||
|
|
@ -350,8 +400,7 @@
|
||||||
"ProjectAuthor": "100",
|
"ProjectAuthor": "100",
|
||||||
"ProjectVersion": "1.0.0",
|
"ProjectVersion": "1.0.0",
|
||||||
"ProjectDescribe": "🔥 打破原版桎梏,重塑世界 BOSS 核心乐趣",
|
"ProjectDescribe": "🔥 打破原版桎梏,重塑世界 BOSS 核心乐趣",
|
||||||
"ProjectDetails": [
|
"ProjectDetails": []
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"imgPath": "WorldBoss"
|
"imgPath": "WorldBoss"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -336,7 +336,7 @@ function Lenheart_ExpandEquipment_Fun(obj) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getroottable()["LenheartFuncTab"].rawset("ExpandEquipmentFuncN", Lenheart_ExpandEquipment_Fun);
|
getroottable()["LenheartBaseFuncTab"].rawset("ExpandEquipmentFuncN", Lenheart_ExpandEquipment_Fun);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,4 +135,4 @@ function Sq_FixItemCount(X, Y, Count) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getroottable()["LenheartFuncTab"].rawset("FixItemCoutFuncN", Lenheart_FixItemCout_Fun);
|
getroottable()["LenheartBaseFuncTab"].rawset("FixItemCoutFuncN", Lenheart_FixItemCout_Fun);
|
||||||
|
|
@ -342,6 +342,7 @@ getroottable().rawdelete("ItemOtherWolrdUpgrade_Obj");
|
||||||
getroottable().rawdelete("L_Each_Obj");
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function Lenheart_ItemOtherWolrdUpgrade_Fun(obj) {
|
function Lenheart_ItemOtherWolrdUpgrade_Fun(obj) {
|
||||||
local RootTab = getroottable();
|
local RootTab = getroottable();
|
||||||
if (!RootTab.rawin("ItemOtherWolrdUpgrade_Obj")) {
|
if (!RootTab.rawin("ItemOtherWolrdUpgrade_Obj")) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,178 @@
|
||||||
|
/*
|
||||||
|
文件名:NewItemInfoWindow.nut
|
||||||
|
路径:Project/NewItemInfoWindow/NewItemInfoWindow.nut
|
||||||
|
创建日期:2026-01-18 11:22
|
||||||
|
文件用途:
|
||||||
|
*/
|
||||||
|
class NewItemInfoWindowC extends Rindro_BaseToolClass {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//绘制信息Map
|
||||||
|
DrawInfoMap = null;
|
||||||
|
//Script信息
|
||||||
|
ScriptInfoMap = null;
|
||||||
|
|
||||||
|
//需要添加绘制HOOK的List
|
||||||
|
NeedDrawHookList = null;
|
||||||
|
|
||||||
|
//自定义绘制代理
|
||||||
|
CustomDrawDelegate = null;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
DrawInfoMap = {};
|
||||||
|
ScriptInfoMap = {};
|
||||||
|
CustomDrawDelegate = {};
|
||||||
|
NeedDrawHookList = {};
|
||||||
|
Fix();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//绘制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 Proc() {
|
||||||
|
//鼠标没有悬停东西的时候直接清空绘制信息
|
||||||
|
if (NativePointer(0x1AE45B4).readInt() == 0) {
|
||||||
|
DrawInfoMap = {};
|
||||||
|
}
|
||||||
|
if (KeyPress.isKeyPress(OPTION_HOTKEY_TOOLTIP_)) {
|
||||||
|
DrawInfoMap = {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function AddDelegate(Name, Height, Func, CheckFunc) {
|
||||||
|
CustomDrawDelegate.rawset(Name, {
|
||||||
|
//代理区域高度
|
||||||
|
Height = Height,
|
||||||
|
//代理回调函数
|
||||||
|
Func = Func,
|
||||||
|
//代理条件
|
||||||
|
CheckFunc = CheckFunc
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
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"],
|
||||||
|
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();
|
||||||
|
//是装备才做这个事
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.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());
|
||||||
|
}
|
||||||
|
RootTab["NewItemInfoWindow_Obj"].Proc();
|
||||||
|
}
|
||||||
|
|
||||||
|
getroottable()["LenheartBaseFuncTab"].rawset("NewItemInfoWindowFuncN", Lenheart_NewItemInfoWindow_Fun);
|
||||||
|
|
@ -0,0 +1,619 @@
|
||||||
|
/*
|
||||||
|
文件名:NewTitle.nut
|
||||||
|
路径:Project/NewTitle/NewTitle.nut
|
||||||
|
创建日期:2026-01-29 02:36
|
||||||
|
文件用途:
|
||||||
|
*/
|
||||||
|
NewTitleC_Img_Map <- {};
|
||||||
|
class NewTitleC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
Visible = false;
|
||||||
|
|
||||||
|
Img = Rindro_Image("interface2/titlebook/titlebook_ver2.img");
|
||||||
|
|
||||||
|
BackGroundAni = null;
|
||||||
|
BackGroundAni2 = null;
|
||||||
|
|
||||||
|
ImgT = Rindro_Image("newtitle/nangua.img");
|
||||||
|
|
||||||
|
//信息
|
||||||
|
Info = null;
|
||||||
|
//数据信息
|
||||||
|
DataInfo = null;
|
||||||
|
|
||||||
|
//渲染指导信息
|
||||||
|
ShowData = null;
|
||||||
|
|
||||||
|
|
||||||
|
//称谓类别
|
||||||
|
CategoryTitle = null;
|
||||||
|
//称谓按钮List
|
||||||
|
TitleButtonList = null;
|
||||||
|
//是否显示复选框
|
||||||
|
IsDisplayBtn = null;
|
||||||
|
//层级输入框
|
||||||
|
InputObject = null;
|
||||||
|
|
||||||
|
//当前类别
|
||||||
|
CurrentCategory = 0; // 当前类别索引
|
||||||
|
//当前页数
|
||||||
|
CurrentPage = 0;
|
||||||
|
//当前选中称谓ID
|
||||||
|
CurrentSelectId = 1;
|
||||||
|
//当前选中称谓信息
|
||||||
|
CurrentSelectInfo = null;
|
||||||
|
//是否拥有当前选中称谓
|
||||||
|
CurrentSelectHaveFlag = false;
|
||||||
|
//当前选中缩放
|
||||||
|
CurrentSelectScale = 1.0;
|
||||||
|
//当前选中X轴偏移
|
||||||
|
CurrentSelectXOffset = 0;
|
||||||
|
//当前选中Y轴偏移
|
||||||
|
CurrentSelectYOffset = 0;
|
||||||
|
|
||||||
|
|
||||||
|
function CheckBookInfo() {
|
||||||
|
SendPackEx({
|
||||||
|
op = 21012001
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
DataInfo = {};
|
||||||
|
|
||||||
|
Childrens = [];
|
||||||
|
//读取PVF
|
||||||
|
InitPvf();
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
|
//初始化背景动画
|
||||||
|
local FrameArr = [];
|
||||||
|
for (local i = 0; i< 16; i++) {
|
||||||
|
local T = {
|
||||||
|
ImgIndex = i,
|
||||||
|
Delay = 120,
|
||||||
|
Pos = [0, 0]
|
||||||
|
}
|
||||||
|
FrameArr.append(T);
|
||||||
|
}
|
||||||
|
BackGroundAni = Rindro_CustomAnimation("interface2/titlebook/titlebook_effects.img", FrameArr);
|
||||||
|
|
||||||
|
local FrameArr2 = [];
|
||||||
|
for (local i = 16; i< 32; i++) {
|
||||||
|
local T = {
|
||||||
|
ImgIndex = i,
|
||||||
|
Delay = 120,
|
||||||
|
Pos = [0, 0]
|
||||||
|
}
|
||||||
|
FrameArr2.append(T);
|
||||||
|
}
|
||||||
|
BackGroundAni2 = Rindro_CustomAnimation("interface2/titlebook/titlebook_effects.img", FrameArr2);
|
||||||
|
|
||||||
|
//因为json在传输中会将数字Key转为字符串 所以需要转int
|
||||||
|
Pack_Control.rawset(21012002, function(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
foreach(index, value in Jso.Info) {
|
||||||
|
DataInfo.rawset(index.tointeger(), value);
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
//接受需要渲染的称谓数据
|
||||||
|
Pack_Control.rawset(21012004, function(Chunk) {
|
||||||
|
ShowData = {};
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
foreach(index, value in Jso.ShowData) {
|
||||||
|
foreach(DrawObj in value) {
|
||||||
|
local PvfInfo = GetTitlePvfInfo(DrawObj.Id.tointeger())
|
||||||
|
DrawObj.Category <- PvfInfo.Category;
|
||||||
|
DrawObj.Content <- Json.Decode(Json.Encode(PvfInfo.Content));
|
||||||
|
}
|
||||||
|
ShowData.rawset(index.tointeger(), value);
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
CheckBookInfo();
|
||||||
|
|
||||||
|
|
||||||
|
WorldDrawVirtualCharacterCallBackFunc.rawset("NewTitleC", function(Layer, XPos, YPos, WorldId, Name) {
|
||||||
|
if (ShowData) {
|
||||||
|
if (ShowData.rawin(WorldId)) {
|
||||||
|
foreach(ShowInfo in ShowData[WorldId]) {
|
||||||
|
//图像
|
||||||
|
if (ShowInfo.Content.type == "img") {
|
||||||
|
//没有添加缓存的先添加缓存
|
||||||
|
if (!NewTitleC_Img_Map.rawin(ShowInfo.Content.img)) {
|
||||||
|
NewTitleC_Img_Map.rawset(ShowInfo.Content.img, Rindro_Image(ShowInfo.Content.img));
|
||||||
|
}
|
||||||
|
//这里从展示框的左上角开始算起 展示框大小为 290 * 115 如果添加新的称谓 可以现在PS里缩放 并记录下针对左上角坐标的偏移 与 缩放值
|
||||||
|
NewTitleC_Img_Map[ShowInfo.Content.img].DrawExPng(ShowInfo.Content.index,
|
||||||
|
XPos + ShowInfo.XOffset,
|
||||||
|
YPos + ShowInfo.YOffset, 0, 0xffffffff,
|
||||||
|
ShowInfo.Scale.tofloat(), ShowInfo.Scale.tofloat())
|
||||||
|
}
|
||||||
|
//Ani
|
||||||
|
else if (ShowInfo.Content.type == "ani") {
|
||||||
|
local Ani = DrawAniEx(XPos + ShowInfo.XOffset, YPos + ShowInfo.YOffset, ShowInfo.Content.ani);
|
||||||
|
Ani.setImageRateFromOriginal(ShowInfo.Scale.tofloat(), ShowInfo.Scale.tofloat());
|
||||||
|
Ani.setAutoLayerWorkAnimationAddSizeRate(ShowInfo.Scale.tofloat(), ShowInfo.Scale.tofloat());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
//关闭按钮
|
||||||
|
local CloseButton = LenheartNewUI_BaseButton(435, 4, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
|
CloseButton.OnClick = function() {
|
||||||
|
this.Visible = false;
|
||||||
|
}.bindenv(this);
|
||||||
|
Childrens.append(CloseButton);
|
||||||
|
|
||||||
|
//注册类别
|
||||||
|
RegisterCategoryTitle();
|
||||||
|
|
||||||
|
TitleButtonList = [];
|
||||||
|
for (local i = 0; i< 9; i++) {
|
||||||
|
local TitleButtonBuffer = NewTitleC_Button(14, 138 + (37 * i), Img);
|
||||||
|
TitleButtonBuffer.OnClickEx = function(Btn) {
|
||||||
|
CurrentSelectId = Btn.Id;
|
||||||
|
CurrentSelectInfo = Btn.Info;
|
||||||
|
local DataInfoObj = null;
|
||||||
|
//如果有数据
|
||||||
|
if (DataInfo.rawin(CurrentSelectId)) {
|
||||||
|
DataInfoObj = DataInfo[CurrentSelectId];
|
||||||
|
IsDisplayBtn.IsSelected = DataInfoObj.IsDisplay;
|
||||||
|
if (IsDisplayBtn.IsSelected) IsDisplayBtn.State = 1;
|
||||||
|
else IsDisplayBtn.State = 0;
|
||||||
|
|
||||||
|
InputObject.SetStr(DataInfoObj.ZOrder.tostring());
|
||||||
|
|
||||||
|
CurrentSelectScale = DataInfoObj.Scale;
|
||||||
|
CurrentSelectXOffset = DataInfoObj.XOffset;
|
||||||
|
CurrentSelectYOffset = DataInfoObj.YOffset;
|
||||||
|
CurrentSelectHaveFlag = true;
|
||||||
|
} else {
|
||||||
|
CurrentSelectHaveFlag = false;
|
||||||
|
}
|
||||||
|
}.bindenv(this);
|
||||||
|
AddChild(TitleButtonBuffer);
|
||||||
|
TitleButtonList.append(TitleButtonBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
local CheckCurrentSelectIdFunc = function(Btn) {
|
||||||
|
//如果没有选中 或者没有信息 或者没有拥有
|
||||||
|
if (!CurrentSelectId || !CurrentSelectInfo || !DataInfo.rawin(CurrentSelectId)) {
|
||||||
|
Btn.Visible = false;
|
||||||
|
} else {
|
||||||
|
Btn.Visible = true;
|
||||||
|
}
|
||||||
|
}.bindenv(this);
|
||||||
|
|
||||||
|
//是否显示复选框
|
||||||
|
IsDisplayBtn = NewTitleC_SwitchButton(252, 424);
|
||||||
|
IsDisplayBtn.OnClickEx = function(Btn) {
|
||||||
|
|
||||||
|
}.bindenv(this);
|
||||||
|
IsDisplayBtn.SetCallBackFunc(CheckCurrentSelectIdFunc);
|
||||||
|
AddChild(IsDisplayBtn);
|
||||||
|
|
||||||
|
//层级输入框
|
||||||
|
InputObject = LenheartNewUI_BaseInput(360, 423, 50, 20);
|
||||||
|
InputObject.SetCallBackFunc(CheckCurrentSelectIdFunc);
|
||||||
|
AddChild(InputObject);
|
||||||
|
// InputObject.SetStr("131232");
|
||||||
|
|
||||||
|
|
||||||
|
//保存按钮
|
||||||
|
local ConfirmButton = LenheartNewUI_ButtonText(364, 481, 15, " 保 存");
|
||||||
|
ConfirmButton.DWidth = 18;
|
||||||
|
ConfirmButton.Width = 74;
|
||||||
|
ConfirmButton.SetTextOffset(-4, 1);
|
||||||
|
ConfirmButton.OnClickEx = function(Btn) {
|
||||||
|
if (Btn.Visible) {
|
||||||
|
local Order = 1;
|
||||||
|
try {
|
||||||
|
Order = InputObject.str.tointeger();
|
||||||
|
} catch (exception) {
|
||||||
|
|
||||||
|
}
|
||||||
|
SendPackEx({
|
||||||
|
op = 21012003,
|
||||||
|
Id = CurrentSelectId,
|
||||||
|
SendInfo = {
|
||||||
|
IsDisplay = IsDisplayBtn.IsSelected,
|
||||||
|
Scale = CurrentSelectScale,
|
||||||
|
XOffset = CurrentSelectXOffset,
|
||||||
|
YOffset = CurrentSelectYOffset,
|
||||||
|
ZOrder = Order
|
||||||
|
}
|
||||||
|
})
|
||||||
|
CheckBookInfo();
|
||||||
|
}
|
||||||
|
}.bindenv(this);
|
||||||
|
ConfirmButton.SetCallBackFunc(CheckCurrentSelectIdFunc);
|
||||||
|
AddChild(ConfirmButton);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for (local i = 0; i< 3; i++) {
|
||||||
|
local ControlObject = "CurrentSelectScale";
|
||||||
|
if (i == 1) ControlObject = "CurrentSelectXOffset";
|
||||||
|
if (i == 2) ControlObject = "CurrentSelectYOffset";
|
||||||
|
|
||||||
|
local BtnBuffer = LenheartNewUI_BaseButton(205, 440 + (i * 16), 20, 15, "interface/lenheartwindowcommon.img", 528);
|
||||||
|
BtnBuffer.Data = ControlObject;
|
||||||
|
BtnBuffer.OnClickEx = function(Btn) {
|
||||||
|
if (Btn.Data == "CurrentSelectScale") {
|
||||||
|
this[Btn.Data] -= 0.1;
|
||||||
|
} else {
|
||||||
|
this[Btn.Data] -= 10;
|
||||||
|
}
|
||||||
|
FixCustomData();
|
||||||
|
}.bindenv(this);
|
||||||
|
BtnBuffer.SetCallBackFunc(CheckCurrentSelectIdFunc);
|
||||||
|
Childrens.append(BtnBuffer);
|
||||||
|
|
||||||
|
BtnBuffer = LenheartNewUI_BaseButton(232, 440 + (i * 16), 15, 15, "interface/lenheartwindowcommon.img", 34);
|
||||||
|
BtnBuffer.Data = ControlObject;
|
||||||
|
BtnBuffer.OnClickEx = function(Btn) {
|
||||||
|
if (Btn.Data == "CurrentSelectScale") {
|
||||||
|
this[Btn.Data] -= 0.01;
|
||||||
|
} else {
|
||||||
|
this[Btn.Data] -= 1;
|
||||||
|
}
|
||||||
|
FixCustomData();
|
||||||
|
}.bindenv(this);
|
||||||
|
BtnBuffer.SetCallBackFunc(CheckCurrentSelectIdFunc);
|
||||||
|
Childrens.append(BtnBuffer);
|
||||||
|
|
||||||
|
BtnBuffer = LenheartNewUI_BaseButton(284, 440 + (i * 16), 15, 15, "interface/lenheartwindowcommon.img", 38);
|
||||||
|
BtnBuffer.Data = ControlObject;
|
||||||
|
BtnBuffer.OnClickEx = function(Btn) {
|
||||||
|
if (Btn.Data == "CurrentSelectScale") {
|
||||||
|
this[Btn.Data] += 0.01;
|
||||||
|
} else {
|
||||||
|
this[Btn.Data] += 1;
|
||||||
|
}
|
||||||
|
FixCustomData();
|
||||||
|
}.bindenv(this);
|
||||||
|
BtnBuffer.SetCallBackFunc(CheckCurrentSelectIdFunc);
|
||||||
|
Childrens.append(BtnBuffer);
|
||||||
|
|
||||||
|
BtnBuffer = LenheartNewUI_BaseButton(311, 440 + (i * 16), 20, 15, "interface/lenheartwindowcommon.img", 532);
|
||||||
|
BtnBuffer.Data = ControlObject;
|
||||||
|
BtnBuffer.OnClickEx = function(Btn) {
|
||||||
|
if (Btn.Data == "CurrentSelectScale") {
|
||||||
|
this[Btn.Data] += 0.1;
|
||||||
|
} else {
|
||||||
|
this[Btn.Data] += 10;
|
||||||
|
}
|
||||||
|
FixCustomData();
|
||||||
|
}.bindenv(this);
|
||||||
|
BtnBuffer.SetCallBackFunc(CheckCurrentSelectIdFunc);
|
||||||
|
Childrens.append(BtnBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始默认0类别
|
||||||
|
ChangeCategoryTitle(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//更改页面
|
||||||
|
function ChangeCategoryTitle(ToCategory) {
|
||||||
|
CurrentCategory = ToCategory;
|
||||||
|
//得到对应分类的称谓List
|
||||||
|
local ItemList = Info.ItemIndex[CurrentCategory];
|
||||||
|
local SetInfo = [];
|
||||||
|
for (local i = (9 * CurrentPage); i< 9; i++) {
|
||||||
|
//得到ID和Info 0 和 null 为没有数据
|
||||||
|
local TileId = 0;
|
||||||
|
local TileInfo = null;
|
||||||
|
if (i< ItemList.len()) {
|
||||||
|
//将ID记录到数组
|
||||||
|
TileId = ItemList[i];
|
||||||
|
TileInfo = Info.Item[CurrentCategory][ItemList[i]];
|
||||||
|
}
|
||||||
|
SetInfo.append({
|
||||||
|
TileId = TileId,
|
||||||
|
TileInfo = TileInfo
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//遍历数组将ID与Info 设置给按钮
|
||||||
|
for (local i = 0; i< 9; i++) {
|
||||||
|
TitleButtonList[i].SetInfo(SetInfo[i].TileId, SetInfo[i].TileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//修正数据
|
||||||
|
function FixCustomData() {
|
||||||
|
if (this.CurrentSelectScale > 1.0) this.CurrentSelectScale = 1.0;
|
||||||
|
if (this.CurrentSelectScale< 0.01) this.CurrentSelectScale = 0.01;
|
||||||
|
if (this.CurrentSelectXOffset > 800) this.CurrentSelectXOffset = 800;
|
||||||
|
if (this.CurrentSelectXOffset<(-800)) this.CurrentSelectXOffset = -800;
|
||||||
|
if (this.CurrentSelectYOffset > 600) this.CurrentSelectYOffset = 600;
|
||||||
|
if (this.CurrentSelectYOffset<(-600)) this.CurrentSelectYOffset = -600;
|
||||||
|
}
|
||||||
|
|
||||||
|
//注册类别
|
||||||
|
function RegisterCategoryTitle() {
|
||||||
|
CategoryTitle = [];
|
||||||
|
|
||||||
|
local LogicFunc = function(Btn) {
|
||||||
|
foreach(Pos, obj in CategoryTitle) {
|
||||||
|
if (obj != Btn) obj.State = 0;
|
||||||
|
else {
|
||||||
|
obj.State = 1;
|
||||||
|
ChangeCategoryTitle(Pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//遍历有多少个Boss
|
||||||
|
foreach(Pos, Name in Info.category) {
|
||||||
|
local Tabbars1 = LenheartNewUI_TabbarsText(10 + (Pos * 61), 110, Name);
|
||||||
|
if (Pos == 0) Tabbars1.State = 1;
|
||||||
|
Tabbars1.SetTextOffset(31 - LenheartTextClass.GetStringLength(Name) / 2, 4);
|
||||||
|
AddChild(Tabbars1);
|
||||||
|
Tabbars1.OnClickEx = LogicFunc.bindenv(this);
|
||||||
|
CategoryTitle.append(Tabbars1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
//背景框
|
||||||
|
DrawNineBox(X, Y, 450, 518, "interface/lenheartwindowcommon.img", 213);
|
||||||
|
|
||||||
|
//标题
|
||||||
|
DrawWindowTitle(452);
|
||||||
|
//绘制标题名
|
||||||
|
L_sq_DrawCode("誉名录", X + 204, Y + 5, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
|
||||||
|
//头部图像
|
||||||
|
Img.DrawPng(0, X + 5, Y + 26);
|
||||||
|
|
||||||
|
L_sq_SetDrawImgModel(2, 0);
|
||||||
|
BackGroundAni.Show(Duration, X + 150, Y + 35);
|
||||||
|
BackGroundAni2.Show(Duration, X + 150, Y + 30);
|
||||||
|
L_sq_ReleaseDrawImgModel();
|
||||||
|
|
||||||
|
//书本图像
|
||||||
|
Img.DrawPng(1, X + 184, Y + 46);
|
||||||
|
|
||||||
|
L_sq_DrawCode("誉名录完成率", X + 188, Y + 98, sq_RGBA(202, 200, 194, 255), 0, 1);
|
||||||
|
|
||||||
|
//左侧背景
|
||||||
|
Img.DrawPng(2, X + 9, Y + 132);
|
||||||
|
//右侧背景
|
||||||
|
Img.DrawPng(3, X + 143, Y + 132);
|
||||||
|
|
||||||
|
|
||||||
|
//详情页
|
||||||
|
if (CurrentSelectId && CurrentSelectInfo) {
|
||||||
|
//展示文字
|
||||||
|
L_sq_DrawCode("效果展示:", X + 150, Y + 140, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
//展示框
|
||||||
|
Img.DrawPng(11, X + 147, Y + 156);
|
||||||
|
//图像
|
||||||
|
if (CurrentSelectInfo.Content.type == "img") {
|
||||||
|
//没有添加缓存的先添加缓存
|
||||||
|
if (!NewTitleC_Img_Map.rawin(CurrentSelectInfo.Content.img)) {
|
||||||
|
NewTitleC_Img_Map.rawset(CurrentSelectInfo.Content.img, Rindro_Image(CurrentSelectInfo.Content.img));
|
||||||
|
}
|
||||||
|
//这里从展示框的左上角开始算起 展示框大小为 290 * 115 如果添加新的称谓 可以现在PS里缩放 并记录下针对左上角坐标的偏移 与 缩放值
|
||||||
|
NewTitleC_Img_Map[CurrentSelectInfo.Content.img].DrawExPng(CurrentSelectInfo.Content.index,
|
||||||
|
X + 147 + CurrentSelectInfo.DisplayData.x,
|
||||||
|
Y + 156 + CurrentSelectInfo.DisplayData.y, 0, 0xffffffff,
|
||||||
|
CurrentSelectInfo.DisplayData.scale, CurrentSelectInfo.DisplayData.scale)
|
||||||
|
}
|
||||||
|
//Ani
|
||||||
|
else if (CurrentSelectInfo.Content.type == "ani") {
|
||||||
|
local Ani = DrawAniEx(X + 147 + CurrentSelectInfo.DisplayData.x, Y + 156 + CurrentSelectInfo.DisplayData.y, CurrentSelectInfo.Content.ani);
|
||||||
|
Ani.setImageRateFromOriginal(CurrentSelectInfo.DisplayData.scale, CurrentSelectInfo.DisplayData.scale);
|
||||||
|
Ani.setAutoLayerWorkAnimationAddSizeRate(CurrentSelectInfo.DisplayData.scale, CurrentSelectInfo.DisplayData.scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
//描述文字
|
||||||
|
L_sq_DrawCode("称谓信息:", X + 150, Y + 276, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
L_sq_DrawCode_ExRN(CurrentSelectInfo.Explain, X + 150, Y + 292, sq_RGBA(104, 213, 237, 255), 0, 1);
|
||||||
|
|
||||||
|
//获取途径文字
|
||||||
|
L_sq_DrawCode("获取途径:", X + 150, Y + 336, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
L_sq_DrawCode_ExRN(CurrentSelectInfo.Conditions, X + 150, Y + 352, sq_RGBA(124, 110, 82, 255), 0, 1);
|
||||||
|
|
||||||
|
if (CurrentSelectHaveFlag) {
|
||||||
|
//调整文字
|
||||||
|
L_sq_DrawCode("自定义调整:", X + 150, Y + 410, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
//缩放大小
|
||||||
|
L_sq_DrawCode("是否启用称谓显示: ", X + 150, Y + 426, sq_RGBA(124, 110, 82, 255), 0, 1);
|
||||||
|
//层级调整
|
||||||
|
L_sq_DrawCode("显示层级: ", X + 300, Y + 426, sq_RGBA(124, 110, 82, 255), 0, 1);
|
||||||
|
|
||||||
|
L_sq_DrawCode("缩放大小:", X + 150, Y + 442, sq_RGBA(124, 110, 82, 255), 0, 1);
|
||||||
|
local CurrentSelectScaleStr = format("%.2f", CurrentSelectScale);
|
||||||
|
L_sq_DrawCode(CurrentSelectScaleStr, X + 266 - LenheartTextClass.GetStringLength(CurrentSelectScaleStr) / 2, Y + 442, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
|
||||||
|
L_sq_DrawCode("X轴偏移:", X + 150, Y + 458, sq_RGBA(124, 110, 82, 255), 0, 1);
|
||||||
|
local CurrentSelectXOffsetStr = CurrentSelectXOffset.tostring();
|
||||||
|
L_sq_DrawCode(CurrentSelectXOffsetStr, X + 266 - LenheartTextClass.GetStringLength(CurrentSelectXOffsetStr) / 2, Y + 458, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
|
||||||
|
L_sq_DrawCode("Y轴偏移:", X + 150, Y + 474, sq_RGBA(124, 110, 82, 255), 0, 1);
|
||||||
|
local CurrentSelectYOffsetStr = CurrentSelectYOffset.tostring();
|
||||||
|
L_sq_DrawCode(CurrentSelectYOffsetStr, X + 266 - LenheartTextClass.GetStringLength(CurrentSelectYOffsetStr) / 2, Y + 474, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (local i = 0; i< 6; i++) {
|
||||||
|
Img.DrawPng(21 + i, X + 152, Y + 160 + (i * 44));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
function OpenCallBack() {
|
||||||
|
Visible = true;
|
||||||
|
CurrentSelectId = 0;
|
||||||
|
CurrentSelectInfo = null;
|
||||||
|
CheckBookInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
function InitPvf() {
|
||||||
|
Info = {};
|
||||||
|
//读取基础配置
|
||||||
|
Rindro_Script.GetFileData("etc/rindro/newtitle/newtitle.etc", function(DataTable, Data) {
|
||||||
|
while (!Data.Eof()) {
|
||||||
|
local Fragment = Data.Get();
|
||||||
|
if (Fragment == "[category]") {
|
||||||
|
Info.category <- [];
|
||||||
|
while (true) {
|
||||||
|
local Fbuf = Data.Get();
|
||||||
|
if (Fbuf == "[/category]") {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Info.category.append(Sq_ConvertWideChar(Fbuf, "big5"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
//读取称谓列表
|
||||||
|
local TitleInfoMap = Rindro_Script.GetFileData("etc/rindro/newtitle/title.lst", function(InfoMap, Data) {
|
||||||
|
while (!Data.Eof()) {
|
||||||
|
local Index = Data.Get();
|
||||||
|
local Path = "etc/" + Data.Get();
|
||||||
|
|
||||||
|
local TitleInfo = Rindro_Script.GetFileData(Path, function(DataTable, Data) {
|
||||||
|
while (!Data.Eof()) {
|
||||||
|
local Fragment = Data.Get();
|
||||||
|
if (Fragment == "[name]") {
|
||||||
|
DataTable.Name <- Sq_ConvertWideChar(Data.Get(), "big5");
|
||||||
|
} else if (Fragment == "[icon]") {
|
||||||
|
DataTable.Icon <- {
|
||||||
|
img = Data.Get().tolower(),
|
||||||
|
index = Data.Get()
|
||||||
|
}
|
||||||
|
} else if (Fragment == "[explain]") {
|
||||||
|
DataTable.Explain <- Sq_ConvertWideChar(Data.Get(), "big5");
|
||||||
|
} else if (Fragment == "[conditions]") {
|
||||||
|
DataTable.Conditions <- Sq_ConvertWideChar(Data.Get(), "big5");
|
||||||
|
} else if (Fragment == "[category]") {
|
||||||
|
DataTable.Category <- Data.Get();
|
||||||
|
} else if (Fragment == "[content]") {
|
||||||
|
local Type = Data.Get();
|
||||||
|
if (Type == "img") {
|
||||||
|
DataTable.Content <- {
|
||||||
|
type = Type,
|
||||||
|
img = Data.Get().tolower(),
|
||||||
|
index = Data.Get()
|
||||||
|
}
|
||||||
|
} else if (Type == "ani") {
|
||||||
|
DataTable.Content <- {
|
||||||
|
type = Type,
|
||||||
|
ani = Data.Get().tolower(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (Fragment == "[display data]") {
|
||||||
|
DataTable.DisplayData <- {
|
||||||
|
x = Data.Get(),
|
||||||
|
y = Data.Get(),
|
||||||
|
scale = Data.Get()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
InfoMap.rawset(Index, TitleInfo);
|
||||||
|
}
|
||||||
|
InfoMap.rawdelete("filepath");
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
//遍历称谓列表分配到对应的种类页 并编制索引
|
||||||
|
Info.Item <- [];
|
||||||
|
Info.ItemIndex <- [];
|
||||||
|
foreach(value in Info.category) {
|
||||||
|
Info.Item.append({});
|
||||||
|
Info.ItemIndex.append([]);
|
||||||
|
}
|
||||||
|
foreach(Index, Value in TitleInfoMap) {
|
||||||
|
Info.Item[Value.Category].rawset(Index, Value);
|
||||||
|
Info.ItemIndex[Value.Category].append(Index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function L_sq_DrawCode_Ex(str, x, y, rgba, mb, jc) {
|
||||||
|
local strarr = [];
|
||||||
|
if (str.find("\r\n") == null) L_sq_DrawCode(str, x, y, rgba, mb, jc);
|
||||||
|
else {
|
||||||
|
local Bpos = 0;
|
||||||
|
while (true) {
|
||||||
|
local Npos = str.find("\r\n", Bpos);
|
||||||
|
if (!Npos) {
|
||||||
|
local strbuff = str.slice(Bpos, str.len());
|
||||||
|
strarr.append(strbuff);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
local strbuff = str.slice(Bpos, Npos);
|
||||||
|
strarr.append(strbuff);
|
||||||
|
Bpos = Npos + 2;
|
||||||
|
}
|
||||||
|
for (local z = 0; z< strarr.len(); z++) {
|
||||||
|
L_sq_DrawCode(strarr[z], x, y + (z * 14), rgba, mb, jc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetTitlePvfInfo(FindId) {
|
||||||
|
local FindCategory = -1;
|
||||||
|
foreach(GroupIndex, Group in Info.ItemIndex) {
|
||||||
|
foreach(value in Group) {
|
||||||
|
if (value == FindId) {
|
||||||
|
FindCategory = GroupIndex;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (FindCategory != -1) {
|
||||||
|
return Info.Item[FindCategory][FindId];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
L_Windows_List <- [];
|
||||||
|
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||||||
|
getroottable().rawdelete("EventList_Obj")
|
||||||
|
getroottable().rawdelete("NewTitle_Obj");
|
||||||
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
||||||
|
function Lenheart_NewTitle_Fun(obj) {
|
||||||
|
local RootTab = getroottable();
|
||||||
|
if (!RootTab.rawin("NewTitle_Obj")) {
|
||||||
|
RootTab.rawset("NewTitle_Obj", true);
|
||||||
|
local Win = LenheartNewUI_CreateWindow(NewTitleC, "称谓系统窗口", ((getroottable().Rindro_Scr_Width - 450) / 2).tointeger(), 30, 450, 518, 22);
|
||||||
|
EventList_Obj.AddEvent("誉名录", 109, Win);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getroottable()["LenheartFuncTab"].rawset("NewTitleFuncN", Lenheart_NewTitle_Fun);
|
||||||
|
|
@ -0,0 +1,116 @@
|
||||||
|
/*
|
||||||
|
文件名:TitleButton.nut
|
||||||
|
路径:Project/NewTitle/TitleButton.nut
|
||||||
|
创建日期:2026-01-30 04:34
|
||||||
|
文件用途:
|
||||||
|
*/
|
||||||
|
|
||||||
|
class NewTitleC_Button extends LenheartNewUI_CommonUi {
|
||||||
|
State = 0;
|
||||||
|
BaseIdx = 29;
|
||||||
|
DWidth = null;
|
||||||
|
|
||||||
|
Img = null;
|
||||||
|
|
||||||
|
Id = 0;
|
||||||
|
Info = null;
|
||||||
|
|
||||||
|
constructor(X, Y, gImg) {
|
||||||
|
this.DWidth = 121;
|
||||||
|
this.Img = gImg;
|
||||||
|
LenheartNewUI_CommonUi.constructor(X, Y, 121, 34);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SetInfo(gId,gInfo) {
|
||||||
|
this.Id = gId;
|
||||||
|
this.Info = gInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
local DownOffset = 0;
|
||||||
|
|
||||||
|
//按下
|
||||||
|
if (isLBDown) {
|
||||||
|
DownOffset = 1;
|
||||||
|
}
|
||||||
|
Img.DrawPng(4, X, Y + DownOffset);
|
||||||
|
|
||||||
|
//有信息才绘制
|
||||||
|
if (Info) {
|
||||||
|
//是否拥有标识条底
|
||||||
|
Img.DrawPng(5, X + 35, Y + 26 + DownOffset);
|
||||||
|
Img.DrawPng(7, X + 35, Y + 26 + DownOffset);
|
||||||
|
|
||||||
|
//图标边框
|
||||||
|
Img.DrawPng(10, X, Y + DownOffset);
|
||||||
|
|
||||||
|
//判断是否有初始化图像
|
||||||
|
if (!NewTitleC_Img_Map.rawin(Info.Icon.img)) {
|
||||||
|
NewTitleC_Img_Map.rawset(Info.Icon.img, Rindro_Image(Info.Icon.img));
|
||||||
|
}
|
||||||
|
NewTitleC_Img_Map[Info.Icon.img].DrawPng(Info.Icon.index, X + 3, Y + 3 + DownOffset);
|
||||||
|
|
||||||
|
//名称
|
||||||
|
L_sq_DrawCode(Info.Name, X + 38, Y + 8 + DownOffset, sq_RGBA(255, 255, 183, 255), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isInRect) {
|
||||||
|
Img.DrawPng(8, X, Y + DownOffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//复选框
|
||||||
|
class NewTitleC_SwitchButton extends LenheartNewUI_CommonUi {
|
||||||
|
State = 0;
|
||||||
|
ImgIndex = 600;
|
||||||
|
ImgPath = "interface/lenheartwindowcommon.img";
|
||||||
|
IsSelected = false;
|
||||||
|
|
||||||
|
constructor(X, Y) {
|
||||||
|
LenheartNewUI_CommonUi.constructor(X, Y, 28, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
|
||||||
|
local DownOffset = 0;
|
||||||
|
|
||||||
|
if (isLBDown) {
|
||||||
|
DownOffset = 1;
|
||||||
|
if (State == 0)
|
||||||
|
Rindro_Image_GlobalMap["lenheartui"].DrawPng(ImgIndex + 1, X, Y + 1);
|
||||||
|
if (State == 1)
|
||||||
|
Rindro_Image_GlobalMap["lenheartui"].DrawPng(ImgIndex + 4, X, Y + 1);
|
||||||
|
} else if (isInRect) {
|
||||||
|
if (State == 0)
|
||||||
|
Rindro_Image_GlobalMap["lenheartui"].DrawPng(ImgIndex + 1, X, Y);
|
||||||
|
if (State == 1)
|
||||||
|
Rindro_Image_GlobalMap["lenheartui"].DrawPng(ImgIndex + 4, X, Y);
|
||||||
|
} else {
|
||||||
|
if (State == 0)
|
||||||
|
Rindro_Image_GlobalMap["lenheartui"].DrawPng(ImgIndex, X, Y);
|
||||||
|
if (State == 1)
|
||||||
|
Rindro_Image_GlobalMap["lenheartui"].DrawPng(ImgIndex + 3, X, Y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//鼠标左键弹起回调
|
||||||
|
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
||||||
|
if (isLBDown) {
|
||||||
|
if (OnClick) OnClick();
|
||||||
|
if (OnClickEx) OnClickEx(this);
|
||||||
|
IsSelected = !IsSelected;
|
||||||
|
if (IsSelected) State = 1;
|
||||||
|
else State = 0;
|
||||||
|
}
|
||||||
|
isLBDown = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
L_Windows_List <- [];
|
||||||
|
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||||||
|
getroottable().rawdelete("EventList_Obj")
|
||||||
|
getroottable().rawdelete("NewTitle_Obj");
|
||||||
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
@ -0,0 +1,263 @@
|
||||||
|
/*
|
||||||
|
文件名:SoulSalvation.nut
|
||||||
|
路径:Project/SoulSalvation/SoulSalvation.nut
|
||||||
|
创建日期:2026-01-20 03:00
|
||||||
|
文件用途:灵魂救赎武器
|
||||||
|
*/
|
||||||
|
class SoulSalvationC extends Rindro_BaseToolClass {
|
||||||
|
|
||||||
|
//灵魂救赎武器标识 (阶段1)
|
||||||
|
Equipment1List = null;
|
||||||
|
//1阶段所需灵魂数量
|
||||||
|
Stage1SoulCount = 1000;
|
||||||
|
//灵魂救赎武器标识 (阶段2)
|
||||||
|
Equipment2List = null;
|
||||||
|
//灵魂救赎武器标识 (阶段3)
|
||||||
|
Equipment3List = null;
|
||||||
|
//三阶段灵魂石对应APC
|
||||||
|
Equipment3SoulStone = null;
|
||||||
|
|
||||||
|
Img = Rindro_Image("soulweapon/main.img");
|
||||||
|
|
||||||
|
//灵魂数据
|
||||||
|
EquipData = null;
|
||||||
|
//APC数据
|
||||||
|
ApcInfo = null;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
Equipment1List = {};
|
||||||
|
Equipment2List = {};
|
||||||
|
Equipment3List = {};
|
||||||
|
Equipment3SoulStone = {};
|
||||||
|
EquipData = {};
|
||||||
|
ApcInfo = {};
|
||||||
|
InifPvf();
|
||||||
|
|
||||||
|
local ItemDrawControl = getroottable()["NewItemInfoWindow_Obj"];
|
||||||
|
|
||||||
|
ItemDrawControl.AddDelegate("灵魂救赎武器代理一阶段", 28, Delegate1.bindenv(this),
|
||||||
|
function(Item) {
|
||||||
|
return Equipment1List.rawin(Item.GetIndex());
|
||||||
|
}.bindenv(this));
|
||||||
|
ItemDrawControl.AddDelegate("灵魂救赎武器代理二阶段", 42, Delegate2.bindenv(this),
|
||||||
|
function(Item) {
|
||||||
|
return Equipment2List.rawin(Item.GetIndex());
|
||||||
|
}.bindenv(this));
|
||||||
|
ItemDrawControl.AddDelegate("灵魂救赎武器代理三阶段", 42, Delegate3.bindenv(this),
|
||||||
|
function(Item) {
|
||||||
|
return Equipment3List.rawin(Item.GetIndex());
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
foreach(Id, _f in Equipment3SoulStone) {
|
||||||
|
ItemDrawControl.AddHookItemId(Id);
|
||||||
|
}
|
||||||
|
ItemDrawControl.AddDelegate("灵魂救赎灵魂石代理", 160, Delegate4.bindenv(this),
|
||||||
|
function(Item) {
|
||||||
|
return Equipment3SoulStone.rawin(Item.GetIndex());
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
//上线获取全身灵魂武器灵魂数
|
||||||
|
Pack_Control.rawset(21011002, function(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
EquipData = Jso.Info;
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
//多个灵魂武器的补充信息包
|
||||||
|
Pack_Control.rawset(21011006, function(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
foreach(index, value in Jso.Info) {
|
||||||
|
EquipData[index.tostring()] <- value;
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
//单个灵魂武器的刷新信息
|
||||||
|
Pack_Control.rawset(21011004, function(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
EquipData[Jso.uuid.tostring()] <- Jso.info;
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
SendPackEx({
|
||||||
|
op = 21011001
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//创建灵魂武器升级窗口
|
||||||
|
LenheartNewUI_CreateWindow(SoulSalvation_UpgradeC, "灵魂武器升级窗口", ((getroottable().Rindro_Scr_Width - 700) / 2).tointeger(), 160, 292, 290, 28);
|
||||||
|
LenheartNewUI_CreateWindow(SoulSalvation_EnchantC, "灵魂武器附灵窗口", ((getroottable().Rindro_Scr_Width - 700) / 2).tointeger(), 160, 292, 290, 28);
|
||||||
|
}
|
||||||
|
|
||||||
|
//1阶段的代理
|
||||||
|
function Delegate1(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);
|
||||||
|
local Uuid = Item.GetUuid().tostring();
|
||||||
|
//获取封印灵魂数
|
||||||
|
local Count = 0;
|
||||||
|
if (EquipData.rawin(Uuid)) {
|
||||||
|
Count = EquipData[Uuid].soul_count;
|
||||||
|
}
|
||||||
|
local Rate = Count.tofloat() / Stage1SoulCount.tofloat();
|
||||||
|
L_sq_DrawCode(format("%.1f%%", Rate * 100.0), X + 180, Y + 30, sq_RGBA(255, 119, 0, 255), 0, 1);
|
||||||
|
Img.DrawPng(0, X + 70, Y + 34);
|
||||||
|
setClip(X + 72, Y + 36, X + 72 + (Rate * 97.0).tointeger(), Y + 40); //开始裁切
|
||||||
|
Img.DrawPng(1, X + 72, Y + 36);
|
||||||
|
releaseClip(); //裁切结束
|
||||||
|
}
|
||||||
|
|
||||||
|
//2阶段的代理
|
||||||
|
function Delegate2(X, Y, Item) {
|
||||||
|
L_sq_DrawCode("灵魂救赎阶段: 2 / 3", X + 6, Y + 15, 0xFF0055FF, 0, 1);
|
||||||
|
L_sq_DrawCode("佩戴释魂通关镇魂曲地区副本", X + 6, Y + 30, 0xFF0055FF, 0, 1);
|
||||||
|
L_sq_DrawCode("即可救赎沉沦无尽永恒的灵魂!", X + 6, Y + 45, 0xFF0055FF, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//3阶段的代理
|
||||||
|
function Delegate3(X, Y, Item) {
|
||||||
|
L_sq_DrawCode("灵魂救赎阶段: 3 / 3", X + 6, Y + 15, 0xFF0055FF, 0, 1);
|
||||||
|
L_sq_DrawCode("已附灵的不朽灵魂:", X + 6, Y + 30, 0xFF0055FF, 0, 1);
|
||||||
|
local Uuid = Item.GetUuid().tostring();
|
||||||
|
local APCId = 0;
|
||||||
|
if (EquipData.rawin(Uuid)) {
|
||||||
|
APCId = EquipData[Uuid].soul_id;
|
||||||
|
}
|
||||||
|
if (APCId == 0) {
|
||||||
|
L_sq_DrawCode("未定名", X + 6, Y + 45, 0xFF0055FF, 0, 1);
|
||||||
|
} else {
|
||||||
|
local ApcName = GetApcInfo(APCId).Name;
|
||||||
|
L_sq_DrawCode("Lv.85 " + ApcName, X + 6, Y + 45, 0xFF0055FF, 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//灵魂石的代理
|
||||||
|
function Delegate4(X, Y, Item) {
|
||||||
|
local ApcId = 0;
|
||||||
|
if (Equipment3SoulStone.rawin(Item.GetIndex())) {
|
||||||
|
ApcId = Equipment3SoulStone[Item.GetIndex()];
|
||||||
|
}
|
||||||
|
if (ApcId > 0) {
|
||||||
|
local Info = GetApcInfo(ApcId);
|
||||||
|
if (!Info.rawin("Ani")) {
|
||||||
|
Info.Ani <- Rindro_Draw_Character(Info.Job, Info.Equ, "rest.ani", null);
|
||||||
|
}
|
||||||
|
L_sq_DrawCode("不朽的灵魂: " + Info.Name, X + 6, Y + 15, 0xFF0055FF, 0, 1);
|
||||||
|
Info.Ani.Draw(X + 102, Y + 160);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//读取配置
|
||||||
|
function InifPvf() {
|
||||||
|
Rindro_Script.GetFileData("etc/rindro/expandequipment/soulsalvation.etc", function(DataTable, Data) {
|
||||||
|
while (!Data.Eof()) {
|
||||||
|
local Fragment = Data.Get();
|
||||||
|
if (Fragment == "[EQUIPMENT1]") {
|
||||||
|
Equipment1List = {};
|
||||||
|
while (true) {
|
||||||
|
local Fbuf = Data.Get();
|
||||||
|
if (Fbuf == "[/EQUIPMENT1]") {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Equipment1List.rawset(Fbuf, true);
|
||||||
|
}
|
||||||
|
} else if (Fragment == "[EQUIPMENT2]") {
|
||||||
|
Equipment2List = {};
|
||||||
|
while (true) {
|
||||||
|
local Fbuf = Data.Get();
|
||||||
|
if (Fbuf == "[/EQUIPMENT2]") {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Equipment2List.rawset(Fbuf, true);
|
||||||
|
}
|
||||||
|
} else if (Fragment == "[EQUIPMENT3]") {
|
||||||
|
Equipment3List = {};
|
||||||
|
while (true) {
|
||||||
|
local Fbuf = Data.Get();
|
||||||
|
if (Fbuf == "[/EQUIPMENT3]") {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Equipment3List.rawset(Fbuf, true);
|
||||||
|
}
|
||||||
|
} else if (Fragment == "[STAGE1 VALUE]") {
|
||||||
|
Stage1SoulCount = Data.Get();
|
||||||
|
} else if (Fragment == "[STAGE2 SOULSTONE]") {
|
||||||
|
Equipment3SoulStone = {};
|
||||||
|
while (true) {
|
||||||
|
local Fbuf = Data.Get();
|
||||||
|
if (Fbuf == "[/STAGE2 SOULSTONE]") {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Equipment3SoulStone.rawset(Fbuf, Data.Get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//读取APC名字
|
||||||
|
function GetApcInfo(ApcIndex) {
|
||||||
|
if (ApcInfo.rawin(ApcIndex)) return ApcInfo[ApcIndex];
|
||||||
|
local Path = "aicharacter/" + R_Utils.GetApcPath(ApcIndex);
|
||||||
|
local Info = Rindro_Script.GetFileData(Path, function(DataTable, Data) {
|
||||||
|
while (!Data.Eof()) {
|
||||||
|
local Fragment = Data.Get();
|
||||||
|
if (Fragment == "[minimum info]") {
|
||||||
|
DataTable.Name <- Sq_ConvertWideChar(Data.Get(), "big5");
|
||||||
|
DataTable.Job <- Data.Get();
|
||||||
|
} else if (Fragment == "[equipment]") {
|
||||||
|
DataTable.Equ <- [];
|
||||||
|
while (true) {
|
||||||
|
local Fbuf = Data.Get();
|
||||||
|
if (Fbuf == "[/equipment]") {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Data.Get();
|
||||||
|
Data.Get();
|
||||||
|
DataTable.Equ.append(Fbuf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ApcInfo.rawset(ApcIndex, Info);
|
||||||
|
return Info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Lenheart_SoulSalvation_Fun(obj) {
|
||||||
|
local RootTab = getroottable();
|
||||||
|
if (!RootTab.rawin("SoulSalvation_Obj")) {
|
||||||
|
RootTab.rawset("SoulSalvation_Obj", SoulSalvationC());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (KeyPressNB.isKeyPress(OPTION_HOTKEY_PAUSE_IN_TOWER, "asdasd")) {
|
||||||
|
local os = sq_CreateAICharacter(21435);
|
||||||
|
// foreach(member, val in os.getclass()) {
|
||||||
|
// ::print(member + "\n");
|
||||||
|
// local attr;
|
||||||
|
// if ((attr = os.getclass().getattributes(member)) != null) {
|
||||||
|
// foreach(i, v in attr) {
|
||||||
|
// // ::print("\t" + i + " = " + (typeof v) + "\n");
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// // ::print("\t<no attributes>\n")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// local os = sq_CreateAICharacter(21435);
|
||||||
|
os.setCurrentPos(obj.getXPos() + 100, obj.getYPos(), 600);
|
||||||
|
os.setMaster(obj);
|
||||||
|
os.setMapFollowParent(obj);
|
||||||
|
os.setMapFollowType(1);
|
||||||
|
// sq_SetKeyxEnable(obj, E_ATTACK_COMMAND, true);
|
||||||
|
sq_AddObject(obj, os, OBJECTTYPE_CHARACTER, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getroottable()["LenheartFuncTab"].rawset("SoulSalvationFuncN", Lenheart_SoulSalvation_Fun);
|
||||||
|
|
||||||
|
|
||||||
|
L_Windows_List <- [];
|
||||||
|
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||||||
|
getroottable().rawdelete("EventList_Obj")
|
||||||
|
getroottable().rawdelete("SoulSalvation_Obj");
|
||||||
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
@ -0,0 +1,225 @@
|
||||||
|
/*
|
||||||
|
文件名:SoulSalvation_Enchant.nut
|
||||||
|
路径:Project/SoulSalvation/SoulSalvation_Enchant.nut
|
||||||
|
创建日期:2026-01-26 02:56
|
||||||
|
文件用途:
|
||||||
|
*/
|
||||||
|
class SoulSalvation_EnchantC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
Visible = false;
|
||||||
|
|
||||||
|
Img = Rindro_Image("interface2/ui/newitemtool/soulweapon.img");
|
||||||
|
|
||||||
|
//装备
|
||||||
|
Item = null;
|
||||||
|
//装备槽位
|
||||||
|
ItemSlot = null;
|
||||||
|
//灵魂槽位
|
||||||
|
ItemSlot2 = null;
|
||||||
|
//注册的NPC列表
|
||||||
|
NPC = null;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
InifPvf();
|
||||||
|
RegNpc();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
|
DiscardItemCallBackFunc.rawset("SoulSalvation_EnchantC", DiscardItem.bindenv(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
//关闭按钮
|
||||||
|
local CloseButton = LenheartNewUI_BaseButton(274, 4, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
|
CloseButton.OnClick = function() {
|
||||||
|
this.Visible = false;
|
||||||
|
}.bindenv(this);
|
||||||
|
Childrens.append(CloseButton);
|
||||||
|
|
||||||
|
//确认按钮
|
||||||
|
local CrossoverButton = LenheartNewUI_ButtonText(109, 260, 15, "确认升级");
|
||||||
|
CrossoverButton.DWidth = 18;
|
||||||
|
CrossoverButton.Width = 74;
|
||||||
|
CrossoverButton.SetTextOffset(-4, 1);
|
||||||
|
CrossoverButton.OnClickEx = function(Btn) {
|
||||||
|
if (!Btn.Visible) return;
|
||||||
|
SendPackEx({
|
||||||
|
op = 21011009,
|
||||||
|
item = Item
|
||||||
|
});
|
||||||
|
}.bindenv(this);
|
||||||
|
CrossoverButton.SetCallBackFunc(function(Btn) {
|
||||||
|
if (ItemSlot.ItemObject && ItemSlot2.ItemObject) {
|
||||||
|
Btn.State = 0;
|
||||||
|
} else {
|
||||||
|
Btn.State = 8;
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(CrossoverButton);
|
||||||
|
|
||||||
|
ItemSlot = LenheartNewUI_ItemSlot(66, 97);
|
||||||
|
ItemSlot.SetRemoveCallBack(function(obj) {
|
||||||
|
Item = null;
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(ItemSlot);
|
||||||
|
|
||||||
|
ItemSlot2 = LenheartNewUI_ItemSlot(197, 97);
|
||||||
|
ItemSlot2.SetRemoveCallBack(function(obj) {
|
||||||
|
Item = null;
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(ItemSlot2);
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
//背景框
|
||||||
|
DrawNineBox(X, Y, 292, 292, "interface/lenheartwindowcommon.img", 213);
|
||||||
|
//标题
|
||||||
|
DrawWindowTitle(293);
|
||||||
|
//绘制标题名
|
||||||
|
L_sq_DrawCode("灵魂武器附灵", X + 110, Y + 5, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
|
||||||
|
Img.DrawPng(1, X + 8, Y + 32);
|
||||||
|
Img.DrawPng(3, X + 8, Y + 32);
|
||||||
|
|
||||||
|
for (local i = 0; i< 5; i++) {
|
||||||
|
Img.DrawPng(2, X + 31 + 51 * i, Y + 195);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
local SlotPos = 0;
|
||||||
|
|
||||||
|
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, ItemSlot.X, ItemSlot.Y, ItemSlot.Width, ItemSlot.Height)) {
|
||||||
|
SlotPos = 1;
|
||||||
|
} else if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, ItemSlot2.X, ItemSlot2.Y, ItemSlot2.Width, ItemSlot2.Height)) {
|
||||||
|
SlotPos = 2;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (!Visible) return true;
|
||||||
|
else {
|
||||||
|
Item = FindItemPosByForeachInven(ItemAddress, SlotPos);
|
||||||
|
if (Item) {
|
||||||
|
local ItemObject = Rindro_Item();
|
||||||
|
ItemObject.LoadByAddress(Item.ItemAddress);
|
||||||
|
if (SlotPos == 1)
|
||||||
|
ItemSlot.SetItem(ItemObject);
|
||||||
|
else if (SlotPos == 2)
|
||||||
|
ItemSlot2.SetItem(ItemObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//遍历背包查找Item
|
||||||
|
function FindItemPosByForeachInven(FindAddress, SlotPos) {
|
||||||
|
local Inven = L_sq_RA(0x1A5FB24);
|
||||||
|
local InvenAdd = L_sq_RA(Inven + 56);
|
||||||
|
InvenAdd += 36;
|
||||||
|
//0是装备 2是任务材料
|
||||||
|
local z = 0;
|
||||||
|
if (SlotPos == 2) z = 2;
|
||||||
|
for (local i = 0; i< 56; i++) {
|
||||||
|
local ItemAdd = L_sq_RA(InvenAdd + ((i + (z * 56)) * 4));
|
||||||
|
if (ItemAdd == FindAddress) {
|
||||||
|
local NamePointer = L_sq_RA(FindAddress + 0x20);
|
||||||
|
local rRarity = L_sq_RA(FindAddress + 0xF4);
|
||||||
|
local rItemId = L_sq_RA(FindAddress + 0x1c);
|
||||||
|
if (SlotPos == 1) {
|
||||||
|
if (!getroottable().SoulSalvation_Obj.Equipment2List.rawin(rItemId)) return null;
|
||||||
|
} else if (SlotPos == 2) {
|
||||||
|
if (rItemId< 92208 || rItemId > 92214) return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
Type = z,
|
||||||
|
Pos = i,
|
||||||
|
Vis = false,
|
||||||
|
Count = MemoryTool.DecodeMemoryData(FindAddress + 0x1A4),
|
||||||
|
ItemId = rItemId,
|
||||||
|
ItemAddress = FindAddress,
|
||||||
|
Name = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString(),
|
||||||
|
Rarity = rRarity,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function RegNpc() {
|
||||||
|
local EachManager = Lenheart_Get_EachObj();
|
||||||
|
EachManager.AddEachForNpc(NPC, function(SThis) {
|
||||||
|
//关闭按钮
|
||||||
|
local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3);
|
||||||
|
ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img";
|
||||||
|
ApplyEngagementButton.IconIdx = 53;
|
||||||
|
ApplyEngagementButton.Str = "释魂附灵";
|
||||||
|
ApplyEngagementButton.Data = SThis.NPC_Index;
|
||||||
|
ApplyEngagementButton.OnClick = function(Button) {
|
||||||
|
|
||||||
|
InitWindow();
|
||||||
|
//打开背包
|
||||||
|
L_sq_Open_ExWindow(0x1ADE090, 0, 0, 1);
|
||||||
|
Button.Parent.CloseAllEach();
|
||||||
|
Button.Parent.CloseWindow();
|
||||||
|
ResetFocus();
|
||||||
|
R_Utils.PlaySound("WINDOW_SHOW");
|
||||||
|
}.bindenv(this);
|
||||||
|
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
|
||||||
|
SThis.AddChild(ApplyEngagementButton);
|
||||||
|
}.bindenv(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
//读取配置
|
||||||
|
function InifPvf() {
|
||||||
|
Rindro_Script.GetFileData("etc/rindro/expandequipment/soulsalvation.etc", function(DataTable, Data) {
|
||||||
|
while (!Data.Eof()) {
|
||||||
|
local Fragment = Data.Get();
|
||||||
|
if (Fragment == "[STAGE2 NPC]") {
|
||||||
|
NPC = Data.Get();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function InitWindow() {
|
||||||
|
Visible = true;
|
||||||
|
//清空
|
||||||
|
Item = null;
|
||||||
|
ItemSlot.RemoveItem();
|
||||||
|
ItemSlot2.RemoveItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
L_Windows_List <- [];
|
||||||
|
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||||||
|
getroottable().rawdelete("EventList_Obj")
|
||||||
|
getroottable().rawdelete("SoulSalvation_Obj");
|
||||||
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
@ -0,0 +1,290 @@
|
||||||
|
/*
|
||||||
|
文件名:SoulSalvation_Upgrade.nut
|
||||||
|
路径:Project/SoulSalvation/SoulSalvation_Upgrade.nut
|
||||||
|
创建日期:2026-01-23 10:46
|
||||||
|
文件用途:
|
||||||
|
*/
|
||||||
|
class SoulSalvation_UpgradeC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
Visible = false;
|
||||||
|
|
||||||
|
Img = Rindro_Image("interface2/ui/newitemtool/soulweapon.img");
|
||||||
|
|
||||||
|
//装备
|
||||||
|
Item = null;
|
||||||
|
//装备槽位
|
||||||
|
ItemSlot = null;
|
||||||
|
//注册的NPC列表
|
||||||
|
NPC = null;
|
||||||
|
//所需的基础材料
|
||||||
|
BasicMaterials = null;
|
||||||
|
//等级倍率
|
||||||
|
LevelRate = null;
|
||||||
|
//品级倍率
|
||||||
|
RarityRate = null;
|
||||||
|
|
||||||
|
//错误
|
||||||
|
Error = null;
|
||||||
|
|
||||||
|
//错误信息
|
||||||
|
ErrorMsg = null;
|
||||||
|
//所需材料信息
|
||||||
|
MaterialInfo = null;
|
||||||
|
//所需材料是否足够
|
||||||
|
MaterialIsEnough = false;
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
InifPvf();
|
||||||
|
RegNpc();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
|
DiscardItemCallBackFunc.rawset("SoulSalvation_UpgradeC", DiscardItem.bindenv(this));
|
||||||
|
|
||||||
|
//检查材料
|
||||||
|
Pack_Control.rawset(21011008, function(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
if (Jso.rawin("error")) {
|
||||||
|
ErrorMsg = Jso.error;
|
||||||
|
}
|
||||||
|
if (Jso.rawin("MgInfo")) {
|
||||||
|
MaterialInfo = Jso.MgInfo;
|
||||||
|
//材料是否充足
|
||||||
|
MaterialIsEnough = true;
|
||||||
|
foreach(Info in MaterialInfo) {
|
||||||
|
if (Info.NeedCount > Info.RealCount) {
|
||||||
|
MaterialIsEnough = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
//成功回包
|
||||||
|
Pack_Control.rawset(21011010, function(Chunk) {
|
||||||
|
//清空
|
||||||
|
Item = null;
|
||||||
|
ItemSlot.RemoveItem();
|
||||||
|
ErrorMsg = null;
|
||||||
|
MaterialInfo = null;
|
||||||
|
MaterialIsEnough = false;
|
||||||
|
// R_Utils.PlaySound("CHNUTTREE_BOX");
|
||||||
|
}.bindenv(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
//关闭按钮
|
||||||
|
local CloseButton = LenheartNewUI_BaseButton(274, 4, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
|
CloseButton.OnClick = function() {
|
||||||
|
this.Visible = false;
|
||||||
|
}.bindenv(this);
|
||||||
|
Childrens.append(CloseButton);
|
||||||
|
|
||||||
|
//确认按钮
|
||||||
|
local CrossoverButton = LenheartNewUI_ButtonText(109, 260, 15, "确认升级");
|
||||||
|
CrossoverButton.DWidth = 18;
|
||||||
|
CrossoverButton.Width = 74;
|
||||||
|
CrossoverButton.SetTextOffset(-4, 1);
|
||||||
|
CrossoverButton.OnClickEx = function(Btn) {
|
||||||
|
if (!Btn.Visible) return;
|
||||||
|
SendPackEx({
|
||||||
|
op = 21011009,
|
||||||
|
item = Item
|
||||||
|
});
|
||||||
|
}.bindenv(this);
|
||||||
|
CrossoverButton.SetCallBackFunc(function(Btn) {
|
||||||
|
if (ErrorMsg || !MaterialIsEnough) {
|
||||||
|
Btn.State = 8;
|
||||||
|
} else {
|
||||||
|
Btn.State = 0;
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(CrossoverButton);
|
||||||
|
|
||||||
|
ItemSlot = LenheartNewUI_ItemSlot(132, 100);
|
||||||
|
ItemSlot.SetRemoveCallBack(function(obj) {
|
||||||
|
Item = null;
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(ItemSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
//背景框
|
||||||
|
DrawNineBox(X, Y, 292, 292, "interface/lenheartwindowcommon.img", 213);
|
||||||
|
//标题
|
||||||
|
DrawWindowTitle(293);
|
||||||
|
//绘制标题名
|
||||||
|
L_sq_DrawCode("灵魂武器进阶", X + 110, Y + 5, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
|
||||||
|
Img.DrawPng(1, X + 8, Y + 32);
|
||||||
|
Img.DrawPng(0, X + 8, Y + 32);
|
||||||
|
|
||||||
|
//绘制进阶所需材料及数量信息
|
||||||
|
if (MaterialInfo) {
|
||||||
|
for (local i = 0; i< 5; i++) {
|
||||||
|
if (i >= MaterialInfo.len()) {
|
||||||
|
Img.DrawPng(2, X + 31 + 51 * i, Y + 195);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
local Info = MaterialInfo[i];
|
||||||
|
DrawItemBase(X + 31 + 51 * i, Y + 195, Info.Item, Info.NeedCount);
|
||||||
|
//数量不足绘制遮盖图
|
||||||
|
if (Info.NeedCount > Info.RealCount) {
|
||||||
|
Rindro_Image_GlobalMap["lenheartui"].DrawExPng(257, X + 32 + 51 * i, Y + 196, 0, sq_RGBA(255, 255, 255, 120), 1.0, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
local RealCountStr = Info.RealCount.tostring();
|
||||||
|
local Color = Info.RealCount >= Info.NeedCount ? sq_RGBA(52, 255, 50, 255) : sq_RGBA(255, 60, 47, 255);
|
||||||
|
L_sq_DrawCode(RealCountStr, X + 46 + (51 * i) - LenheartTextClass.GetStringLength(RealCountStr) / 2, Y + 232, Color, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!MaterialIsEnough) {
|
||||||
|
local str = "进阶材料不足!";
|
||||||
|
L_sq_DrawCode(str, X + 148 - LenheartTextClass.GetStringLength(str) / 2, Y + 142, sq_RGBA(255, 60, 48, 255), 0, 1);
|
||||||
|
} else {
|
||||||
|
local str = Item.Name;
|
||||||
|
L_sq_DrawCode(str, X + 148 - LenheartTextClass.GetStringLength(str) / 2, Y + 142, GetRarityColor(Item.Rarity), 0, 1);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ErrorMsg) {
|
||||||
|
local ErrorStr = null;
|
||||||
|
if (ErrorMsg == 2) ErrorStr = "所需灵魂不足!";
|
||||||
|
else if (ErrorMsg == 1) ErrorStr = "装备不可进阶!"
|
||||||
|
L_sq_DrawCode(ErrorStr, X + 148 - LenheartTextClass.GetStringLength(ErrorStr) / 2, Y + 142, sq_RGBA(255, 60, 48, 255), 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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 {
|
||||||
|
Item = FindItemPosByForeachInven(ItemAddress);
|
||||||
|
if (Item) {
|
||||||
|
local ItemObject = Rindro_Item();
|
||||||
|
ItemObject.LoadByAddress(Item.ItemAddress);
|
||||||
|
ItemSlot.SetItem(ItemObject);
|
||||||
|
SendPackEx({
|
||||||
|
op = 21011007,
|
||||||
|
item = Item
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//遍历背包查找Item
|
||||||
|
function FindItemPosByForeachInven(FindAddress) {
|
||||||
|
local Inven = L_sq_RA(0x1A5FB24);
|
||||||
|
local InvenAdd = L_sq_RA(Inven + 56);
|
||||||
|
InvenAdd += 36;
|
||||||
|
for (local z = 0; z< 1; 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;
|
||||||
|
}
|
||||||
|
local rRarity = L_sq_RA(FindAddress + 0xF4);
|
||||||
|
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 = rRarity,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function RegNpc() {
|
||||||
|
local EachManager = Lenheart_Get_EachObj();
|
||||||
|
EachManager.AddEachForNpc(NPC, function(SThis) {
|
||||||
|
//关闭按钮
|
||||||
|
local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3);
|
||||||
|
ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img";
|
||||||
|
ApplyEngagementButton.IconIdx = 53;
|
||||||
|
ApplyEngagementButton.Str = "镇魂进阶";
|
||||||
|
ApplyEngagementButton.Data = SThis.NPC_Index;
|
||||||
|
ApplyEngagementButton.OnClick = function(Button) {
|
||||||
|
|
||||||
|
InitWindow();
|
||||||
|
//打开背包
|
||||||
|
L_sq_Open_ExWindow(0x1ADE090, 0, 0, 1);
|
||||||
|
Button.Parent.CloseAllEach();
|
||||||
|
Button.Parent.CloseWindow();
|
||||||
|
ResetFocus();
|
||||||
|
R_Utils.PlaySound("WINDOW_SHOW");
|
||||||
|
}.bindenv(this);
|
||||||
|
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
|
||||||
|
SThis.AddChild(ApplyEngagementButton);
|
||||||
|
}.bindenv(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
//读取配置
|
||||||
|
function InifPvf() {
|
||||||
|
Rindro_Script.GetFileData("etc/rindro/expandequipment/soulsalvation.etc", function(DataTable, Data) {
|
||||||
|
while (!Data.Eof()) {
|
||||||
|
local Fragment = Data.Get();
|
||||||
|
if (Fragment == "[STAGE1 NPC]") {
|
||||||
|
NPC = Data.Get();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function InitWindow() {
|
||||||
|
Visible = true;
|
||||||
|
//清空
|
||||||
|
Item = null;
|
||||||
|
ItemSlot.RemoveItem();
|
||||||
|
ErrorMsg = null;
|
||||||
|
MaterialInfo = null;
|
||||||
|
MaterialIsEnough = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
L_Windows_List <- [];
|
||||||
|
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||||||
|
getroottable().rawdelete("EventList_Obj")
|
||||||
|
getroottable().rawdelete("SoulSalvation_Obj");
|
||||||
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
@ -0,0 +1,174 @@
|
||||||
|
class TorturegiftC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//状态 0展示状态 1滚动状态
|
||||||
|
MacState = 0;
|
||||||
|
|
||||||
|
ItemNameColor = [
|
||||||
|
0xffffffff, //白装
|
||||||
|
0xffedd568, //蓝装
|
||||||
|
0xffff6bb3, //紫装
|
||||||
|
0xfff000ff, //粉装
|
||||||
|
0xff0082ff, //传说
|
||||||
|
0xff00b1ff //史诗
|
||||||
|
]
|
||||||
|
|
||||||
|
//红眼闪光动画
|
||||||
|
EyesAnimotion = null;
|
||||||
|
|
||||||
|
|
||||||
|
//当前道具组
|
||||||
|
ItemShowArr = null;
|
||||||
|
//轮播时间
|
||||||
|
PlayT = 0;
|
||||||
|
//轮播速度
|
||||||
|
PlayRate = 2;
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
ItemShowArr = [];
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
|
local FrameArr = [];
|
||||||
|
for (local i = 0; i< 23; i++) {
|
||||||
|
local T = {
|
||||||
|
ImgIndex = 3 + i,
|
||||||
|
Delay = 60,
|
||||||
|
Pos = [0, 0]
|
||||||
|
}
|
||||||
|
FrameArr.append(T);
|
||||||
|
}
|
||||||
|
EyesAnimotion = Lenheart_Ani("null", FrameArr, [100, 100]);
|
||||||
|
EyesAnimotion.ImgPath = "contents/2022/bakalraid/ui/bakal_reward/title.img";
|
||||||
|
|
||||||
|
|
||||||
|
for (local i = 0; i< 50; i++) {
|
||||||
|
local T = {
|
||||||
|
XOffset = (i * 170),
|
||||||
|
YOffset = 213,
|
||||||
|
ItemId = 3037,
|
||||||
|
ItemCount = 100,
|
||||||
|
Grade = 5,
|
||||||
|
Name = "无色小晶体"
|
||||||
|
}
|
||||||
|
ItemShowArr.append(T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
//关闭按钮
|
||||||
|
local CloseButton = LenheartNewUI_BaseButton(432, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
|
CloseButton.OnClick = function() {
|
||||||
|
this.Visible = false;
|
||||||
|
}.bindenv(this);
|
||||||
|
Childrens.append(CloseButton);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//绘制卡牌
|
||||||
|
function DrawRewardCard(CardInfo) {
|
||||||
|
//绘制卡牌底
|
||||||
|
L_sq_DrawImg("rindro_ui/torturegift.img", 4, X + CardInfo.XOffset, Y + CardInfo.YOffset);
|
||||||
|
//绘制品级框底槽
|
||||||
|
L_sq_DrawImg("rindro_ui/torturegift_grade.img", CardInfo.Grade, X + CardInfo.XOffset + 64, Y + CardInfo.YOffset + 26);
|
||||||
|
//绘制名称
|
||||||
|
L_sq_DrawCode(CardInfo.Name, X + CardInfo.XOffset + 82 - LenheartTextClass.GetStringLength(CardInfo.Name) / 2, Y + CardInfo.YOffset + 70, ItemNameColor[CardInfo.Grade], 0, 1);
|
||||||
|
|
||||||
|
//绘制物品
|
||||||
|
DrawItemBase(X + CardInfo.XOffset + 67, Y + CardInfo.YOffset + 29, CardInfo.ItemId, CardInfo.ItemCount);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
//绘制背景框标题栏
|
||||||
|
L_sq_DrawImg("rindro_ui/torturegift.img", 0, X, Y);
|
||||||
|
//轨道底层
|
||||||
|
L_sq_DrawImg("rindro_ui/torturegift.img", 1, X + 6, Y + 198);
|
||||||
|
//上牛头
|
||||||
|
L_sq_DrawImg("rindro_ui/torturegift.img", 2, X + 114, Y + 175);
|
||||||
|
//下
|
||||||
|
L_sq_DrawImg("rindro_ui/torturegift.img", 3, X + 114, Y + 336);
|
||||||
|
//指针
|
||||||
|
L_sq_DrawImg("rindro_ui/torturegift.img", 5, X + 215, Y + 320);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
|
||||||
|
DrawMain(obj);
|
||||||
|
|
||||||
|
|
||||||
|
setClip(X + 30, Y, X + 422, Y + 454); //开始裁切
|
||||||
|
local AddOffset = 0;
|
||||||
|
PlayT += Duration;
|
||||||
|
if (PlayT >= 30) {
|
||||||
|
AddOffset = (1 * PlayRate);
|
||||||
|
PlayT = 0;
|
||||||
|
}
|
||||||
|
foreach(_index, infoobj in ItemShowArr) {
|
||||||
|
if (AddOffset) {
|
||||||
|
infoobj.XOffset -= AddOffset;
|
||||||
|
// if (_index == 0) print(infoobj.XOffset);
|
||||||
|
if (infoobj.XOffset <= -200) infoobj.XOffset += (ItemShowArr.len()) * 170;
|
||||||
|
}
|
||||||
|
DrawRewardCard(infoobj);
|
||||||
|
}
|
||||||
|
releaseClip(); //裁切结束
|
||||||
|
|
||||||
|
if (ItemInfoDrawS && MacState == 0) {
|
||||||
|
PlayRate = 0;
|
||||||
|
} else if (MacState == 0) {
|
||||||
|
PlayRate = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// L_sq_SetDrawImgModel(2, 0);
|
||||||
|
// EyesAnimotion.X = X - 122;
|
||||||
|
// EyesAnimotion.Y = Y + 110;
|
||||||
|
// EyesAnimotion.Show(Duration);
|
||||||
|
// L_sq_ReleaseDrawImgModel();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
L_Windows_List <- [];
|
||||||
|
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||||||
|
getroottable().rawdelete("EventList_Obj")
|
||||||
|
getroottable().rawdelete("TorturegiftC_Obj");
|
||||||
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function Lenheart_Torturegift_New(obj) {
|
||||||
|
local RootTab = getroottable();
|
||||||
|
if (!RootTab.rawin("TorturegiftC_Obj")) {
|
||||||
|
RootTab.rawset("TorturegiftC_Obj", true);
|
||||||
|
LenheartNewUI_CreateWindow(TorturegiftC, "折磨之礼窗口", 210, 64, 452, 454, 22);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getroottable().rawin("LenheartFuncTab")) {
|
||||||
|
getroottable()["LenheartFuncTab"].rawset("Lenheart_Torturegift_NewFunc", Lenheart_Torturegift_New);
|
||||||
|
} else {
|
||||||
|
local T = {};
|
||||||
|
T.rawset("Lenheart_Torturegift_NewFunc", Lenheart_Torturegift_New);
|
||||||
|
getroottable().rawset("LenheartFuncTab", T);
|
||||||
|
}
|
||||||
|
|
@ -235,5 +235,20 @@
|
||||||
},
|
},
|
||||||
"Project/FixItemCout": {
|
"Project/FixItemCout": {
|
||||||
"description": "修复道具数量显示"
|
"description": "修复道具数量显示"
|
||||||
|
},
|
||||||
|
"Project/Torturegift": {
|
||||||
|
"description": "折磨之礼"
|
||||||
|
},
|
||||||
|
"Project/FixItemDrawUuid": {
|
||||||
|
"description": "开启装备uuid显示"
|
||||||
|
},
|
||||||
|
"Project/NewItemInfoWindow": {
|
||||||
|
"description": "新物品信息窗口"
|
||||||
|
},
|
||||||
|
"Project/SoulSalvation": {
|
||||||
|
"description": "灵魂武器"
|
||||||
|
},
|
||||||
|
"Project/NewTitle": {
|
||||||
|
"description": "称谓系统"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue