新增自定义动画类,修复道具数量显示功能,更新项目脚本配置,禁用多个项目功能,调整UI元素位置,删除无用文件。

This commit is contained in:
2026-01-14 20:28:24 +08:00
parent 955b2fdabe
commit 6431e2ef38
35 changed files with 668 additions and 7213 deletions

View File

@@ -186,4 +186,5 @@ function L_drawMainCustomUI_All() {
// ::print("\t<no attributes>\n")
// }
// }
// }

View File

@@ -1505,6 +1505,7 @@ class LenheartNewUI_ItemSlot extends LenheartNewUI_CommonUi {
ItemCount = null;
ItemObject = null;
ItemInfoWindow = null;
HoverFlag = false;
//禁止点击
NoClick = false;
@@ -1535,6 +1536,19 @@ class LenheartNewUI_ItemSlot extends LenheartNewUI_CommonUi {
}
}
}
CheckInRect();
}
function CheckInRect() {
local MousePos_X = IMouse.GetXPos();
local MousePos_Y = IMouse.GetYPos();
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, 30, 30)) {
//绘制悬停框
L_sq_SetDrawImgModel(2, 0);
Rindro_Image_GlobalMap["lenheartui"].DrawPng(353, X, Y);
L_sq_ReleaseDrawImgModel();
HoverFlag = true;
} else HoverFlag = false;
}
function SetItem(item) {

View File

@@ -0,0 +1,90 @@
/*
文件名:CustomAnimation_Class.nut
路径:Base/_Tool/CustomAnimation_Class.nut
创建日期:2026-01-13 19:54
文件用途:
*/
class Rindro_CustomAnimation {
//Img路径
ImgPath = null;
//Img对象
Img = null;
//帧信息
ImgFrame = null;
//播放状态
State = 0;
//循环
LoopFlag = true;
//当前帧数
CurFrame = 0;
//初始化时间
InitTime = 0;
//Ani当前帧播放时间
PlayCurTime = 0;
//img 路径 调用帧数组
constructor(path, frame) {
ImgPath = path.tolower();
Img = Rindro_Image(ImgPath);
ImgFrame = frame;
InitTime = Clock();
State = 1;
//预载入img
foreach(FrameObj in ImgFrame) {
Img.DrawPng(FrameObj.ImgIndex, -999, 999);
}
}
function Show(dt, X, Y) {
if (State == 1) {
if (ImgFrame) {
local NowFrameObj = ImgFrame[CurFrame];
PlayCurTime += dt;
Img.DrawPng(NowFrameObj.ImgIndex, NowFrameObj.Pos[0] + X, NowFrameObj.Pos[1] + Y);
if (PlayCurTime >= NowFrameObj.Delay) {
CurFrame++;
//播放完成
if (CurFrame >= ImgFrame.len()) {
if (LoopFlag) CurFrame = 0;
else State = 0;
}
InitTime = Clock();
PlayCurTime = 0;
}
}
}
}
function ShowEx(dt, X, Y, gRgba, rate_x, rate_y) {
if (State == 1) {
if (ImgFrame) {
local NowFrameObj = ImgFrame[CurFrame];
PlayCurTime += dt;
Img.DrawExPng(NowFrameObj.ImgIndex, NowFrameObj.Pos[0] + X, NowFrameObj.Pos[1] + Y, 0, gRgba, rate_x, rate_y);
if (PlayCurTime >= NowFrameObj.Delay) {
CurFrame++;
//播放完成
if (CurFrame >= ImgFrame.len()) {
if (LoopFlag) CurFrame = 0;
else State = 0;
}
InitTime = Clock();
PlayCurTime = 0;
}
}
}
}
function Reset() {
CurFrame = 0;
State = 1;
}
}

View File

@@ -408,3 +408,39 @@ Rindro_Haker.LoadHook(0x7B64BA, ["int", "int", "bool"],
// TTTAni <- args.pop();
return null;
});
// Rindro_Haker.LoadHook(0x7FFA80, ["int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int", "void"],
// function(args) {
// if(args[0] == 0xA){
// args[1] = 4600563;
// printf("切换武器")
// return args;
// }
// // foreach (Func in WearOrRemoveEquipmentCallBackFunc) {
// // Func(args);
// // }
// // print(args[1]);
// // local ThisC = NativePointer(0x1A5FB24).readInt();
// // local Slot = NativePointer(Rindro_Haker.CpuContext.ebp).add(8).readInt();
// // local EquiObj = L_Sq_CallFunc(0x7B03C0, "int", FFI_FASTCALL, ["int", "int", "int"], ThisC, 0, Slot);
// // if (EquiObj) {
// // local Index = NativePointer(EquiObj).add(0x1c).readInt();
// // print(Index);
// // }
// return null;
// },
// function(args) {
// // print(666);
// // print(format("%02x", args.pop()));
// // TTTAni <- args.pop();
// return null;
// });
// NativePointer(0x8266F5).writeShort(0x9090)
// NativePointer(0x78FD37).writeShort(0x9090)
// NativePointer(0x78FD3B).writeShort(0x9090)

