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

@@ -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));
*/
}