This commit is contained in:
2025-08-27 08:45:37 +08:00
parent f3d0cbd222
commit 0d0465fad3
20 changed files with 2263 additions and 330 deletions

View File

@@ -62,18 +62,41 @@ function L_drawMainCustomUI_All() {
getroottable().LenheartPluginsInitFlag <- true;
}
// for (local i = 0; i< 100; i++) {
// for (local z = 0; z < 100; z++) {
// sq_PutPixel(sq_RGBA(230, 200, 155, 255), 200 + i, 200 + z);
// }
// }
// sq_DrawBox(100, 100, 100, 100, 0xffffffff);
// L_Sq_CallFunc(0x11E86C0, "char", FFI_STDCALL, ["int", "int", "int", "int", "int"], 10, 10, 750, 350, 0xffffffff);
// for (local i = 0; i< 100; i++) {
// for (local z = 0; z< 100; z++) {
// sq_PutPixel(sq_RGBA(230, 200, 155, 255), 200 + i, 200 + z);
// }
// }
// L_sq_Test(0x11A7B65);
// local Device = NativePointer(0x1B45AB8).readInt();
// print(format("Device:0x%02x", Device));
// L_sq_Test(Device);
// if (!TTTAAA) TTTAAA = Rindro_Draw_Character(0, [601590000, 1751501, 601500069], "rest.ani", null);
// if (TTTAAA) TTTAAA.Draw(120, 200);
}
// for (local i = 0; i < 42; i++) {
// local Value = MemoryTool.DecodeMemoryData(0x394e8c00+0x1050 + (i * 4));
// if(Value == 151)print("Value :" + i * 4);
// }
// print(MemoryTool.DecodeMemoryData(0x1DFFB240));
// MemoryTool.EncodeMemoryData(0x304bdc00+0x1054,7);
// MemoryTool.EncodeMemoryData(0x304bdc00+0x1054,7);
// TTTAAA <- null;
// L_NewWindows("Lenheart", 56, 0x1);
@@ -121,46 +144,46 @@ function L_drawMainCustomUI_All() {
// L_sq_GoDungeon(1504);
CargoType <- 0;
Sq_GetExeStr_Map[21910] <- function(Index) {
CargoType = 0;
return 21910;
}
Sq_GetExeStr_Map[21911] <- function(Index) {
CargoType = 1;
return 21911;
}
Rindro_Haker.LoadHook(0xE67800, ["int", "int"],
function(args) {
//点击了仓库转移物品
if (args[0] == 0x2B) {
if (CargoType == 0) {
printf("点击个人仓库转移物品");
local T = {
op = 21091001,
type = 0,
}
Rindro_BaseToolClass.SendPackEx(T);
return [0];
}
if (CargoType == 1) {
printf("点击账号仓库转移物品");
local T = {
op = 21091001,
type = 1,
}
Rindro_BaseToolClass.SendPackEx(T);
return [0];
}
}
return null;
},
function(args) {
// print(666);
// print(format("%02x", args.pop()));
// TTTAni <- args.pop();
return null;
});
// CargoType <- 0;
// Sq_GetExeStr_Map[21910] <- function(Index) {
// CargoType = 0;
// return 21910;
// }
// Sq_GetExeStr_Map[21911] <- function(Index) {
// CargoType = 1;
// return 21911;
// }
// Rindro_Haker.LoadHook(0xE67800, ["int", "int"],
// function(args) {
// //点击了仓库转移物品
// if (args[0] == 0x2B) {
// if (CargoType == 0) {
// printf("点击个人仓库转移物品");
// local T = {
// op = 21091001,
// type = 0,
// }
// Rindro_BaseToolClass.SendPackEx(T);
// return [0];
// }
// if (CargoType == 1) {
// printf("点击账号仓库转移物品");
// local T = {
// op = 21091001,
// type = 1,
// }
// Rindro_BaseToolClass.SendPackEx(T);
// return [0];
// }
// }
// return null;
// },
// function(args) {
// // print(666);
// // print(format("%02x", args.pop()));
// // TTTAni <- args.pop();
// return null;
// });

View File

@@ -105,7 +105,6 @@ class Rindro_Event extends LenheartNewUI_Windows {
//根据模式调整透明度
if (!BlinkMode) Alpha = sq_GetUniformVelocity(250, 130, RT, 500);
else Alpha = sq_GetUniformVelocity(130, 250, RT, 500);
//转换模式
if (RT >= 500) {
Timer = Clock();
@@ -172,6 +171,7 @@ class Rindro_EventList {
X = Jso.YosinEventIconInfoXpos;
Y = Jso.YosinEventIconInfoYpos;
getroottable()["LenheartEventOffset"] <- {
x = X - 456,
y = Y

View File

@@ -192,6 +192,9 @@ class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow {
Duration = 0.0;
DurationFlag = 0.0;
//是否是焦点
IsFocus = false;
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
ObjectId = gObjectId;
//宽度
@@ -211,6 +214,7 @@ class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow {
//调用原生方法
LenheartNewUI_BaseWindow.constructor();
}
//切换到最上层窗口 即得到焦点时
function ResetFocus() {
@@ -218,9 +222,17 @@ class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow {
foreach(Index, WindowObj in L_Windows_List) {
if (WindowObj.ObjectId == this.ObjectId) L_Windows_List.remove(Index);
}
for (local i = L_Windows_List.len() - 1; i >= 0; i--) {
if (L_Windows_List[i].ObjectId == this.ObjectId) {
L_Windows_List.remove(i);
}else{
L_Windows_List[i].IsFocus = false;
}
}
L_Windows_List.append(this);
//切换上层显示
getroottable().WindowsShowABFlag <- true;
IsFocus = true;
}
/*
@@ -329,7 +341,17 @@ class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow {
}
}
//绘制标题
function DrawWindowTitle(Width) {
//绘制标题
DrawTriptych(X - 1, Y, Width, "interface/lenheartwindowcommon.img", 9);
if (IsFocus) {
L_sq_SetDrawImgModel(2, 0);
DrawTriptychDetail(X - 1, Y , Width, "interface/lenheartwindowcommon.img", 109, 114, 115);
L_sq_ReleaseDrawImgModel();
}
}
//生成DT
function GenerateDt() {
try {
@@ -981,6 +1003,7 @@ class LenheartNewUI_BaseInput extends LenheartNewUI_CommonUi {
sliceCode = "|";
BaseTime = 0;
InputController = null;
CallBack = null;
constructor(X, Y, W, H) {
this.DWidth = W;
@@ -1015,8 +1038,11 @@ class LenheartNewUI_BaseInput extends LenheartNewUI_CommonUi {
if (InputController) {
local StrBuf = L_sq_GetInputBoxStr(InputController);
if (StrBuf != "LenheartNULL") str = StrBuf;
else {
if (StrBuf != "LenheartNULL") {
local oldStr = str;
str = StrBuf;
if (CallBack) CallBack(this, oldStr);
} else {
InputController = null;
InputState = 0;
}

View File

@@ -379,17 +379,21 @@ class Rindro_Draw_Character {
//光环单独处理 其他的在下面处理
if (Equ.equipment_type == "aurora avatar") {
foreach(Path in Equ.Aurora.Back) {
local AniBuf = Rindro_Animation(Path);
// local AniBuf = Rindro_Animation(Path);
AniList.append({
Ani = AniBuf,
Ani = Path,
AniName = Path + Clock(),
Layer = -10000,
DrawType = "Native"
});
}
foreach(Path in Equ.Aurora.Front) {
local AniBuf = Rindro_Animation(Path);
// local AniBuf = Rindro_Animation(Path);
AniList.append({
Ani = AniBuf,
Ani = Path,
AniName = Path + Clock(),
Layer = 10000,
DrawType = "Native"
});
}
}
@@ -476,8 +480,13 @@ class Rindro_Draw_Character {
function Draw(X, Y) {
foreach(AniInfo in DrawInfo) {
// print(AniInfo.Layer);
if (!HideMap.rawin(AniInfo.Layer))
AniInfo.Ani.Draw(X, Y);
if (!HideMap.rawin(AniInfo.Layer)) {
if (!AniInfo.rawin("DrawType") || AniInfo["DrawType"] != "Native") {
AniInfo.Ani.Draw(X, Y);
} else {
Rindro_BaseToolClass.DrawAniEx(X, Y, AniInfo.Ani, AniInfo.AniName);
}
}
}
if (Name) {

View File

@@ -114,6 +114,15 @@ class KeyPressNB {
//基础工具类
class Rindro_BaseToolClass {
function IsNumber(value) {
try {
local Buffer = value.tointeger();
return true;
} catch (exception) {
return false;
}
}
function GetItemNameById(ItemId) {
local ItemObject = L_sq_GetItem(ItemId);
local NamePointer = L_sq_RA(ItemObject + 0x20);
@@ -198,6 +207,42 @@ class Rindro_BaseToolClass {
return null;
}
function DrawTriptych(X, Y, Width, Img, StartIndex) {
//如果没有载入img就载入
if (!Rindro_Image_GlobalMap.rawin(Img)) {
Rindro_Image_GlobalMap[Img] <- Rindro_Image(Img);
}
Rindro_Image_GlobalMap[Img].DrawPng(StartIndex, X, Y);
//获取第一张图片的宽
local FirstW = Rindro_Image_GlobalMap[Img].GetPng(StartIndex).GetWidth();
//获取中间的图片宽
local MiddleW = Rindro_Image_GlobalMap[Img].GetPng(StartIndex + 1).GetWidth();
//获得最后一张图片的宽
local LastW = Rindro_Image_GlobalMap[Img].GetPng(StartIndex + 2).GetWidth();
//绘制中间
Rindro_Image_GlobalMap[Img].DrawExPng(StartIndex + 1, X + FirstW, Y, 0, sq_RGBA(255, 255, 255, 250), (Width - LastW - FirstW).tofloat() / MiddleW, 1.0);
//绘制最后一张
Rindro_Image_GlobalMap[Img].DrawPng(StartIndex + 2, X + Width - LastW, Y);
}
function DrawTriptychDetail(X, Y, Width, Img, Fi, Mi, La) {
//如果没有载入img就载入
if (!Rindro_Image_GlobalMap.rawin(Img)) {
Rindro_Image_GlobalMap[Img] <- Rindro_Image(Img);
}
Rindro_Image_GlobalMap[Img].DrawPng(Fi, X, Y);
//获取第一张图片的宽
local FirstW = Rindro_Image_GlobalMap[Img].GetPng(Fi).GetWidth();
//获取中间的图片宽
local MiddleW = Rindro_Image_GlobalMap[Img].GetPng(Mi).GetWidth();
//获得最后一张图片的宽
local LastW = Rindro_Image_GlobalMap[Img].GetPng(La).GetWidth();
//绘制中间
Rindro_Image_GlobalMap[Img].DrawExPng(Mi, X + FirstW, Y, 0, sq_RGBA(255, 255, 255, 250), (Width - LastW - FirstW).tofloat() / MiddleW, 1.0);
//绘制最后一张
Rindro_Image_GlobalMap[Img].DrawPng(La, X + Width - LastW, Y);
}
function DrawNineBox(X, Y, Width, Height, Img, StartIndex) {
//如果没有载入img就载入
if (!Rindro_Image_GlobalMap.rawin(Img)) {
@@ -240,6 +285,8 @@ class Rindro_BaseToolClass {
//绘制右下角
Rindro_Image_GlobalMap[Img].DrawPng(StartIndex + 8, X + Width - LeftTopW, Y + Height - LeftTopH);
}
}
//获取文字绘制长度
class LenheartTextClass {
@@ -395,4 +442,70 @@ class longlong {
return RetStr;
}
}
//任务队列
class QuestQueue {
//队列
Queue = null;
constructor() {
Queue = {};
}
//添加任务
function AddQuest(QuestName, QuestLogic, ...) {
local args = null;
if (vargc > 0) {
args = [];
for (local i = 0; i< vargc; i++) {
args.append(vargv[i]);
}
}
Queue[QuestName] <- {
Logic = QuestLogic,
InseartTime = Clock(),
arg = args
};
}
//移除任务
function RemoveQuest(QuestName) {
if (Queue) {
Queue.rawdelete(QuestName);
}
}
//执行任务
function Run() {
if (Queue) {
local NowTime = Clock();
foreach(QuestName, QuestInfo in Queue) {
if (QuestInfo.arg && QuestInfo.arg.len() > 0) {
local Arr = [];
Arr.append(getroottable());
Arr.append(QuestName);
Arr.append(NowTime);
foreach(value in QuestInfo.arg) {
Arr.append(value);
}
QuestInfo.Logic.acall(Arr);
// QuestInfo.Logic(QuestName, NowTime - QuestInfo.InseartTime, QuestInfo.arg);
} else QuestInfo.Logic(QuestName, NowTime - QuestInfo.InseartTime);
}
}
}
//示例
/*
Obj.AddQuest("测试任务",function (Name,Time)
{
print(Time);
if(Time >= 2000)Obj.RemoveQuest(Name);
}.bindenv(this));
*/
}