View File

@@ -239,6 +239,8 @@ class Rindro_Script {
local Key = Rindro_Script.GetBinString(FindKey);
if (Key) {
local StrFilePath = Key.tolower();
local Type = StrFilePath.slice(0, StrFilePath.find("/")).tolower();
getroottable().RindroLoadStringTable.rawset(Type, {});
local StrFile = R_Utils.GetScriptFileReader(StrFilePath, 10240000);
if (StrFile) {
local StrBuffer = StrFile.Buffer.readUtf8String(StrFile.Size);
@@ -247,7 +249,7 @@ class Rindro_Script {
if (strobj.find(">") != null) {
local strobjarr = split(strobj, ">");
if (strobjarr.len() > 1) {
getroottable().RindroLoadStringTable.rawset(strobjarr[0], Sq_ConvertWideChar(strobjarr[1], "big5"));
getroottable().RindroLoadStringTable[Type].rawset(strobjarr[0], Sq_ConvertWideChar(strobjarr[1], "big5"));
}
}
}
@@ -293,17 +295,28 @@ class Rindro_Script {
}
}
function GetLoadString(Key) {
if (getroottable().RindroLoadStringTable.rawin(Key)) return getroottable().RindroLoadStringTable[Key];
function GetLoadString(Type, Key) {
if (getroottable().RindroLoadStringTable.rawin(Type) && getroottable().RindroLoadStringTable[Type].rawin(Key)) return getroottable().RindroLoadStringTable[Type][Key];
else return "";
}
function UnpackData(IO, i) {
function UnpackData(IO, i, Type) {
local out = "";
IO.seek(i); //内容指示位
local currentByte = IO.readn('c'); //内容指示位
local after = IO.GetInt();
switch (currentByte) {
case 9: {
local NewcurrentByte = IO.readn('c');
local Newafter = IO.GetInt();
local Buf = Rindro_Script.GetBinString(after);
if (!Buf) {
Buf = "";
} else {
Buf = Rindro_Script.GetLoadString(Type, Buf);
}
return Buf;
}
case 10: {
IO.seek(i - 4);
local Before = IO.readn('i');
@@ -311,7 +324,7 @@ class Rindro_Script {
if (!Buf) {
Buf = "";
} else {
Buf = "<" + Before + "::" + Buf + "`" + Rindro_Script.GetLoadString(Buf) + "`>";
Buf = "<" + Before + "::" + Buf + "`" + Rindro_Script.GetLoadString(Type, Buf) + "`>";
}
Buf = Buf + "\r\n";
out += Buf;
@@ -327,8 +340,7 @@ class Rindro_Script {
Bbuf.writen(after, 'i');
Bbuf.seek(0);
local Buf = Bbuf.readn('f');
out += after + '\t';
break;
return Buf;
}
case 6:
case 8:
@@ -338,15 +350,8 @@ class Rindro_Script {
if (!Buf) Buf = "";
return Buf;
}
case 9: {
IO.seek(i + 6);
local Before = IO.readn('i');
local Buf = Rindro_Script.GetBinString(Before);
out += Rindro_Script.GetLoadString(Buf);
}
default:
out += "";
break;
return "";
}
return out;
@@ -363,24 +368,24 @@ class Rindro_Script {
local i = 2;
while (true) {
if (i< ReadObject.Size && ReadObject.Size - i >= 5) {
local str = Rindro_Script.UnpackData(IO, i);
local str = Rindro_Script.UnpackData(IO, i, "equipment");
i += 5;
//名称
if (str == "[name]") {
local RealKey = str.slice(1, str.len() - 1);
EquipmentAtt[RealKey] <- Rindro_Script.UnpackData(IO, i);
EquipmentAtt[RealKey] <- Rindro_Script.UnpackData(IO, i, "equipment");
i += 5;
}
//装备类型
else if (str == "[equipment type]") {
local Buf = Rindro_Script.UnpackData(IO, i);
local Buf = Rindro_Script.UnpackData(IO, i, "equipment");
EquipmentAtt["equipment_type"] <- Buf.slice(1, -1);
i += 5;
}
//称号动画
else if (str == "[custom animation]") {
local Buf = Rindro_Script.UnpackData(IO, i).tolower();
local Buf = Rindro_Script.UnpackData(IO, i, "equipment").tolower();
EquipmentAtt["custom_animation"] <- Buf;
i += 5;
}
@@ -389,12 +394,12 @@ class Rindro_Script {
EquipmentAtt["Aurora"] <- {};
EquipmentAtt["Aurora"].Back <- [];
EquipmentAtt["Aurora"].Front <- [];
local Count = Rindro_Script.UnpackData(IO, i);
local Count = Rindro_Script.UnpackData(IO, i, "equipment");
i += 5;
for (local z = 0; z< Count; z++) {
local Layer = Rindro_Script.UnpackData(IO, i);
local Layer = Rindro_Script.UnpackData(IO, i, "equipment");
i += 5;
local Path = Rindro_Script.UnpackData(IO, i).tolower();
local Path = Rindro_Script.UnpackData(IO, i, "equipment").tolower();
i += 5;
if (Layer == 0) EquipmentAtt["Aurora"].Back.append(Path);
if (Layer == 1) EquipmentAtt["Aurora"].Front.append(Path);
@@ -405,7 +410,7 @@ class Rindro_Script {
else if (str == "[hide layer]") {
EquipmentAtt["hidelayer"] <- [];
while (true) {
local Buffer = Rindro_Script.UnpackData(IO, i);
local Buffer = Rindro_Script.UnpackData(IO, i, "equipment");
i += 5;
if (Buffer == "[/hide layer]") {
break;
@@ -415,7 +420,7 @@ class Rindro_Script {
}
//Ani
else if (str == "[animation job]") {
local Job = Rindro_Script.UnpackData(IO, i).slice(1, -1);
local Job = Rindro_Script.UnpackData(IO, i, "equipment").slice(1, -1);
local SpacePos = Job.find(" ");
if (SpacePos) {
Job = Job.slice(0, SpacePos) + Job.slice(SpacePos + 1);
@@ -424,24 +429,24 @@ class Rindro_Script {
EquipmentAtt["Ani_" + Job] <- {};
i += 5;
local Index1 = Rindro_Script.UnpackData(IO, i);
local Index1 = Rindro_Script.UnpackData(IO, i, "equipment");
i += 5;
local Index2 = Rindro_Script.UnpackData(IO, i);
local Index2 = Rindro_Script.UnpackData(IO, i, "equipment");
i += 5;
EquipmentAtt["Ani_" + Job].variation <- [Index1, Index2];
EquipmentAtt["Ani_" + Job].layer_variation <- [];
while (true) {
try {
local Ret = Rindro_Script.UnpackData(IO, i);
local Ret = Rindro_Script.UnpackData(IO, i, "equipment");
i += 5;
if (Ret == "[animation job]" || (Rindro_Script.endswith(Ret, "]") && Ret != "[equipment ani script]" && Ret != "[layer variation]")) {
i -= 5;
break;
} else if (Ret == "[layer variation]") {
local InfoBuf = {};
InfoBuf.Zorder <- Rindro_Script.UnpackData(IO, i);
InfoBuf.Zorder <- Rindro_Script.UnpackData(IO, i, "equipment");
i += 5;
InfoBuf.Path <- Rindro_Script.UnpackData(IO, i);
InfoBuf.Path <- Rindro_Script.UnpackData(IO, i, "equipment");
i += 5;
EquipmentAtt["Ani_" + Job].layer_variation.append(InfoBuf);
}
@@ -692,13 +697,14 @@ class Rindro_Script {
function ResolvingData(IO, Func, Path) {
local DataTable = {};
DataTable.filepath <- Path;
local Type = Path.slice(0, Path.find("/")).tolower();
local DataArr = [];
local Length = IO.len();
if (Length >= 7) {
local i = 2;
while (true) {
if (i< Length && Length - i >= 5) {
local str = Rindro_Script.UnpackData(IO, i);
local str = Rindro_Script.UnpackData(IO, i, Type);
i += 5;
DataArr.push(str);
} else break;