This commit is contained in:
Lenheart 2024-11-15 10:32:19 +08:00
parent c1df659af4
commit e1528c41bb
35 changed files with 6343 additions and 62 deletions

7
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"files.associations": {
"*.nut": "squirrel",
"*.cpp": "cpp",
"*.txt": "cpp"
}
}

View File

@ -10,19 +10,22 @@ function L_HUD_BloodBackground() {
if (!obj) return;
if (RootTab.rawin("HudUi_Obj")) {
RootTab.HudUi_Obj.BottomShow(obj);
}
}
if (RootTab.rawin("EventList_Obj")) {
foreach(win in EventList_Obj.Events) {
win.EventShow(obj);
}
}
}
getroottable().Camera_Pos <- 0;
getroottable().Camera_Pos <- {};
function L_Sync_Camera_Pos(Xpos) {
getroottable().Camera_Pos = Xpos;
// print(Xpos);
function L_Sync_Camera_Pos(Camera_Object) {
// print(Camera_Object);
// print(Camera_Object);
getroottable().Camera_Pos.X <- L_sq_RA(Camera_Object + 0x638);
getroottable().Camera_Pos.Y <- L_sq_RA(Camera_Object + 0x63C);
}

View File

@ -9,6 +9,16 @@ function L_drawMainCustomUI_All() {
local obj = sq_getMyCharacter();
if (!obj) return;
//获取与上一帧的dt
if (!(getroottable().rawin("Rindro_DurationFlag"))) {
Rindro_DurationFlag <- L_Getmicroseconds();
Rindro_Duration <- 0;
} else {
local NowM = L_Getmicroseconds();
Rindro_Duration = NowM - Rindro_DurationFlag;
Rindro_DurationFlag = NowM;
}
local RootTab = getroottable();
//下帧执行任务事件
if (RootTab.rawin("LenheartNextFrameFuncTab")) {
@ -121,6 +131,7 @@ function L_drawMainCustomUI_All() {
}
// if (Clock() - getroottable().Lsnzz >= 50) {
// getroottable().Lsnzz = Clock();
// local T = {
@ -165,7 +176,10 @@ function L_drawMainCustomUI_All() {
// }
// print(sq_GetCurrentModuleType());
// Rindro_BaseToolClass.T_DrawDynamicAni(obj, "common/luke/newtile/02_success_back_1.ani", 430, 210 + 26, "卢克阻截开始" + AHSJKDNJKA);
}
// AHSJKDNJKA <- Clock();
// getroottable().SINNU <- Clock();
// getroottable().Lsnzz <- Clock();

View File

@ -4,10 +4,11 @@
创建日期:2024-08-09 14:10
文件用途:获取伤害倍率
*/
RindroDamageRate <- 1.0;
function L_getCurrentModuleDamageRate(obj) {
if (!obj)
return 1.0;
local rate = 1.0;
local ClientRat = 1.0;
try {
@ -16,5 +17,22 @@ function L_getCurrentModuleDamageRate(obj) {
ClientRat = 1.0;
}
return (rate * ClientRat);
}
return (RindroDamageRate * ClientRat);
}
function Lenheart_GetDamageRate_Fun(obj) {
//在城镇时
if (sq_GetCurrentModuleType() == 1) {
RindroDamageRate = 1.0;
}
}
//修改伤害回调
function SetDamageRateCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
RindroDamageRate = Jso.rate;
}
Pack_Control.rawset(2024110902, SetDamageRateCallBack);
getroottable()["LenheartFuncTab"].rawset("GetDamageRateFuncN", Lenheart_GetDamageRate_Fun);

View File

@ -336,7 +336,7 @@ class Lenheart_Character_Info_ClassC extends LenheartNewUI_Windows {
GetMyInfoFlag = false;
}
if (!WindowX || !OldWindowAddress) return;
if (!WindowX) return;
if (!GetMyInfoFlag) {
GetMyInfoFlag = true;
@ -347,41 +347,39 @@ class Lenheart_Character_Info_ClassC extends LenheartNewUI_Windows {
SendPackEx(T);
}
X = L_sq_RA(OldWindowAddress + 0x14);
Y = L_sq_RA(OldWindowAddress + 0x18);
X = Base_X;
Y = Base_Y;
}
Base_X = 0;
Base_Y = 0;
OldWindowAddress = null;
function SyncState(Address) {
local WindowX = sq_GetPopupWindowMainCotrol(74);
local WindowAddress = L_sq_GetWindowById(74);
if (!WindowX || !WindowAddress) return false;
//确定是个人信息窗口才执行逻辑 并且返回true 不执行原逻辑
if (Address - WindowAddress <= 0x50000 && L_sq_RA(Address + 0x34) == 4089) {
OldWindowAddress = Address;
local obj = sq_getMyCharacter();
RealShow(obj);
Visible = true;
return true;
}
function SyncState(Args) {
Base_X = Args[0] + 800;
Base_Y = Args[1] - 174;
local obj = sq_getMyCharacter();
RealShow(obj);
Visible = true;
}
}
DrawCodeCallBackFunc.Rindro_Character_Info <- function(Args) {
if (getroottable().rawin("Lenheart_Character_Info_Class_Obj")) {
local MyWindow = getroottable().rawget("Lenheart_Character_Info_Class_Obj");
MyWindow.SyncState(Args);
}
}
//个人信息窗口逻辑
function L_Character_Info_Window(WindowObject) {
//返回Flase 原逻辑继续执行 返回Tue 原逻辑终止执行
local Flag = false;
if (getroottable().rawin("Lenheart_Character_Info_Class_Obj")) {
local MyWindow = getroottable().rawget("Lenheart_Character_Info_Class_Obj");
local Ret = MyWindow.SyncState(WindowObject);
if (Ret) Flag = true;
}
return Flag;
// //返回Flase 原逻辑继续执行 返回Tue 原逻辑终止执行
// local Flag = false;
// if (getroottable().rawin("Lenheart_Character_Info_Class_Obj")) {
// local MyWindow = getroottable().rawget("Lenheart_Character_Info_Class_Obj");
// local Ret = MyWindow.SyncState(WindowObject);
// if (Ret) Flag = true;
// }
// return Flag;
}
getroottable().rawdelete("Lenheart_Character_Info_Class_Obj");

View File

@ -122,13 +122,19 @@ class Lenheart_EachC extends LenheartNewUI_Windows {
function InitNpcButton() {
Childrens = [];
if (NPC_ButtonMap.rawin(NPC_Index)) {
NPC_ButtonMap[NPC_Index](this);
foreach(Func in NPC_ButtonMap[NPC_Index]) {
Func(this);
}
}
this.Visible = true;
}
function AddEachForNpc(Index, Func) {
NPC_ButtonMap.rawset(Index, Func);
if (NPC_ButtonMap.rawin(Index)) {
NPC_ButtonMap[Index].append(Func);
return;
}
NPC_ButtonMap.rawset(Index, [Func]);
}
function RemoveEachForNpc(Index) {

View File

@ -23,11 +23,26 @@ class R_Mouse {
function Lock() {
_Rindro_Cusor_.UseState = 1;
L_sq_WAB(0x1B46886, 1);
//技能描述窗口
Sq_Memory_WriteByteArr(L_sq_I2P(0x4CC47E), [0xE9, 0xA0, 0x00, 0x00, 0x00, 0x90]);
//物品描述窗口
Sq_Memory_WriteByteArr(L_sq_I2P(0xF63DDA), [0x90, 0x90, 0x90, 0x90, 0x90, 0x90]);
//buff信息描述窗口
Sq_Memory_WriteByteArr(L_sq_I2P(0x4BF532), [0x90, 0x90, 0x90, 0x90]);
//原生商城 个人信息等按钮的悬停
L_sq_WAB(0x4C4690, 0xC3);
//活动图标的悬停
L_sq_WAB(0x11C6510, 0xC3);
}
//解锁鼠标
function UnLock() {
_Rindro_Cusor_.UseState = 0;
L_sq_WAB(0x1B46886, 0);
Sq_Memory_WriteByteArr(L_sq_I2P(0x4CC47E), [0x39, 0x05, 0xE0, 0xF6, 0xA3, 0x01]);
Sq_Memory_WriteByteArr(L_sq_I2P(0xF63DDA), [0x56, 0xE8, 0x10, 0xFE, 0xFF, 0xFF]);
Sq_Memory_WriteByteArr(L_sq_I2P(0x4BF532), [0x75, 0x07, 0x32, 0xC0]);
L_sq_WAB(0x4C4690, 0x55);
L_sq_WAB(0x11C6510, 0x55);
}
//获取鼠标工作类型
function GetType() {

View File

@ -0,0 +1,416 @@
/*
文件名:Animation_Class.nut
路径:Base/_Tool/Animation_Class.nut
创建日期:2024-10-21 16:57
文件用途:动画类
*/
class Rindro_Animation {
//Ani是否可用
IsUsability = true;
//当前帧数
CurrentFrameIndex = 0;
//当前帧时间
CurrentIndexT = 0;
//当前帧
CurrentFrame = null;
//Ani的标签
AnimationFlag = null;
//图片对象数组
PngList = null;
//帧对象数组
FrameList = null;
//附加选项
AdditionalOptions = null;
//角度
Angle = 0;
constructor(Data, ...) {
PngList = [];
FrameList = [];
//附加选项
if (vargc > 0) AdditionalOptions = vargv[0];
//初始化数据
InitData(Data);
}
function InitData(Data) {
local Buf;
if (type(Data) == "table") {
Buf = Data;
}
//从PVF数据加载
else if (type(Data) == "string") {
local ReadObject = R_Utils.GetScriptFileReader(Data);
if (ReadObject) {
Buf = Rindro_Script.ReadAnimation(ReadObject);
}
}
if (Buf) {
AnimationFlag = Buf.Flag;
FrameList = Buf.Frame;
foreach(FrameObj in FrameList) {
//如果有附加处理 格式化
if (AdditionalOptions && AdditionalOptions.rawin("ImgFormat")) FrameObj.Img_Path = AdditionalOptions["ImgFormat"](FrameObj.Img_Path);
local Png = Rindro_Image.Load(FrameObj.Img_Path).GetPng(FrameObj.Img_Index);
Png.Draw(-500, -500);
//如果有附加处理 坐标
if (AdditionalOptions && AdditionalOptions.rawin("Pos")) {
FrameObj.Pos.x += AdditionalOptions["Pos"].x;
FrameObj.Pos.y += AdditionalOptions["Pos"].y;
}
// Spritebuf.SetPosition(FrameObj.Pos);
PngList.append(Png);
}
} else {
error("创建Ani失败,找不到Ani数据");
}
}
//重置Ani
function Reset() {
IsUsability = true;
FlushFrame(0);
}
//获取当前帧信息
function GetCurrentFrameInfo() {
return FrameList[CurrentFrameIndex];
}
function FlushFrame(Index) {
//同步当前帧
CurrentFrameIndex = Index;
//当前帧更换为本帧
CurrentFrame = PngList[CurrentFrameIndex];
local FlagBuf = FrameList[CurrentFrameIndex].Flag;
//关键帧
if ("SET_FLAG" in FlagBuf) {
// if (StateMachine && StateMachine.State != -1) StateMachine.ChangeAniKeyFlag(FlagBuf.SET_FLAG);
}
//播放音效
if ("PLAY_SOUND" in FlagBuf) {
R_Utils.PlaySound(FlagBuf.PLAY_SOUND);
}
}
//绘制
function DrawFrame(X, Y) {
// local NowDrawPng = CurrentFrame;
local FrameObj = FrameList[CurrentFrameIndex];
//线性减淡
if ("GRAPHIC_EFFECT_LINEARDODGE" in FrameObj.Flag) {
L_sq_SetDrawImgModel(2, 0);
}
//坐标偏移
local XOffset = FrameObj.Pos.x;
local YOffset = FrameObj.Pos.y;
//染色
local RGBA = sq_RGBA(255, 255, 255, 255);
if ("RGBA" in FrameObj.Flag) {
local Fbuf = FrameObj.Flag.RGBA;
RGBA = sq_RGBA(Fbuf[0].tointeger(), Fbuf[1].tointeger(), Fbuf[2].tointeger(), Fbuf[3].tointeger());
}
//缩放
local XRate = 1.0;
local YRate = 1.0;
if ("IMAGE_RATE" in FrameObj.Flag) {
local Fbuf = FrameObj.Flag.IMAGE_RATE;
XRate = Fbuf.x;
YRate = Fbuf.y;
}
if (CurrentFrame) CurrentFrame.DrawEx(X + XOffset, Y + YOffset, Angle, RGBA, XRate, YRate);
L_sq_ReleaseDrawImgModel();
}
function Draw(X, Y) {
//可用性检查
if (IsUsability) {
DrawFrame(X, Y);
//累加当前帧时间
CurrentIndexT += Rindro_Duration;
//当前帧时间 超过 当前帧延迟就需要切换帧了
if ("Delay" in FrameList[CurrentFrameIndex] && CurrentIndexT >= FrameList[CurrentFrameIndex].Delay) {
CurrentIndexT = 0;
//如果当前帧小于总帧数就切换
if (CurrentFrameIndex<(FrameList.len() - 1)) {
FlushFrame(CurrentFrameIndex + 1);
}
//说明播放完毕了
else {
//如果有循环
if ("LOOP" in AnimationFlag) {
FlushFrame(0);
}
//没有循环触发状态机回调
else {
//将不再可用
IsUsability = false;
}
}
}
}
}
}
//绘制角色类
class Rindro_Draw_Character {
//名字
Name = null;
//职业
Job = null;
//绘制体信息
DrawInfo = null;
ENUM_RINDRO_JOB_NAME = ["swordman", "fighter", "gunner", "mage", "priest", "atgunner", "thief", "atfighter", "atmage", "demonicswordman", "creatormage"];
ENUM_RINDRO_JOB_TITLE_HEIGHT = [
//男鬼剑士
{
x = -42,
y = -154
},
//女格斗
{
x = -42,
y = -140
},
//男神枪手
{
x = -44,
y = -168
},
//女魔法师
{
x = -46,
y = -126
},
//男圣职者
{
x = -46,
y = -166
},
//女神枪手
{
x = -42,
y = -156
},
//女暗夜使者
{
x = -44,
y = -154
},
//男格斗家
{
x = -45,
y = -160
},
//男魔法师
{
x = -45,
y = -140
},
//黑暗武士
{
x = -42,
y = -154
},
//缔造者
{
x = -46,
y = -126
},
];
//获取角色AniBy装备
function GetCharacAniByEqu(Job, Equ, AniName) {
local AniList = [];
foreach(value in Equ) {
if (value > 0) {
local ListBuf = CreateEquipmentAni(value, Job, AniName);
AniList.extend(ListBuf);
}
}
local n = AniList.len();
for (local i = 0; i< n - 1; i++) {
for (local j = i + 1; j< n; j++) {
if (AniList[i].Layer > AniList[j].Layer) {
// 交换两个元素
local temp = AniList[i];
AniList[i] = AniList[j];
AniList[j] = temp;
}
}
}
return AniList;
}
function CreateEquipmentAni(Index, Job, AniName) {
local AniList = [];
//获取装备或时装的文件路径
local FilePath = R_Utils.GetEquPath(Index);
if (FilePath) {
local ReadObject = R_Utils.GetScriptFileReader("equipment/" + FilePath);
if (ReadObject) {
local Equ = Rindro_Script.ReadEquipment(ReadObject);
//职业名字
local JobName = ENUM_RINDRO_JOB_NAME[Job];
//没有装备类型
if (!(Equ.rawin("equipment_type"))) Equ.equipment_type <- "normal";
//光环单独处理 其他的在下面处理
if (Equ.equipment_type == "aurora avatar") {
foreach(Path in Equ.Aurora.Back) {
local AniBuf = Rindro_Animation(Path);
AniList.append({
Ani = AniBuf,
Layer = -10000,
});
}
foreach(Path in Equ.Aurora.Front) {
local AniBuf = Rindro_Animation(Path);
AniList.append({
Ani = AniBuf,
Layer = 10000,
});
}
}
//称号
else if (Equ.equipment_type == "title name") {
local PathBuf = "equipment/" + FilePath;
PathBuf = PathBuf.slice(0, R_Utils.String.FindLastSubstring(PathBuf, "/"));
local Path = PathBuf + "/" + Equ.custom_animation;
local Ao = {
Pos = ENUM_RINDRO_JOB_TITLE_HEIGHT[Job]
}
local AniBuf = Rindro_Animation(Path, Ao);
AniList.append({
Ani = AniBuf,
Layer = 10001,
});
}
//没有Ani 就那种透明时装
if (!(Equ.rawin("Ani_" + JobName))) return AniList;
//读取Ani配置
local AniScript = Equ["Ani_" + JobName];
if (Equ.equipment_type == "skin avatar") {
local Path;
if (JobName.find("at") >= 0) {
Path = format("character/%s/atanimation/%s", JobName.slice(2), AniName);
} else Path = format("character/%s/animation/%s", JobName, AniName);
local Ao = {
ImgVariation = AniScript.variation,
ImgFormat = function(ImgPath) {
if (ImgVariation[0] > 0) {
local Pos = ImgPath.find("%04d");
ImgPath = ImgPath.slice(0, Pos) + "%02d%02d" + ImgPath.slice(Pos + 4);
return format(ImgPath, ImgVariation[0], ImgVariation[1]);
} else {
return format(ImgPath, ImgVariation[1]);
}
}
}
local AniBuf = Rindro_Animation(Path, Ao);
AniList.append({
Ani = AniBuf,
Layer = 0,
});
} else {
foreach(Info in AniScript.layer_variation) {
local PathBuf = "equipment/" + FilePath;
PathBuf = PathBuf.slice(0, R_Utils.String.FindLastSubstring(PathBuf, "/"));
local Path = PathBuf + "/" + Info.Path + "/" + AniName;
local Ao = {
ImgVariation = AniScript.variation,
ImgFormat = function(ImgPath) {
return format(ImgPath, ImgVariation[0], ImgVariation[1]);
}
}
local AniBuf = Rindro_Animation(Path, Ao);
AniList.append({
Ani = AniBuf,
Layer = Info.Zorder,
});
}
}
}
}
return AniList;
}
constructor(Job, EquipmentArr, Action, Name) {
DrawInfo = GetCharacAniByEqu(Job, EquipmentArr, Action);
this.Job = Job;
this.Name = Name;
}
function Draw(X, Y) {
foreach(AniInfo in DrawInfo) {
AniInfo.Ani.Draw(X, Y);
}
if (Name) {
L_sq_DrawCode(Name, 44 + X + ENUM_RINDRO_JOB_TITLE_HEIGHT[Job].x - (LenheartTextClass.GetStringLength(Name) / 2), Y + ENUM_RINDRO_JOB_TITLE_HEIGHT[Job].y + 24, sq_RGBA(255, 255, 255, 250), 1, 1);
}
}
}
//鬼剑士
//601580026 101550559
// Sassq <- {};
// Sassq[0] <- Rindro_Draw_Character(0, [
// 601550071,
// 601560067,
// 601570062,
// 601500069,
// 601510068,
// 601540069,
// 601520061,
// 601530060,
// 601580026,
// 0,
// 27610,
// 26058
// ], "rest.ani", "鬼剑士-Kina")
// //格斗家
// Sassq[1] <- Rindro_Draw_Character(1, [26373, 102550540, 102560700, 102570504, 102520514, 102500742, 102510739, 102540664, 102580139, 102530474], "rest.ani", "Kina")
// //神枪手
// Sassq[2] <- Rindro_Draw_Character(2, [26373, 104550553, 104560725, 104570492, 104520541, 104500750, 104510913, 104540671, 104580148, 104530494], "rest.ani", "Kina")
// //魔法师
// Sassq[3] <- Rindro_Draw_Character(3, [26373, 106550521, 106560580, 106570446, 106520529, 106500603, 106510607, 106540583, 106580143, 106530461], "rest.ani", "Kina")
// //圣职者
// Sassq[4] <- Rindro_Draw_Character(4, [26373, 108550600, 108560591, 108570687, 108520580, 108500587, 108510590, 108540562, 108580138, 108530560], "rest.ani", "Kina")
// //女枪
// Sassq[5] <- Rindro_Draw_Character(5, [26373, 105550431, 105560424, 105570386, 105520415, 105500424, 105510429, 105540408, 105580144, 105530361], "rest.ani", "Kina")
// //暗夜
// Sassq[6] <- Rindro_Draw_Character(6, [26373, 109550385, 109560393, 109570369, 109520406, 109500402, 109510414, 109540389, 109580134, 109530355], "rest.ani", "Kina")
// //男格斗
// Sassq[7] <- Rindro_Draw_Character(7, [26373, 103550302, 103560311, 103570274, 103520297, 103500297, 103510301, 103540284, 103580128, 103530246], "rest.ani", "Kina")
// //男法
// Sassq[8] <- Rindro_Draw_Character(8, [26373, 107550220, 107560223, 107570188, 107520224, 107500233, 107510231, 107540209, 107580129, 107530192], "rest.ani", "Kina")

View File

@ -4,9 +4,17 @@
创建日期:2024-08-06 23:49
文件用途:基础工具类
*/
function printT(T) {
Sq_OutPutTable(Json.Encode(T));
}
//Json类
class Json {
function Encode(Table) {
local JsonObj = JSONEncoder();
return JsonObj.encode(Table);
local Size = Table.len();
local Pos = 0;
local Str = "{";

View File

@ -7,6 +7,26 @@
//工具类
class R_Utils {
String = {
FindLastSubstring = function(str, substring) {
local strLen = str.len();
local subLen = substring.len();
local lastIndex = -1;
for (local i = 0; i <= strLen - subLen; i++) {
local found = true;
for (local j = 0; j< subLen; j++) {
if (str[i + j] != substring[j]) {
found = false;
break;
}
}
if (found) {
lastIndex = i;
}
}
return lastIndex;
}
}
//播放音效
function PlaySound(SoundName) {
L_Sq_CallFunc(0x75BD70, "void", FFI_MS_CDECL, ["pointer", "int", "int", "int"], Memory.allocUtf8String(SoundName).C_Object, -1, 0, 0);
@ -28,6 +48,28 @@ class R_Utils {
return Reader.readBig5String();
}
//读取文件
function GetScriptFileReader(Path, ...) {
local AllocSize = 102400;
if (vargc > 0) AllocSize = vargv[0];
//读取路径
local ReadPath = L_sq_P2I(Memory.allocUtf8String(Path).C_Object);
//读取缓存
local Reader = Memory.alloc(AllocSize);
local ReadBuffer = L_sq_P2I(Reader.C_Object);
//实际读取大小
local ReadSizeer = Memory.alloc(4);
local ReadSizeBuffer = L_sq_P2I(ReadSizeer.C_Object);
local Flag = L_Sq_CallFunc(0x59E3D0, "bool", FFI_MS_CDECL, ["int", "int", "int", "int"], ReadPath, ReadBuffer, AllocSize, ReadSizeBuffer);
if (Flag) {
return {
Buffer = Reader,
Size = ReadSizeer.readInt()
};
} else return null;
}
//读取配置表
function ReadScriptConfig(Path, Size, ...) {
local CodePage = "utf8";
@ -38,14 +80,121 @@ class R_Utils {
return Ret;
}
//获取一个指定装备的角色Ani
//获取一个指定装备的角色对象
function GetCharacByEqu(Job, GrowType, Equ) {
local Obj = sq_CreateCharacter(Job, GrowType);
local ObjAddress = L_Sq_GetObjectAddress(Obj);
foreach(value in Equ) {
local ItemObject = L_sq_GetItem(value);
L_Sq_CallFunc(0x825570, "void", FFI_THISCALL, ["int", "int"], ObjAddress, ItemObject);
// L_Sq_CallFunc(0x825570, "void", FFI_THISCALL, ["int", "int"], ObjAddress, ItemObject);
L_Sq_CallFunc(0x8265A0, "void", FFI_THISCALL, ["int", "int", "int"], ObjAddress, ItemObject, -1);
}
return Obj;
return sq_GetCNRDObjectToSQRCharacter(Obj);
}
}
//获取装备编号的得文件路径
function GetEquPath(Equ) {
local EquPathAddress = L_Sq_CallFunc(0x1219E80, "int", FFI_THISCALL, ["int", "int"], 0x1d7993c, Equ);
if (EquPathAddress) {
return NativePointer(EquPathAddress).readUnicodeString();
}
return null;
}
}
//根据List读取文件地址
// Rindro_Haker.LoadHook(0x1219E80, ["int", "int", "int"],
// function(args) {
// // print(format("%02x", args[0]));
// // print(args[2]);
// return null;
// },
// function(args) {
// // print(666);
// // print(format("%02x", args.pop()));
// // TTTAni <- args.pop();
// // local Path = NativePointer(L_sq_I2P(args.pop())).readUnicodeString();
// // if (Path != "character/swordman/weapon/katana/kat_lowkogaras.equ" && Path != "new_elvengard.twn") {
// // print(args[0]);
// // print(args[1]);
// // // print(format("%02x", args[1]));
// // print(Path);
// // }
// return null;
// });
//可能是构造装备以及构造其他东西
// Rindro_Haker.LoadHook(0x972220, ["int", "int", "int", "int"],
// function(args) {
// // print(format("%02x", args[0]));
// // local AniPath = NativePointer(L_sq_I2P(args[0])).readUnicodeString();
// if (args[0] == 10402) {
// print(args[0]);
// print(args[1]);
// print(args[2]);
// }
// // print(args[2]);
// return null;
// },
// function(args) {
// // print(666);
// // print(format("%02x", args.pop()));
// // TTTAni <- args.pop();
// return null;
// });
//绘制字符
getroottable().DrawCodeCallBackFunc <- {};
// Rindro_Haker.LoadHook(0x1206BD0, ["int", "int", "int", "pointer", "int", "void"],
// function(args) {
// // print("nut:" + format("%02x", args[3]));
// if (args[3]) {
// local DrawCode = NativePointer((args[3])).readUnicodeString();
// // print(DrawCode);
// if (DrawCode in DrawCodeCallBackFunc)
// DrawCodeCallBackFunc[DrawCode](args);
// // print(args[3]);
// }
// return null;
// },
// function(args) {
// // print(666);
// // print(format("%02x", args.pop()));
// // TTTAni <- args.pop();
// return null;
// });
//绘制城镇回调
getroottable().DrawTownCallBackFunc <- {};
Rindro_Haker.LoadHook(0x1108700, ["int", "void"],
function(args) {
// print("nut:" + format("%02x", args[3]));
// print(format("%02x", args[0]));
foreach(Func in DrawTownCallBackFunc) {
Func();
}
return null;
},
function(args) {
// print(666);
// print(format("%02x", args.pop()));
// TTTAni <- args.pop();
return null;
});
//顺图
function Rindro_Gm_MoveMap()
{
}
getroottable()["LenheartFuncTab"].rawset("Rindro_Gm_MoveMapFuncN", Rindro_Gm_MoveMap);

View File

@ -0,0 +1,62 @@
/*
文件名:Image_Class.nut
路径:Base/_Tool/Image_Class.nut
创建日期:2024-10-21 16:58
文件用途: 图片类
*/
class Rindro_Png {
C_Object = null;
constructor(Object) {
this.C_Object = Object;
}
function Draw(X, Y) {
L_Sq_CallFunc(0x11A8F60, "int", FFI_THISCALL, ["int", "int", "int", "int"], NativePointer(0x1B45B94).readInt(), X, Y, this.C_Object);
}
function DrawEx(X, Y, Model, Rgba, Xrate, Yrate) {
L_Sq_CallFunc(0x11A97E0, "int", FFI_THISCALL, ["int", "int", "int", "int", "float", "float", "float", "int", "float", "float"], NativePointer(0x1B45B94).readInt(), X, Y, this.C_Object, Xrate, Yrate, Model, Rgba, 0, 0);
}
}
class Rindro_Image {
Img = null;
constructor(Path) {
//读取Img
Img = L_Sq_CallFunc(0x11C0410, "int", FFI_THISCALL, ["int", "int", "int"], NativePointer(0x1B4684C).readInt(), 0, L_sq_P2I(Memory.allocUtf8String(Path).C_Object));
}
function GetPng(Idx) {
if (Img) {
return Rindro_Png(L_Sq_CallFunc(0x11AA190, "int", FFI_THISCALL, ["int", "int"], Img, Idx));
}
}
function DrawPng(Idx, X, Y) {
local Buffer = GetPng(Idx);
Buffer.Draw(X, Y);
}
function DrawExPng(Idx, X, Y, Model, Rgba, Xrate, Yrate) {
local Buffer = GetPng(Idx);
Buffer.DrawEx(X, Y, Model, Rgba, Xrate, Yrate)
}
//加载
function Load(Path) {
if (!(getroottable().rawin("Rindro_Image_Map"))) getroottable().Rindro_Image_Map <- {};
if (getroottable().Rindro_Image_Map.rawin(Path)) return getroottable().Rindro_Image_Map[Path];
else {
getroottable().Rindro_Image_Map[Path] <- Rindro_Image(Path);
return getroottable().Rindro_Image_Map[Path];
}
}
}
/*
local Png = TestImg.GetPng(0);
Png.Draw(200, 200);
Png.DrawEx(100, 400, 0, sq_RGBA(255, 255, 255, 255), 1.5, 1.5);
*/

View File

@ -8,7 +8,7 @@
class Memory {
function alloc(Size) {
return NativePointer(Size);
return NativePointer(Size.tostring());
}
function allocUtf8String(Str) {
@ -22,11 +22,13 @@ class NativePointer {
constructor(T) {
if (type(T) == "integer") {
C_Object = Sq_New_Point(T);
//注册销毁伪析构
Register_Destruction(C_Object, this);
C_Object = L_sq_I2P(T);
} else if (type(T) == "userdata") {
C_Object = T;
} else if (type(T) == "string") {
C_Object = Sq_New_Point(T.tointeger());
//注册销毁伪析构
Register_Destruction(C_Object, this);
}
}
@ -115,9 +117,6 @@ class NativePointer {
function read(type) {
local Buf = Sq_Point2Blob(L_sq_P2I(this.C_Object), 4);
foreach(value in Buf) {
print(value);
}
return Buf.readn(type);
}

599
Base/_Tool/Script_Class.nut Normal file
View File

@ -0,0 +1,599 @@
/*
文件名:Script_Class.nut
路径:Base/_Tool/Script_Class.nut
创建日期:2024-10-21 14:49
文件用途:PVF读取类
*/
class BlobEx extends blob {
constructor(BaseBlob) {
blob.constructor(BaseBlob.len());
writeblob(BaseBlob);
}
function writeblob(B) {
blob.writeblob(B);
seek(0);
}
function GetUShort() {
return readn('s');
}
function GetShort() {
return readn('w');
}
function GetInt() {
local CurTPos = tell();
local Ret = charPtrToInt([this[CurTPos], this[CurTPos + 1], this[CurTPos + 2], this[CurTPos + 3]]);
seek(4, 'c');
return Ret;
}
function Get256() {
local Buf = readn('c');
return (256.0 + Buf.tofloat()) % 256.0;
}
function GetFloat() {
return readn('f');
}
function GetString(count) {
local MBuf = Memory.alloc(count);
local BlobBuf = readblob(count);
local arr = [];
foreach(value in BlobBuf) {
arr.append(value);
}
MBuf.writeByteArray(arr);
return MBuf.readUtf8String(count);
}
}
Rindro_Script_Bin_Data <- [];
class Rindro_Script {
function Get_Ani_Flip_Type(data) {
switch (data) {
case 1:
return "HORIZON";
case 2:
return "VERTICAL";
case 3:
return "ALL";
default:
return "";
}
}
function Get_Ani_Effect_Type(data) {
switch (data) {
case 0:
return "NONE";
case 1:
return "DODGE";
case 2:
return "LINEARDODGE";
case 3:
return "DARK";
case 4:
return "XOR";
case 5:
return "MONOCHROME";
case 6:
return "SPACEDISTORT";
default:
return "";
}
}
function Get_Ani_Damage_Type(data) {
switch (data) {
case 0:
return "NORMAL";
case 1:
return "SUPERARMOR";
case 2:
return "UNBREAKABLE";
default:
return "";
}
}
function Get_Ani_Flag(data) {
switch (data) {
case 0:
return "LOOP";
case 1:
return "SHADOW";
case 3:
return "COORD";
case 7:
return "IMAGE_RATE";
case 8:
return "IMAGE_ROTATE";
case 9:
return "RGBA";
case 10:
return "INTERPOLATION";
case 11:
return "GRAPHIC_EFFECT";
case 12:
return "DELAY";
case 13:
return "DAMAGE_TYPE";
case 14:
return "DAMAGE_BOX";
case 15:
return "ATTACK_BOX";
case 16:
return "PLAY_SOUND";
case 17:
return "PRELOAD";
case 18:
return "SPECTRUM";
case 23:
return "SET_FLAG";
case 24:
return "FLIP_TYPE";
case 25:
return "LOOP_START";
case 26:
return "LOOP_END";
case 27:
return "CLIP";
case 28:
return "OPERATION";
default:
return "";
}
}
function endswith(Str, cmp) {
local len = cmp.len();
local EndStr = Str.slice(-len);
if (EndStr == cmp)
return true;
return false;
}
function InitLoad_String() {
if (getroottable().rawin("RindroLoadStringTable")) return;
getroottable().RindroLoadStringTable <- {};
local N_String = R_Utils.GetScriptFileReader("n_string.lst");
if (N_String) {
local IO = Sq_Point2Blob(L_sq_P2I(N_String.Buffer.C_Object), N_String.Size);
local i = 2;
while (i< N_String.Size) {
if ((N_String.Size - i) >= 10) {
IO.seek(i + 6); //内容指示位
local FindKey = IO.readn('i');
local Key = Rindro_Script.GetBinString(FindKey);
if (Key) {
local StrFilePath = Key.tolower();
local StrFile = R_Utils.GetScriptFileReader(StrFilePath, 10240000);
if (StrFile) {
local StrBuffer = StrFile.Buffer.readUtf8String(StrFile.Size);
local StrArr = split(StrBuffer, "\r\n");
foreach(index, strobj in StrArr) {
if (strobj.find(">") != null) {
local strobjarr = split(strobj, ">");
if (strobjarr.len() > 1) {
getroottable().RindroLoadStringTable.rawset(strobjarr[0], Sq_ConvertWideChar(strobjarr[1], "big5"));
}
}
}
}
}
} else break;
i += 10;
}
}
}
function GetBin() {
local BinFile = R_Utils.GetScriptFileReader("stringtable.bin", 40960000);
if (BinFile) {
local Ro = Sq_Point2Blob(L_sq_P2I(BinFile.Buffer.C_Object), BinFile.Size);
Ro = BlobEx(Ro.readblob(Ro.len()));
local Count = Ro.readn('i');
local CurrentIndex = 0;
for (local i = 0; i< Count; i++) {
Ro.seek(CurrentIndex * 4 + 4);
local StartPos = Ro.readn('i');
local EndPos = Ro.readn('i');
local Len = EndPos - StartPos;
Ro.seek(StartPos + 4);
if (Len > 0) {
local Str = Ro.GetString(Len);
Rindro_Script_Bin_Data.append(Str);
}
CurrentIndex++;
}
}
}
function GetBinString(Index) {
if (Index< Rindro_Script_Bin_Data.len()) return Rindro_Script_Bin_Data[Index];
return "";
}
function GetLoadString(Key) {
if (getroottable().RindroLoadStringTable.rawin(Key)) return getroottable().RindroLoadStringTable[Key];
else return "";
}
function UnpackData(IO, i) {
local out = "";
IO.seek(i); //内容指示位
local currentByte = IO.readn('c'); //内容指示位
local after = IO.readn('i');
switch (currentByte) {
case 10: {
IO.seek(i - 4);
local Before = IO.readn('i');
local Buf = Rindro_Script.GetBinString(after);
if (!Buf) {
Buf = "";
} else {
Buf = "<" + Before + "::" + Buf + "`" + Rindro_Script.GetLoadString(Buf) + "`>";
}
Buf = Buf + "\r\n";
out += Buf;
break;
}
case 2: {
out += after + '\t';
break;
}
case 4: {
local Bbuf = blob(4);
Bbuf.writen(after, 'i');
Bbuf.seek(0);
local Buf = Bbuf.readn('f');
out += after + '\t';
break;
}
case 6:
case 8:
case 7:
case 5: {
local Buf = Rindro_Script.GetBinString(after);
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 out;
}
function ReadEquipment(ReadObject) {
local EquipmentAtt = {};
if (ReadObject.Size >= 7) {
//创建Blob对象
local IO = Sq_Point2Blob(L_sq_P2I(ReadObject.Buffer.C_Object), ReadObject.Size);
//以5为单步从第二位开始遍历字节
local i = 2;
while (true) {
if (i< ReadObject.Size && ReadObject.Size - i >= 5) {
local str = Rindro_Script.UnpackData(IO, i);
i += 5;
//名称
if (str == "[name]") {
local RealKey = str.slice(1, str.len() - 1);
EquipmentAtt[RealKey] <- Rindro_Script.UnpackData(IO, i);
i += 5;
}
//装备类型
else if (str == "[equipment type]") {
local Buf = Rindro_Script.UnpackData(IO, i);
EquipmentAtt["equipment_type"] <- Buf.slice(1, -1);
i += 5;
}
//称号动画
else if (str == "[custom animation]") {
local Buf = Rindro_Script.UnpackData(IO, i).tolower();
EquipmentAtt["custom_animation"] <- Buf;
i += 5;
}
//光环生成效果
else if (str == "[aurora graphic effects]") {
EquipmentAtt["Aurora"] <- {};
EquipmentAtt["Aurora"].Back <- [];
EquipmentAtt["Aurora"].Front <- [];
local Count = Rindro_Script.UnpackData(IO, i).tointeger() - 9;
i += 5;
for (local z = 0; z< Count; z++) {
local Layer = Rindro_Script.UnpackData(IO, i).tointeger() - 9;
i += 5;
local Path = Rindro_Script.UnpackData(IO, i).tolower();
i += 5;
if (Layer == 0) EquipmentAtt["Aurora"].Back.append(Path);
if (Layer == 1) EquipmentAtt["Aurora"].Front.append(Path);
}
i += 5;
}
//Ani
else if (str == "[animation job]") {
local Job = Rindro_Script.UnpackData(IO, i).slice(1, -1);
local SpacePos = Job.find(" ");
if (SpacePos) {
Job = Job.slice(0, SpacePos) + Job.slice(SpacePos + 1);
}
i += 5;
EquipmentAtt["Ani_" + Job] <- {};
i += 5;
local Index1 = Rindro_Script.UnpackData(IO, i).tointeger() - 9;
i += 5;
local Index2 = Rindro_Script.UnpackData(IO, i).tointeger() - 9;
i += 5;
EquipmentAtt["Ani_" + Job].variation <- [Index1, Index2];
EquipmentAtt["Ani_" + Job].layer_variation <- [];
while (true) {
try {
local Ret = Rindro_Script.UnpackData(IO, i);
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).tointeger() - 9;
i += 5;
InfoBuf.Path <- Rindro_Script.UnpackData(IO, i);
i += 5;
EquipmentAtt["Ani_" + Job].layer_variation.append(InfoBuf);
}
} catch (exception) {
break;
}
}
}
} else break;
}
}
return EquipmentAtt;
}
function ReadAnimation(ReadObject) {
local Ro = Sq_Point2Blob(L_sq_P2I(ReadObject.Buffer.C_Object), ReadObject.Size);
Ro = BlobEx(Ro.readblob(Ro.len()));
local AniObject = {
Img_List = [],
Frame = [],
Flag = {}
};
local Frame_Max = Ro.readn('s');
local Img_Count = Ro.readn('s');
//Img的路径读取 存入数组
for (local index = 0; index< Img_Count; index++) {
local Buf = Ro.readn('i');
local ImgPath = Ro.GetString(Buf);
//有可能Img有空路径
AniObject.Img_List.append(ImgPath);
}
//Ani头部标签数量
local Ani_H_Item_Count = Ro.readn('s');
//处理标签
for (local index = 0; index< Ani_H_Item_Count; index++) {
//标签类型
local Type = Ro.readn('s');
switch (Type) {
case 0:
case 1: {
local Key = Rindro_Script.Get_Ani_Flag(Type);
local Value = Ro.readn('c');
AniObject.Flag.rawset(Key, Value);
break;
}
case 3:
case 28: {
local Key = Rindro_Script.Get_Ani_Flag(Type);
local Value = Ro.readn('s');
AniObject.Flag.rawset(Key, Value);
break;
}
case 18:
// print("残影解析");
//此处无解析 暂时先保证运行 残影功能暂时用不上
Ro.readn('c');
Ro.readn('i');
Ro.readn('i');
Ro.readn('i');
Ro.Get256();
Ro.Get256();
Ro.Get256();
Ro.Get256();
Ro.readn('s');
break;
default:
break;
}
}
//读取每一个Img
for (local index = 0; index< Frame_Max; index++) {
//帧结构体对象
local FrameObject = {
AttackBox = [],
DamageBox = [],
Flag = {},
};
//碰撞框项目数量
local Ani_Box_Item_Count = Ro.readn('s');
for (local _i = 0; _i< Ani_Box_Item_Count; _i++) {
local Box_Type = Ro.readn('s');
local D_Box_b = [];
for (local _k = 0; _k< 6; _k++) {
D_Box_b.append(Ro.readn('i'));
}
if (Box_Type == 15) {
FrameObject.AttackBox.append(D_Box_b);
} else {
FrameObject.DamageBox.append(D_Box_b);
}
// //0是攻击框 1是受击框
// FrameObject.Box.rawset(15 - Box_Type, D_Box_b);
}
//调用的第几个Img
local Index_Buf = Ro.GetShort();
//如果等于-1说明是img路径为空
if (Index_Buf != 65535) {
FrameObject.Img_Path <- AniObject.Img_List[Index_Buf].tolower();
//Img中的PNG下标
FrameObject.Img_Index <- Ro.readn('s');
} else {
FrameObject.Img_Path <- "";
FrameObject.Img_Index <- 0;
}
//坐标
FrameObject.Pos <- {
x = Ro.readn('i'),
y = Ro.readn('i'),
};
//Img中的项目数量
local Img_Flag_Count = Ro.readn('s');
for (local _o = 0; _o< Img_Flag_Count; _o++) {
local Img_Flag_Type = Ro.readn('s');
local Key;
local Value;
switch (Img_Flag_Type) {
case 0:
case 1:
case 10:
Key = Rindro_Script.Get_Ani_Flag(Img_Flag_Type);
Value = Ro.readn('c');
FrameObject.Flag.rawset(Key, Value);
break;
case 3:
Key = "COORD";
Value = Ro.readn('s');
FrameObject.Flag.rawset(Key, Value);
break;
case 17:
Key = "PRELOAD";
Value = 1;
FrameObject.Flag.rawset(Key, Value);
break;
case 7:
Key = "IMAGE_RATE";
Value = {
x = Ro.GetFloat(),
y = Ro.GetFloat()
};
FrameObject.Flag.rawset(Key, Value);
break;
case 8:
Key = "IMAGE_ROTATE";
Value = Ro.GetFloat();
FrameObject.Flag.rawset(Key, Value);
break;
case 9:
Key = "RGBA";
Value = [
Ro.Get256(),
Ro.Get256(),
Ro.Get256(),
Ro.Get256(),
];
FrameObject.Flag.rawset(Key, Value);
break;
case 11:
local Effect_Type = Ro.readn('s');
Key = "GRAPHIC_EFFECT_" + Rindro_Script.Get_Ani_Effect_Type(Effect_Type);
switch (Effect_Type) {
case 5:
Value = [Ro.Get256(), Ro.Get256(), Ro.Get256()];
break;
case 6:
Value = [Ro.GetShort(), Ro.GetShort()];
break;
}
FrameObject.Flag.rawset(Key, Value);
break;
case 12:
Value = Ro.readn('i');
FrameObject.Delay <- Value;
break;
case 13:
Key = "DAMAGE_TYPE";
Value = Rindro_Script.Get_Ani_Damage_Type(Ro.readn('s'));
FrameObject.Flag.rawset(Key, Value);
break;
case 16:
local SoundTempSize = Ro.readn('i');
Key = "PLAY_SOUND";
Value = Ro.GetString(SoundTempSize);
FrameObject.Flag.rawset(Key, Value);
break;
case 23:
Key = "SET_FLAG";
Value = Ro.readn('i');
FrameObject.Flag.rawset(Key, Value);
break;
case 24:
Key = "FLIP_TYPE";
Value = Rindro_Script.Get_Ani_Flip_Type(Ro.readn('s'));
FrameObject.Flag.rawset(Key, Value);
break;
case 25:
Key = "LOOP_START";
FrameObject.Flag.rawset(Key, 1);
break;
case 26:
Key = "LOOP_END";
Value = Ro.readn('i');
FrameObject.Flag.rawset(Key, Value);
break;
case 27:
Key = "CLIP";
Value = [
Ro.GetShort(),
Ro.GetShort(),
Ro.GetShort(),
Ro.GetShort(),
];
FrameObject.Flag.rawset(Key, Value);
break;
default:
break;
}
}
//每一帧都是一个结构体 存入数组中
AniObject.Frame.append(FrameObject);
}
return AniObject;
}
}
Rindro_Script.GetBin();
Rindro_Script.InitLoad_String();

View File

@ -399,12 +399,37 @@ class ItemInfoClass {
// L_Sq_CallFunc(0xF3B3B0, "int", FFI_THISCALL, ["int", "int", "int", "int", "int"], Ret, 600, 200, 28, 28);
// Rindro_Haker.LoadHook(0x11BD160, ["int", "int", "bool"],
// Rindro_Haker.LoadHook(0x8265A0, ["int", "int", "int", "void"],
// function(args) {
// args[0] = -1;
// // print(args[0]);
// return args;
// // print(args[1]);
// print(format("%02x", args[0]));
// // print(args[0]);
// return null;
// },
// function(args) {
// // print(args.pop());
// // print(">>>>>>");
// return null;
// });
// Rindro_Haker.LoadHook(0x7B64BA, ["int", "int", "int", "int", "int", "int", "char"],
// function(args) {
// // print("args[0] : " + args[0]);
// // print("args[1] : " + format("%02x", args[1]));
// // print("args[2] : " + format("%02x", args[2]));
// // print("args[3] : " + args[3]);
// // print("args[4] : " + args[4]);
// // print("args[5] : " + args[5]);
// // print(args[1]);
// // print(args[2]);
// // print(args[0]);
// return null;
// },
// function(args) {
// // print(args.pop());

View File

@ -8,6 +8,9 @@ dofile("sqr/Base/_Tool/BaseTool_Class.nut"); //基础工具类
dofile("sqr/Base/_Tool/MemoryClass.nut"); //内存类
dofile("sqr/Base/_Tool/Hacker_Class.nut"); //黑客工具类
dofile("sqr/Base/_Tool/Hacker_RegApi.nut"); //黑客注册工具类
dofile("sqr/Base/_Tool/Script_Class.nut"); //pvf读取类
dofile("sqr/Base/_Tool/Image_Class.nut"); //image类
dofile("sqr/Base/_Tool/Animation_Class.nut"); //动画类
//基础工具类
//回调注册类
@ -46,6 +49,7 @@ dofile("sqr/Project/OnilneSign/OnilneSign.nut"); //在线签到
dofile("sqr/Project/FightSign/FightSign.nut"); //每日签到
dofile("sqr/Project/CombatRank/CombatRank.nut"); //战斗力系统
dofile("sqr/Project/Anton/Rindro_Anton.nut"); //安图恩
dofile("sqr/Project/Luke/Rindro_Luke.nut"); //卢克
dofile("sqr/Project/AradPass/AradPass.nut"); //战令
dofile("sqr/Project/MidsummerParty/MidsummerParty.nut"); //希曼音乐会
dofile("sqr/Project/ServerAuction/ServerAuction.nut"); //全服竞拍

View File

@ -235,7 +235,7 @@ class Rindro_AntonApplyJoinC extends LenheartNewUI_Windows {
L_sq_DrawCode(Fatigue, X + 216 - LenheartTextClass.GetStringLength(Fatigue) / 2, Y + 76, sq_RGBA(134, 120, 79, 255), 0, 1);
L_sq_DrawCode("战斗力:", X + 70, Y + 93, sq_RGBA(134, 120, 79, 255), 0, 1);
L_sq_DrawCode(Combat, X + 170 - LenheartTextClass.GetStringLength(Combat) / 2, Y + 93, sq_RGBA(74, 162, 86, 255), 0, 1);
L_sq_DrawCode("通关超时空攻坚战" + ClearanceCount + "次", X + 130 - LenheartTextClass.GetStringLength("通关超时空攻坚战" + ClearanceCount + "次") / 2, Y + 144, sq_RGBA(221, 213, 147, 255), 0, 1);
L_sq_DrawCode("通关安图恩攻坚战" + ClearanceCount + "次", X + 130 - LenheartTextClass.GetStringLength("通关安图恩攻坚战" + ClearanceCount + "次") / 2, Y + 144, sq_RGBA(221, 213, 147, 255), 0, 1);
L_sq_DrawCode("申请加入攻坚队。", X + 87, Y + 160, sq_RGBA(160, 132, 75, 255), 0, 1);
L_sq_DrawCode("请确定是否同意?", X + 87, Y + 176, sq_RGBA(160, 132, 75, 255), 0, 1);

View File

@ -202,14 +202,8 @@ class HudUiC extends LenheartNewUI_Windows {
}
// local Window = sq_GetPopupWindowMainCotrol(74);
// print(Window.IsWindowFocus());
// asos = R_Utils.GetCharacByEqu(0, 0, [601550071, 601560067, 601570062, 601520061, 601500069, 601510068, 601530060, 601540069, 601580026, 27601]);
// asos = sq_CreateAICharacter(900);
}
asos = null;
function RegisterWidget() {
//铃铛按钮
@ -278,7 +272,7 @@ class HudUiC extends LenheartNewUI_Windows {
local Width = XCounts == 0 ? 0 : 30 + ((XCounts - 2) * 20);
local YCounts = (EventCounts - 1) / 8;
L_sq_DrawWindow(getroottable()["LenheartEventOffset"].x + 456 - 5, getroottable()["LenheartEventOffset"].y - 5 - (YCounts * 21), Width, YCounts * 20, "interface2/hud/hudbox.img", 0, 22, 20, 7, 21);
if (getroottable().rawin("LenheartEventOffset")) L_sq_DrawWindow(getroottable()["LenheartEventOffset"].x + 456 - 5, getroottable()["LenheartEventOffset"].y - 5 - (YCounts * 21), Width, YCounts * 20, "interface2/hud/hudbox.img", 0, 22, 20, 7, 21);
}
function DrawBall(obj) {
@ -610,6 +604,8 @@ class HudUiC extends LenheartNewUI_Windows {
//绘制活动图标背景槽
DrawEventBackground(obj);
}
function Show(obj) {

View File

@ -0,0 +1,427 @@
/*
文件名:Rindro_Luke.nut
路径:Project/Luke/Rindro_Luke.nut
创建日期:2024-08-13 09:30
文件用途:卢克
*/
dofile("sqr/Project/Luke/Rindro_Luke_CreateParty.nut");
dofile("sqr/Project/Luke/Rindro_Luke_FightSituation.nut");
dofile("sqr/Project/Luke/Rindro_Luke_Noti.nut");
dofile("sqr/Project/Luke/Rindro_Luke_Party.nut");
dofile("sqr/Project/Luke/Rindro_Luke_PartyApplyJoin.nut");
dofile("sqr/Project/Luke/Rindro_Luke_PartyFormation.nut");
dofile("sqr/Project/Luke/Rindro_Luke_PartyHall.nut");
dofile("sqr/Project/Luke/Rindro_Luke_PartyInfo.nut");
dofile("sqr/Project/Luke/Rindro_Luke_PartyMemberInfo.nut");
dofile("sqr/Project/Luke/Rindro_Luke_PlayerInteractive.nut");
dofile("sqr/Project/Luke/Rindro_Luke_Reward.nut");
//卢克核心数据类
class RinDro_Luke extends Rindro_BaseToolClass {
//基础配置
BaseConfig = null;
//攻坚配置
FightConfig = null;
//我的攻坚队状态
MyRaidState = null;
//我的攻坚队伍
MyRaidTeam = null;
//我的攻坚队伍ID
MyRaidTeamId = null;
//我的Cid
MyCid = null;
//我是否是攻坚队队长
IsCaptain = null;
//结束时间
EndTime = null;
//我的攻坚队攻坚阶段
RaidStage = 0;
//我的攻坚队伍头像存储
Portrait = null;
//卢克我的队伍窗口
PartyWindow_Object = null;
//攻坚战况表窗口
FightSituationWindow_Object = null;
//攻坚大厅窗口
PartyHallWindow_Object = null;
//翻牌奖励窗口
RewardWindow_Object = null;
//编队窗口
PartyFormationWindow_Object = null;
//攻坚开始动画的Flag
DrawStartAniMark = false;
//请求基础信息配置
function GetFiendwarBase() {
local T = {
op = 20084501,
}
SendPackEx(T);
}
//请求掉线配置信息
function GetFiendwarDown() {
local T = {
op = 20084063,
}
SendPackEx(T);
}
//基础信息配置
function FiendwarBase(Chunk) {
BaseConfig = Json.Decode(Chunk);
FiendwarChannelTownLogicCallBack();
}
//基础攻坚信息配置
function LukeFightBase(Chunk) {
FightConfig = Json.Decode(Chunk);
}
//团本专属频道上线城镇移动包
function FiendwarChannelTownLogicCallBack() {
if (BaseConfig.channel_index.find("19")) {
if (L_sq_GetTownIndex() != BaseConfig.town_index) {
L_sq_MoveTown(BaseConfig.town_index, 0, 474, 249);
}
} else {
//在卢克区域的 要转移回普通城镇
if (L_sq_GetTownIndex() == BaseConfig.town_index) {
L_sq_MoveTown(1, 1, 474, 249);
}
}
}
//获取攻坚队信息回调
function GetTeamInfoCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
local ZlibStr = Jso.ZipS;
Jso.ZipS = Json.Decode(L_sq_Dezlib(Jso.ZipS));
Jso.team <- Jso.ZipS.team;
//取的窗口对象
local Win = PartyWindow_Object;
Win.InfoFlag = true;
//如果攻坚队伍信息中已经有了角色成员 清空成员对象集合
for (local i = 0; i< Win.Childrens.len(); i++) {
local Cobj = Win.Childrens[i];
if (Cobj instanceof Rindro_LukePartyInfoMemberC) {
Win.Childrens.remove(i);
i--;
}
}
//重置成员数组
Win.MembersList = [];
//清空是否为我的队伍状态
Win.IsMyTeam = false;
//清空是否为队长状态
Win.IsCaptain = false;
//赋值队伍名称
Win.TeamName = Jso.team.TeamName;
//赋值队伍ID
Win.TeamID = Jso.team.TeamId;
//还原头像
Portrait = {};
//遍历Team包 用于构造队伍窗口中的每一位成员
foreach(_index, MemberObj in Jso.team.characNum) {
// for (local i = 0; i< 8; i++) {
// local MemberObj = Jso.team.characNum[0];
// local MemberObj = Jso.team.characNum[0];
//说明我在这个攻坚队里
if (Jso.cid == MemberObj.CID) {
Win.IsMyTeam = true;
MyRaidState = Jso.team.State;
MyRaidTeam = PartyWindow_Object;
//向全局类存入我的攻坚队伍ID
MyRaidTeamId = Jso.team.TeamId;
//存入我的CID
MyCid = Jso.cid;
//说明是队长
if (Jso.cid == Jso.team.captainCid) {
Win.IsCaptain = true;
//存入我是攻坚队队长
IsCaptain = true;
}
}
//构造CID对应的装备数组方便绘制
Portrait.rawset(MemberObj.CID, {
EquVos = clone(MemberObj.equVos),
Job = MemberObj.PlayerJob,
TeamId = MemberObj.characNum,
Name = MemberObj.PlayerName,
});
local T = {
PartyId = Jso.team.TeamId, //攻坚队ID
TeamId = MemberObj.characNum, //小队编号
Level = MemberObj.PlayerLevel.tostring(), //等级
Name = MemberObj.PlayerName, //名字
JobName = MemberObj.PlayerGrowTypeJob, //职业名
Job = MemberObj.PlayerJob, //职业编号
StkHasFlag = MemberObj.isPrepare, //是否拥有攻坚材料
EquVos = MemberObj.equVos, //装备List 用于显示头像
Captain = MemberObj.CaptainBool, //是否为攻坚队队长
Cid = MemberObj.CID, //Cid
OnlineState = MemberObj.onLineStart, //在线状态
ExitTime = MemberObj.exitTime, //离队时间
PlayerSession = MemberObj.PlayerSession, //玩家在世界中的Session 用于进行原生用户操作
ClearanceCount = MemberObj.ClearanceCount, //通关次数
ClearanceCountMax = FightConfig.rewardCondition, //总通关次数
}
//通过类构造并添加队伍成员UI对象
local TeamBuf = Rindro_LukePartyInfoMemberC(T);
Win.AddChild(TeamBuf);
Win.MembersList.append(TeamBuf);
}
if (("OpenWin" in Jso)) {
//开启队伍窗口显示
Win.Visible = true;
//设置置顶
Win.ResetFocus();
}
}
//攻坚队攻坚开始回调
function RaidStartFightCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
RaidStage = Jso.state;
MyRaidState = Jso.state;
//在获取一下攻坚队信息
local Jso = {
op = 20084011
}
SendPackEx(Jso);
}
//结束时间
EndTime = null;
//上次刷新信息包的时间
PackCurT = null;
//攻坚队信息包
function RaidFightInfoCallBack(Chunk) {
PackCurT = Clock();
local Info = Json.Decode(Chunk).fightInfo;
EndTime = Info.endTime;
if (FightSituationWindow_Object) FightSituationWindow_Object.InitInfo(Info);
//如果存在
if (MyRaidTeam && MyRaidTeam.InfoFlag) {
for (local i = 0; i< MyRaidTeam.MembersList.len(); i++) {
local PInfo = MyRaidTeam.MembersList[i].InfoObj;
local CID = PInfo.Cid;
local Flag = false;
foreach(scid in Info.Standby) {
if (scid == CID) Flag = true;
}
if (Flag) {
MyRaidTeam.MembersList[i].InfoObj.Standby <- true;
} else {
MyRaidTeam.MembersList[i].InfoObj.Standby <- false;
}
}
}
}
//收到奖励包
function RaidRewardInfoCallBack(Chunk) {
local Info = Json.Decode(Chunk);
RewardWindow_Object.Init(Info);
}
//收到初始化包
function RaidInitCallBack(Chunk) {
//我的攻坚队状态
MyRaidState = null;
//我的攻坚队伍
MyRaidTeam = null;
//我的攻坚队伍ID
MyRaidTeamId = null;
//我的Cid
MyCid = null;
//我是否是攻坚队队长
IsCaptain = null;
//结束时间
EndTime = null;
//我的攻坚队攻坚阶段
RaidStage = 0;
//我的攻坚队伍头像存储
Portrait = null;
//卢克我的队伍窗口
PartyWindow_Object.DestroyWindow();
//攻坚战况表窗口
FightSituationWindow_Object.DestroyWindow();
//攻坚大厅窗口
PartyHallWindow_Object.DestroyWindow();
//翻牌奖励窗口
RewardWindow_Object.DestroyWindow();
//编队窗口
PartyFormationWindow_Object.DestroyWindow();
//卢克我的队伍窗口
PartyWindow_Object = null;
//攻坚战况表窗口
FightSituationWindow_Object = null;
//攻坚大厅窗口
PartyHallWindow_Object = null;
//翻牌奖励窗口
RewardWindow_Object = null;
//编队窗口
PartyFormationWindow_Object = null;
}
MonsterFMap = [202210052, 202210053, 202210054, 202210055];
//火山怪物投放包
function MonsterSendCallBack(Chunk) {
local Info = Json.Decode(Chunk);
if (sq_GetCurrentModuleType() == 3) {
local obj = sq_GetMyMasterCharacter();
obj = sq_ObjectToSQRCharacter(obj);
obj.sq_SendCreatePassiveObjectPacket(MonsterFMap[Info.id], 0, 120, 1, 0);
}
}
constructor() {
// DrawStartAniMark = true;
// DrawStartAniT = Clock();
Pack_Control.rawset(20084028, RaidStartFightCallBack.bindenv(this));
Pack_Control.rawset(20084016, RaidFightInfoCallBack.bindenv(this));
Pack_Control.rawset(20084004, GetTeamInfoCallBack.bindenv(this));
Pack_Control.rawset(20084036, LukeFightBase.bindenv(this));
//攻坚奖励包
Pack_Control.rawset(20084026, RaidRewardInfoCallBack.bindenv(this));
//初始化包 退出队伍 或者 被 请出队伍
Pack_Control.rawset(20084008, RaidInitCallBack.bindenv(this));
//火山怪物投放
Pack_Control.rawset(20084050, MonsterSendCallBack.bindenv(this));
//绘制动画包
Pack_Control.rawset(20084038, RaidPlayAniCallBack.bindenv(this));
//获取基础配置回调包
Pack_Control.rawset(20084502, FiendwarBase.bindenv(this));
//第一次上线要重新请求一下位置信息
GetFiendwarBase();
//看看是否有断线重连
GetFiendwarDown();
}
function Proc(obj) {
PartyHallWindow_Object = LenheartNewUI_CreateWindow(Rindro_Luke_PartyHallC, "新卢克攻坚大厅窗口", ((getroottable().Rindro_Scr_Width - 478)).tointeger(), 40, 478, 434, 18);
PartyFormationWindow_Object = LenheartNewUI_CreateWindow(Rindro_LukePartyFormation, "卢克我的队伍编队窗口", 375, 190, 294, 192, 18);
FightSituationWindow_Object = LenheartNewUI_CreateWindow(Rindro_LukeFightSituationC, "卢克攻坚战况表", ((getroottable().Rindro_Scr_Width - 800) / 2).tointeger(), 8, 800, 600, 0);
PartyWindow_Object = LenheartNewUI_CreateWindow(Rindro_LukePartyInfoC, "卢克我的队伍窗口", 6, 15, 354, 566, 18);
RewardWindow_Object = LenheartNewUI_CreateWindow(Rindro_Luke_RewardC, "卢克翻牌奖励窗口", 0, 0, 0, 0, 0);
LenheartNewUI_CreateWindow(Rindro_Luke_NotiC, "卢克攻坚队伍消息分发", 0, 0, 0, 0, 0);
if (FightSituationWindow_Object) FightSituationWindow_Object.TopDraw(obj);
//绘制动画
DrawPlayAni(obj);
}
DrawPlayAniMark = null;
DrawPlayAniT = null;
function RaidPlayAniCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
DrawPlayAniMark = Jso.type;
DrawPlayAniT = Clock();
}
//绘制通关副本动画
function DrawPlayAni(obj) {
if (!DrawPlayAniMark || !DrawPlayAniT) return;
local Offset = 0;
if (getroottable().Rindro_Scr_Width > 800) Offset = ((getroottable().Rindro_Scr_Width - 800) / 2);
local Ct = Clock() - DrawPlayAniT;
switch (DrawPlayAniMark) {
case 1: //通关擎天A
case 2: //通关擎天B
case 13: //通关擎天B
local Ani = T_DrawDynamicAni(obj, "common/anton/title/04_clear_back.ani", 0 + Offset, 180, "卢克通关擎天A" + DrawPlayAniT);
local str = "擎天之柱A";
if (DrawPlayAniMark == 2) str = "擎天之柱B"
if (DrawPlayAniMark == 13) str = "黑色火山"
if (Ct >= 350 && Ct <= 1400) L_sq_DrawCode(str, 236 + Offset + 158 - LenheartTextClass.GetStringLength(str) / 2, 244, sq_RGBA(255, 146, 0, 250), 0, 1);
break;
case 5:
T_DrawDynamicAni(obj, "common/luke/newtile/00_start_back.ani", 401 + Offset, 210 + 26, "卢克阻截开始" + DrawPlayAniT);
break;
case 6:
T_DrawDynamicAni(obj, "common/luke/newtile/02_success_back.ani", 401 + Offset, 210 + 26, "卢克阻截成功" + DrawPlayAniT);
break;
case 7:
T_DrawDynamicAni(obj, "common/luke/newtile/01_fail_back.ani", 401 + Offset, 210 + 26, "卢克阻截失败" + DrawPlayAniT);
break;
case 8:
T_DrawDynamicAni(obj, "common/luke/newtile/00_start_back_1.ani", 401 + Offset, 210 + 26, "卢克灭杀开始" + DrawPlayAniT);
break;
case 9:
T_DrawDynamicAni(obj, "common/luke/newtile/02_success_back_1.ani", 401 + Offset, 210 + 26, "卢克灭杀成功" + DrawPlayAniT);
break;
case 10:
T_DrawDynamicAni(obj, "common/luke/newtile/01_fail_back_1.ani", 401 + Offset, 210 + 26, "卢克灭杀失败" + DrawPlayAniT);
break;
case 11:
case 12:
T_DrawDynamicAni(obj, "common/anton/title/03_warning_back.ani", 0 + Offset, 210 + 26, "卢克火山警告" + DrawPlayAniT);
local str = "火山能量即将过载,请立即前往压制!!!";
if (DrawPlayAniMark == 12) str = "震颤的大地已经复活,请立即前往压制!!!"
if (Ct >= 350 && Ct <= 1600) L_sq_DrawCode(str, 236 + Offset + 158 - LenheartTextClass.GetStringLength(str) / 2, 320, sq_RGBA(255, 50, 50, 250), 0, 1);
break;
default:
break;
}
if (Ct >= 3000) {
DrawPlayAniMark = null;
DrawPlayAniT = null;
}
}
}
getroottable().rawdelete("RinDro_Luke_Obj");
function Lenheart_Rindro_Luke_New(obj) {
local RootTab = getroottable();
if (!RootTab.rawin("RinDro_Luke_Obj")) {
RootTab.rawset("RinDro_Luke_Obj", RinDro_Luke());
} else {
RootTab["RinDro_Luke_Obj"].Proc(obj);
}
}
if (getroottable().rawin("LenheartTopFuncTab")) {
getroottable()["LenheartTopFuncTab"].rawset("Lenheart_Rindro_Luke_NewFunc", Lenheart_Rindro_Luke_New);
} else {
local T = {};
T.rawset("Lenheart_Rindro_Luke_NewFunc", Lenheart_Rindro_Luke_New);
getroottable().rawset("LenheartTopFuncTab", T);
}

View File

@ -0,0 +1,106 @@
/*
文件名:Rindro_Luke_CreateParty.nut
路径:Plugins/New_Luke/Rindro_Luke_CreateParty.nut
创建日期:2024-07-15 20:28
文件用途:卢克创建队伍窗口
*/
class Rindro_LukeCreatePartyC extends LenheartNewUI_Windows {
//调试模式
DeBugMode = false;
X = 290;
Y = 220;
//输入框
InputObject = null;
//时装 帽子 头部 脸 上衣 下装 鞋子 胸部 腰部 皮肤 光环
AvatarInfoIdx = [0x3038, 0x3010, 0x3014, 0x3018, 0x301c, 0x3020, 0x3024, 0x3028, 0x302c, 0x3030, 0x3034];
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
//关闭按钮
local CloseButton = LenheartNewUI_BaseButton(266, 2, 11, 12, "interface/lenheartwindowcommon.img", 276);
CloseButton.OnClick = function() {
DestroyWindow();
}.bindenv(this);
AddChild(CloseButton);
local OkButton = LenheartNewUI_ButtonText(78, 124, 5, "确定");
OkButton.SetTextOffset(0, 1);
OkButton.OnClick = function() {
//如果队伍名输出框的文字长度大于0就创建队伍 创建时告诉服务端自己的 头发 帽子 脸部 皮肤
if (InputObject.str.len() > 0) {
local C_Object = L_sq_RA(0x1ab7cdc);
local avataritemsbuf = [];
foreach(offset in AvatarInfoIdx) {
local AvatarEquiAddress = L_sq_RA(C_Object + offset);
if (AvatarEquiAddress >= 0x400000) {
local Ab = [];
local NormalIndex = L_sq_RA(AvatarEquiAddress + 0x1c);
local ExIndex = L_sq_RA(AvatarEquiAddress + 0x13E0);
Ab.append(NormalIndex);
Ab.append(ExIndex);
avataritemsbuf.append(Ab);
} else {
local Ab = [];
Ab.append(0);
Ab.append(0);
avataritemsbuf.append(Ab);
}
}
local T = {
op = 20084001,
teamsName = InputObject.str,
items = avataritemsbuf,
}
SendPackEx(T);
DestroyWindow();
}
}.bindenv(this);
AddChild(OkButton);
local CloseButton = LenheartNewUI_ButtonText(144, 124, 5, "取消");
CloseButton.SetTextOffset(0, 1);
CloseButton.OnClick = function() {
DestroyWindow();
}.bindenv(this);
AddChild(CloseButton);
InputObject = LenheartNewUI_BaseInput(62, 68, 152, 20);
AddChild(InputObject);
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
}
//绘制主界面
function DrawMain(obj) {
L_sq_DrawWindow(X, Y + 10, 260, 120, "interface/lenheartwindowcommon.img", 213, 12, 2, 13, 2);
L_sq_DrawWindow(X, Y + 10, 260, 120, "interface/lenheartwindowcommon.img", 213, 12, 2, 13, 2);
L_sq_DrawImg("interface2/gcontents/rindroanton/raid/raid_areaimg_fiend.img", 1, X + 11, Y + 21);
L_sq_DrawImg("hud/rindroanton.img", 9, X - 2, Y + 2);
L_sq_DrawCode("创建攻坚队", X + 112, Y + 4, sq_RGBA(179, 169, 135, 255), 0, 1);
L_sq_DrawImg("hud/rindroanton.img", 10, X + 72, Y + 44);
}
function Show(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
//逻辑入口
function Proc(obj) {
LenheartNewUI_Windows.SyncPos(X, Y);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,127 @@
/*
文件名:Rindro_Luke_Noti.nut
路径:Plugins/Rindro_Luke_/Rindro_Luke_Noti.nut
创建日期:2024-04-12 22:12
文件用途:超时空攻坚战队伍消息
*/
class Rindro_Luke_NotiC extends LenheartNewUI_Windows {
//调试模式
// DeBugMode = true;
//不要窗口模式
NoWindow = true;
//消息内容
Msg = null;
//队长名称
Name = null;
//消息时间
Timer = null;
//X Y 裁切开始X Y 裁切结束X Y
OffsetArr = [
//男鬼剑士
[56, 112, 220, 222],
//女格斗家
[54, 103, 240, 278],
//男神枪手
[55, 130, 236, 246],
//女魔法师
[57, 88, 234, 291],
//男圣职者
[57, 124, 208, 190],
//女神枪手
[56, 119, 226, 209],
//暗夜使者
[56, 117, 225, 212],
//男格斗家
[56, 118, 233, 212],
//男魔法师
[54, 103, 236, 276],
//黑暗武士
[56, 112, 220, 222],
//缔造者
[57, 88, 234, 291],
]
//队伍聊天消息分发
function Rindro_Luke_PartyNotiCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
Name = Jso.Name;
Msg = Jso.msg;
Timer = Clock();
}
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
//注册控件
RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
//队伍聊天消息分发
Pack_Control.rawset(20084018, Rindro_Luke_PartyNotiCallBack.bindenv(this));
}
function RegisterWidget() {
}
//队长头像
PartyMasterIcon = null;
//绘制主界面
function DrawMain(obj) {
if (!Name || !Msg) return;
local Ct = Clock() - Timer;
T_DrawDynamicAni(obj, "common/anton/title/06_leader_message_00.ani", 180, 180, "攻坚队团长消息分发" + Timer);
if (RinDro_Luke_Obj.MyRaidTeam) {
local Mt = RinDro_Luke_Obj.MyRaidTeam;
local PartyMaster = null;
foreach(index, value in Mt.MembersList) {
if (value.InfoObj.Captain) {
PartyMasterIcon = clone(value);
}
}
if (Ct >= 200) {
//绘制队长头像
foreach(AvatarObj in PartyMasterIcon.InfoObj.EquVos) {
local AXpos = AvatarObj.F[0][2] + X + OffsetArr[PartyMasterIcon.InfoObj.Job][0] - 9 + 150;
local AYpos = AvatarObj.F[0][3] + Y + OffsetArr[PartyMasterIcon.InfoObj.Job][1] + 184;
setClip(AXpos + OffsetArr[PartyMasterIcon.InfoObj.Job][2], AYpos + OffsetArr[PartyMasterIcon.InfoObj.Job][3], AXpos + OffsetArr[PartyMasterIcon.InfoObj.Job][2] + 22, AYpos + OffsetArr[PartyMasterIcon.InfoObj.Job][3] + 18); //开始裁切
L_sq_DrawImg("character/" + AvatarObj.B + ".img", AvatarObj.F[0][0], AXpos, AYpos);
releaseClip(); //裁切结束
}
}
}
//绘制消息
if (Ct >= 200) L_sq_DrawCode(Msg, X + 270 + LenheartTextClass.GetStringLength(Name), Y + 190, sq_RGBA(230, 200, 155, 255), 0, 1);
}
function Show(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
//逻辑入口
function Proc(obj) {
LenheartNewUI_Windows.SyncPos(X, Y);
if (Name && Msg)
ResetFocus();
else
// CloseWindow();
if (Timer) {
if (Clock() - Timer >= 3000) {
Timer = null;
Name = null;
Msg = null;
}
}
}
}

View File

@ -0,0 +1,79 @@
/*
文件名:Rindro_Luke_Party.nut
路径:Plugins/New_Luke/Rindro_Luke_Party.nut
创建日期:2024-07-15 21:02
文件用途:卢克队伍对象
*/
class Rindro_LukePartyC extends LenheartNewUI_CommonUi {
X = 0;
Y = 0;
Width = null;
Height = null;
TeamObj = null;
//选中状态
SelectState = false;
//攻坚状态
OffensiveState = 0;
constructor(gTeamObj) {
//拿到信息Map
TeamObj = gTeamObj;
//设定宽高 坐标不重要 会被父窗口的Sync同步坐标
this.Width = 458;
this.Height = 21;
this.OnClick = function() {
//还原父对象中其他攻坚队伍类 选中自己
foreach(Obj in Parent.Childrens) {
if (Obj instanceof Rindro_LukePartyC) {
Obj.SelectState = false;
}
}
SelectState = !SelectState;
//发送查看攻坚队具体信息包
local T = {
op = 20084013,
teamsId = TeamObj.TeamId
}
SendPackEx(T);
}
LenheartNewUI_CommonUi.constructor(10, 82, this.Width, this.Height);
}
function Show(obj) {
//绘制底槽
L_sq_DrawImg("hud/rindroanton.img", 4, X, Y);
//绘制队伍编号
L_sq_DrawCode(TeamObj.TeamId, X + 22 - LenheartTextClass.GetStringLength(TeamObj.TeamId) / 2, Y + 5, sq_RGBA(134, 120, 79, 255), 0, 1);
//绘制队长头像
L_sq_DrawImg("interface/lenheartwindowcommon.img", 55, X + 52, Y + 7);
try {
local channel_index = FiendwarTotal.GetInstance().BaseConfig.channel_index;
channel_index = channel_index.slice(channel_index.len() - 2, channel_index.len());
//绘制频道信息
L_sq_DrawCode(channel_index, X + 102 - LenheartTextClass.GetStringLength(channel_index) / 2, Y + 5, sq_RGBA(134, 120, 79, 255), 0, 1);
} catch (exception) {
}
//绘制攻坚队名称
L_sq_DrawCode(TeamObj.TeamName, X + 130, Y + 5, sq_RGBA(134, 120, 79, 255), 0, 1);
// print(TeamObj.State);
//绘制攻坚队攻坚状态
L_sq_DrawImg("hud/newantonui.img", 4 + TeamObj.State, X + 314, Y + 2);
local PartyPlayerCountStr = TeamObj.TeamPlayerCount + " / " + 20;
//绘制攻坚队队员数量
L_sq_DrawCode(PartyPlayerCountStr, X + 434 - LenheartTextClass.GetStringLength(PartyPlayerCountStr) / 2, Y + 5, sq_RGBA(134, 120, 79, 255), 0, 1);
if (SelectState) {
L_sq_DrawImg("hud/rindroanton.img", 5, X, Y);
}
if (isInRect) {
L_sq_DrawImg("hud/rindroanton.img", 5, X, Y);
}
}
}

View File

@ -0,0 +1,258 @@
/*
文件名:Rindro_Luke_PartyApplyJoin.nut
路径:Plugins/New_Luke/Rindro_Luke_PartyApplyJoin.nut
创建日期:2024-07-16 21:54
文件用途:卢克玩家申请加入攻坚队
*/
class Rindro_LukeApplyJoinC extends LenheartNewUI_Windows {
//调试模式
// DeBugMode = true;
//角色对象
Charc = null;
//角色等级
Level = "100级";
//角色名称
Name = "凌众K";
//角色职业
Job = 0;
//角色决斗等级
PvpLevel = 1;
//职业名称
JobName = "大暗黑天";
//角色复活币
Coin = "139个";
//角色疲劳值
Fatigue = "156";
//战斗力
Combat = "170051206";
//通过次数
ClearanceCount = 63;
//玩家世界Session
PlayerSession = 0;
//请求者信息集合
RequestJoinTeamArr = null;
NowSelectJoinIndex = 0;
//角色头像集合
AvatarArr = null;
//初始化Flag
InitFlag = false;
//X Y 裁切开始X Y 裁切结束X Y
OffsetArr = [
//男鬼剑士
[56, 112, 220, 222],
//女格斗家
[54, 103, 240, 278],
//男神枪手
[55, 130, 236, 246],
//女魔法师
[57, 88, 234, 291],
//男圣职者
[57, 124, 208, 190],
//女神枪手
[56, 119, 226, 209],
//暗夜使者
[56, 117, 225, 212],
//男格斗家
[56, 118, 233, 212],
//男魔法师
[54, 103, 236, 276],
//黑暗武士
[56, 112, 220, 222],
//缔造者
[57, 88, 234, 291],
]
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
RequestJoinTeamArr = [];
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
}
function InitInfo() {
local InfoObj = RequestJoinTeamArr[NowSelectJoinIndex];
Charc = InfoObj.Charc;
//角色等级
Level = InfoObj.Level;
//角色名称
Name = InfoObj.Name;
//角色职业
Job = InfoObj.Job;
//角色决斗等级
PvpLevel = InfoObj.PvpLevel;
//职业名称
JobName = InfoObj.JobName;
//角色复活币
Coin = InfoObj.Coin + "个";
//角色疲劳值
Fatigue = InfoObj.Fatigue.tostring();
//战斗力
Combat = InfoObj.Combat;
//通过次数
ClearanceCount = InfoObj.ClearanceCount;
//头像
AvatarArr = InfoObj.AvatarArr;
//玩家世界Session
this.PlayerSession = InfoObj.PlayerSession;
Childrens = [];
//注册控件
RegisterWidget();
InitFlag = true;
}
function PopOne() {
if (RequestJoinTeamArr.len() > 1) {
RequestJoinTeamArr.remove(0);
InitInfo();
} else {
RequestJoinTeamArr = [];
CloseWindow();
}
}
function RegisterWidget() {
//关闭按钮
local CloseButton = LenheartNewUI_BaseButton(244, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
CloseButton.OnClick = function() {
PopOne();
}.bindenv(this);
AddChild(CloseButton);
//冒险团按钮
local MButton = LenheartNewUI_ButtonText(24, 114, 15, "冒险团信息");
MButton.SetTextOffset(-13, 2);
AddChild(MButton);
//冒险图鉴按钮
local FQButton = LenheartNewUI_ButtonText(95, 113, 15, "冒险图鉴");
FQButton.State = 8;
FQButton.SetTextOffset(-7, 2);
AddChild(FQButton);
//查看信息按钮
local CButton = LenheartNewUI_ButtonText(166, 114, 15, "查看信息");
CButton.SetTextOffset(-7, 2);
CButton.OnClick = function() {
local obj = sq_GetMyMasterCharacter();
// obj.sq_PlaySound("CLICK_BUTTON1");
L_sq_SendPackType(8);
L_sq_SendPackWord(this.PlayerSession);
L_sq_SendPackByte(3);
L_sq_SendPack();
getroottable().WindowsShowABFlag <- false; //让原生窗口置顶
}.bindenv(this);
AddChild(CButton);
//确认按钮
local OkButton = LenheartNewUI_ButtonText(74, 192, -1, "是");
OkButton.SetTextOffset(3, 2);
OkButton.OnClick = function() {
local T = {
op = 20084003,
teamsId = RinDro_Luke_Obj.MyRaidTeamId,
applyCid = Charc.CID
}
SendPackEx(T);
PopOne();
}.bindenv(this);
AddChild(OkButton);
//拒绝按钮
local NoButton = LenheartNewUI_ButtonText(130, 192, -1, "否");
NoButton.SetTextOffset(3, 2);
NoButton.OnClick = function() {
local T = {
op = 20084019,
charac = Charc.CID
}
SendPackEx(T);
PopOne();
}.bindenv(this);
AddChild(NoButton);
//左翻页按钮
local LeftButton = LenheartNewUI_BaseButton(90, 220, 15, 15, "interface/lenheartwindowcommon.img", 34);
LeftButton.OnClick = function() {
if (NowSelectJoinIndex > 0) NowSelectJoinIndex--;
InitInfo();
}.bindenv(this);
AddChild(LeftButton);
//右翻页按钮
local RightButton = LenheartNewUI_BaseButton(154, 220, 15, 15, "interface/lenheartwindowcommon.img", 38);
RightButton.OnClick = function() {
if (NowSelectJoinIndex< RequestJoinTeamArr.len() - 1) NowSelectJoinIndex++;
InitInfo();
}.bindenv(this);
AddChild(RightButton);
}
//绘制主界面
function DrawMain(obj) {
if (!InitFlag) return;
//标题栏
L_sq_DrawButton(X - 2, Y, 252, "interface/lenheartwindowcommon.img", 609, 2, 7);
//绘制窗口名字
L_sq_DrawCode("攻坚队申请", X + 100, Y + 4, sq_RGBA(134, 120, 79, 255), 0, 1);
//Item信息框一般为211的宽度
L_sq_DrawWindow(X, Y + 16, 240, 200, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
//绘制背景
L_sq_DrawImg("hud/fiendwarl.img", 15, X + 6, Y + 22);
//绘制角色背景
L_sq_DrawImg("hud/fiendwarl.img", 14, X + 8, Y + 40);
//绘制角色头像
if (AvatarArr) {
foreach(AvatarObj in AvatarArr) {
local AXpos = AvatarObj.F[0][2] + X + OffsetArr[Job][0] - 8;
local AYpos = AvatarObj.F[0][3] + Y + OffsetArr[Job][1] + 40;
setClip(AXpos + OffsetArr[Job][2], AYpos + OffsetArr[Job][3], AXpos + OffsetArr[Job][2] + 22, AYpos + OffsetArr[Job][3] + 18); //开始裁切
L_sq_DrawImg("character/" + AvatarObj.B + ".img", AvatarObj.F[0][0], AXpos, AYpos);
releaseClip(); //裁切结束
}
}
//绘制角色等级
L_sq_DrawCode(Level, X + 78 - LenheartTextClass.GetStringLength(Level) / 2, Y + 45, sq_RGBA(134, 120, 79, 255), 0, 1);
//绘制角色名字
L_sq_DrawCode(Name, X + 137 - LenheartTextClass.GetStringLength(Name) / 2, Y + 45, sq_RGBA(134, 120, 79, 255), 0, 1);
//绘制角色职业类型图标
if (Job != 4) L_sq_DrawImg("hud/fiendwarl.img", 16, X + 176, Y + 43);
//绘制角色职业名称
L_sq_DrawCode(JobName, X + 224 - LenheartTextClass.GetStringLength(JobName) / 2, Y + 45, sq_RGBA(134, 120, 79, 255), 0, 1);
//Item信息框一般为211的宽度
L_sq_DrawWindow(X + 21, Y + 65, 30, 30, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
L_sq_DrawWindow(X + 62, Y + 65, 156, 30, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
//绘制决斗等级
local PvpImg = PvpLevel / 6;
L_sq_DrawImg("hud/fiendwarl1.img", 99, X + 25, Y + 74);
L_sq_DrawCode(PvpLevel.tostring(), X + 45 - LenheartTextClass.GetStringLength(PvpLevel.tostring()) / 2, Y + 91, sq_RGBA(134, 120, 79, 255), 0, 1);
//绘制各项信息
L_sq_DrawCode("复活币:", X + 70, Y + 76, sq_RGBA(134, 120, 79, 255), 0, 1);
L_sq_DrawCode(Coin, X + 134 - LenheartTextClass.GetStringLength(Coin) / 2, Y + 76, sq_RGBA(134, 120, 79, 255), 0, 1);
L_sq_DrawCode("疲劳值:", X + 158, Y + 76, sq_RGBA(134, 120, 79, 255), 0, 1);
L_sq_DrawCode(Fatigue, X + 216 - LenheartTextClass.GetStringLength(Fatigue) / 2, Y + 76, sq_RGBA(134, 120, 79, 255), 0, 1);
L_sq_DrawCode("战斗力:", X + 70, Y + 93, sq_RGBA(134, 120, 79, 255), 0, 1);
L_sq_DrawCode(Combat, X + 170 - LenheartTextClass.GetStringLength(Combat) / 2, Y + 93, sq_RGBA(74, 162, 86, 255), 0, 1);
L_sq_DrawCode("通关卢克攻坚战" + ClearanceCount + "次", X + 130 - LenheartTextClass.GetStringLength("通关卢克攻坚战" + ClearanceCount + "次") / 2, Y + 144, sq_RGBA(221, 213, 147, 255), 0, 1);
L_sq_DrawCode("申请加入攻坚队。", X + 87, Y + 160, sq_RGBA(160, 132, 75, 255), 0, 1);
L_sq_DrawCode("请确定是否同意?", X + 87, Y + 176, sq_RGBA(160, 132, 75, 255), 0, 1);
L_sq_DrawWindow(X + 77, Y + 216, 100, 20, "interface/lenheartwindowcommon.img", 204, 4, 14, 4, 14);
//绘制页数
local Str = (NowSelectJoinIndex + 1) + " / " + RequestJoinTeamArr.len();
L_sq_DrawCode(Str, X + 137 - LenheartTextClass.GetStringLength(Str) / 2, Y + 222, sq_RGBA(134, 120, 79, 255), 0, 1);
}
function Show(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
//逻辑入口
function Proc(obj) {
LenheartNewUI_Windows.SyncPos(X, Y);
}
}

View File

@ -0,0 +1,121 @@
/*
文件名:Rindro_Luke_PartyFormation.nut
路径:Plugins/New_Luke/Rindro_Luke_PartyFormation.nut
创建日期:2024-07-16 16:22
文件用途:卢克 队内编队
*/
//编队用按钮需要传递参数所以重写
class Rindro_LukePartyInfoEdit_BaseButton extends LenheartNewUI_BaseButton {
MyInfoIndex = 0;
constructor(X, Y, W, H, Path, Idx, InfoIndex) {
MyInfoIndex = InfoIndex;
LenheartNewUI_BaseButton.constructor(X, Y, W, H, Path, Idx);
}
//鼠标左键弹起回调
function OnMouseLbUp(MousePos_X, MousePos_Y) {
if (isLBDown && OnClick) {
OnClick(MyInfoIndex);
}
isLBDown = false;
}
}
//编队窗口
class Rindro_LukePartyFormation extends LenheartNewUI_Windows {
//调试模式
// DeBugMode = true;
Visible = false;
PartyMarkFlag = -1;
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
//注册控件
RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
}
function RegisterWidget() {
//关闭按钮
local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
CloseButton.OnClick = function() {
CloseWindow();
}.bindenv(this);
AddChild(CloseButton);
//搜索按钮
local QdButton = LenheartNewUI_ButtonText(10, 157, 5, "签到");
QdButton.State = 8;
QdButton.SetTextOffset(0, 1);
AddChild(QdButton);
//解散队伍按钮
local BreakPartyButton = LenheartNewUI_ButtonText(80, 158, 5, "解散队伍");
BreakPartyButton.SetTextOffset(-12, 1);
BreakPartyButton.OnClick = function() {
PartyMarkFlag = 99;
}.bindenv(this);
AddChild(BreakPartyButton);
//关闭按钮
local CloseButton = LenheartNewUI_ButtonText(150, 158, 5, "关闭");
CloseButton.SetTextOffset(0, 1);
CloseButton.OnClick = function() {
CloseWindow();
}.bindenv(this);
AddChild(CloseButton);
for (local i = 0; i< 8; i++) {
//右翻页按钮
local PartyIndexButton = Rindro_LukePartyInfoEdit_BaseButton(12 + (i % 2 * 136), 35 + ((i / 2) * 30), 41, 17, "interface/newstyle/windows/party/party_icon.img", 3 + (i * 3), i);
//继承类 并重写 调用时传入InfoIndex
PartyIndexButton.OnClick = function(MyInfoIndex) {
PartyMarkFlag = MyInfoIndex;
}.bindenv(this);
AddChild(PartyIndexButton);
}
}
//绘制主界面
function DrawMain(obj) {
//标题栏
L_sq_DrawButton(X - 1, Y, 284, "interface/lenheartwindowcommon.img", 609, 2, 7);
//Item信息框一般为211的宽度
L_sq_DrawWindow(X, Y + 17, 272, 154, "interface/lenheartwindowcommon.img", 213, 12, 2, 13, 2);
for (local q = 0; q< 8; q++) {
L_sq_DrawImg("interface/lenheartwindowcommon.img", 358, X + 60 + (q % 2 * 136), Y + 34 + ((q / 2) * 30));
for (local i = 0; i< 3; i++) {
L_sq_DrawImg("interface/lenheartwindowcommon.img", 361, X + 80 + (q % 2 * 136) + (i * 20), Y + 34 + ((q / 2) * 30));
}
}
if (PartyMarkFlag != -1) {
R_Mouse.SetType(151);
}
}
function Show(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
//逻辑入口
function Proc(obj) {
LenheartNewUI_Windows.SyncPos(X, Y);
}
//鼠标左键弹起回调
function OnMouseLbUp(MousePos_X, MousePos_Y) {
//还原编队的鼠标指针
if (this.PartyMarkFlag != -1) {
this.PartyMarkFlag = -1;
R_Mouse.SetType(0);
}
LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y);
}
}

View File

@ -0,0 +1,350 @@
/*
文件名:Rindro_Luke_PartyHall.nut
路径:Plugins/New_Luke/Rindro_Luke_PartyHall.nut
创建日期:2024-07-15 16:50
文件用途:卢克组队大厅
*/
class Rindro_Luke_PartyHallC extends LenheartNewUI_Windows {
Visible = false;
//调试模式
// DeBugMode = true;
//页数
Page = 0;
//一页放多少个队伍
PageMaxCount = 13;
//攻坚队List
PartyList = null;
//获取所有队伍
function GetAllTeamCall() {
local Jso = {
op = 20084011
}
SendPack(Jso);
}
//获取所有队伍收包
function GetAllTeamCallCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
//清除原来的List PartyList可以直接清除 但是Childrens中的窗口需要调用底层方法清除队伍类
PartyList = [];
RemoveAllParty();
//遍历包构造攻坚队UI对象
foreach(TeamsSimple in Jso.TeamSimList) {
local RealState = 0;
if (TeamsSimple.State == 1) RealState = 1;
else if (TeamsSimple.State == 2) RealState = 0;
else if (TeamsSimple.State == 3) RealState = 2;
else if (TeamsSimple.State == 4) RealState = 3;
local T = {
TeamId = TeamsSimple.TeamId.tostring(),
TeamName = TeamsSimple.TeamName,
TeamPlayerCount = TeamsSimple.TeamPlayerCount,
State = RealState
}
local TeamBuf = Rindro_LukePartyC(T);
AddChild(TeamBuf);
PartyList.append(TeamBuf);
}
//收到刷新队伍列表包时需要将队伍窗口关闭 //TODO
// if ("Close" in Jso) LenheartNewUI_DestoryWindow("超时空我的队伍窗口");
}
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
PartyList = [];
//注册控件
RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
Pack_Control.rawset(20084002, GetAllTeamCallCallBack.bindenv(this));
GetAllTeamCall();
}
OnlyPreparingBtn = null;
OnlyPreparingFlag = 1;
InputObject = null;
function RegisterWidget() {
//关闭按钮
local CloseButton = LenheartNewUI_BaseButton(457, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
CloseButton.OnClick = function() {
CloseWindow();
}.bindenv(this);
AddChild(CloseButton);
//我的频道复选框
local MyChannelBtn = LenheartNewUI_SwitchButtonText(16, 30, "我的频道");
MyChannelBtn.State = 1;
MyChannelBtn.ImgIndex = 358;
MyChannelBtn.SetTextPos(12, 2);
MyChannelBtn.Width = 76;
MyChannelBtn.Height = 16;
AddChild(MyChannelBtn);
//只查看招募中的攻坚队
OnlyPreparingBtn = LenheartNewUI_SwitchButtonText(110, 30, "只查看招募中的攻坚队");
OnlyPreparingBtn.ImgIndex = 358;
OnlyPreparingBtn.SetTextPos(12, 2);
OnlyPreparingBtn.Width = 76;
OnlyPreparingBtn.Height = 16;
OnlyPreparingBtn.OnClick = function() {
switch (OnlyPreparingFlag) {
case 0:
OnlyPreparingFlag = 1;
break;
case 1:
OnlyPreparingFlag = 0;
break;
}
OnlyPreparingBtn.State = OnlyPreparingFlag;
}.bindenv(this);
AddChild(OnlyPreparingBtn);
//搜索队伍输入框
InputObject = LenheartNewUI_BaseInput(260, 31, 80, 20);
AddChild(InputObject);
//搜索按钮
local FindButton = LenheartNewUI_ButtonText(348, 28, 5, "搜索");
FindButton.SetTextOffset(0, 1);
FindButton.OnClick = function() {
if (InputObject.str.len() > 0) {
}
}.bindenv(this);
AddChild(FindButton);
//重置按钮
local ResetButton = LenheartNewUI_ButtonText(408, 28, 5, "重置");
ResetButton.SetTextOffset(0, 1);
ResetButton.OnClick = function() {
InputObject.str = "";
}.bindenv(this);
AddChild(ResetButton);
//编号按钮
local ModelButton = LenheartNewUI_ButtonText(9, 56, -18, "编号");
ModelButton.Idx = 163;
ModelButton.DWidth = -8;
ModelButton.SetTextOffset(-9, 1);
AddChild(ModelButton);
//状态按钮
local StateButton = LenheartNewUI_ButtonText(51, 56, -18, "状态");
StateButton.Idx = 163;
StateButton.DWidth = -8;
StateButton.SetTextOffset(-9, 1);
AddChild(StateButton);
//频道按钮
local ChannelButton = LenheartNewUI_ButtonText(93, 56, -18, "频道");
ChannelButton.Idx = 163;
ChannelButton.DWidth = -8;
ChannelButton.SetTextOffset(-9, 1);
AddChild(ChannelButton);
//攻坚队名称按钮
local PartyNameButton = LenheartNewUI_ButtonText(135, 56, 100, "攻坚队名称");
PartyNameButton.Idx = 163;
PartyNameButton.DWidth = 223;
PartyNameButton.FillWidth = 1;
PartyNameButton.FirstWidth = 21;
PartyNameButton.SetTextOffset(26, 1);
AddChild(PartyNameButton);
//阶段按钮
local StageButton = LenheartNewUI_ButtonText(289, 56, 52, "阶段");
StageButton.Idx = 163;
StageButton.DWidth = 140;
StageButton.FillWidth = 1;
StageButton.FirstWidth = 21;
StageButton.SetTextOffset(26, 1);
AddChild(StageButton);
//队员数量按钮
local TeammembersButton = LenheartNewUI_ButtonText(402, 56, 50, "队员数量");
TeammembersButton.Idx = 163;
TeammembersButton.FillWidth = 1;
TeammembersButton.FirstWidth = 21;
TeammembersButton.DWidth = 47;
TeammembersButton.SetTextOffset(-8, 1);
AddChild(TeammembersButton);
//创建攻坚队按钮
local MyPartyButton = LenheartNewUI_ButtonText(15, 395, 30, "创建攻坚队");
MyPartyButton.SetTextOffset(-6, 1);
MyPartyButton.OnClick = function() {
//有队伍则查看队伍信息
if (RinDro_Luke_Obj.MyRaidTeamId) {
//发送查看攻坚队具体信息包
local T = {
op = 20084013,
teamsId = RinDro_Luke_Obj.MyRaidTeamId
}
SendPackEx(T);
}
//否则创建队伍
else {
local Win = LenheartNewUI_CreateWindow(Rindro_LukeCreatePartyC, "卢克创建队伍窗口", 290, 220, 284, 154, 18);
Win.Visible = true;
Win.ResetFocus();
}
}.bindenv(this);
//设置动态回调改变按钮名称
MyPartyButton.SetCallBackFunc(function(window) {
if (RinDro_Luke_Obj.MyRaidTeamId) window.TextStr = "我的攻坚队";
else window.TextStr = "创建攻坚队";
}.bindenv(this));
AddChild(MyPartyButton);
//左翻页按钮
local LeftButton = LenheartNewUI_BaseButton(160, 400, 15, 15, "interface/lenheartwindowcommon.img", 34);
LeftButton.OnClick = function() {
if (Page > 0) Page--;
}.bindenv(this);
AddChild(LeftButton);
//右翻页按钮
local RightButton = LenheartNewUI_BaseButton(220, 400, 15, 15, "interface/lenheartwindowcommon.img", 38);
RightButton.OnClick = function() {
if (Page<(((PartyList.len() / PageMaxCount)))) Page++;
}.bindenv(this);
AddChild(RightButton);
//进入待机按钮
local FQButton = LenheartNewUI_ButtonText(300, 394, 20, "进入待机");
FQButton.SetTextOffset(-5, 2);
FQButton.State = 8;
AddChild(FQButton);
//刷新按钮
local RefreshButton = LenheartNewUI_BaseButton(410, 395, 25, 25, "interface/lenheartwindowcommon.img", 366);
RefreshButton.OnClick = function() {
GetAllTeamCall();
}.bindenv(this);
AddChild(RefreshButton);
//设置按钮
local SettingButton = LenheartNewUI_BaseButton(440, 394, 15, 15, "interface/lenheartwindowcommon.img", 362);
SettingButton.State = 8;
AddChild(SettingButton);
}
//绘制主界面
function DrawMain(obj) {
//Item信息框一般为211的宽度
L_sq_DrawWindow(X, Y + 10, 540 * 0.85, 420 * 0.9, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
L_sq_DrawWindow(X + 6, Y + 19, 528 * 0.85, 47, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
//绘制背景框标题栏
L_sq_DrawImg("hud/rindroanton.img", 3, X + 1, Y);
L_sq_DrawCode("寻找攻坚队", X + 217, Y + 3, sq_RGBA(179, 169, 135, 255), 0, 1);
//绘制队伍List
DrawPartyList(obj);
L_sq_DrawWindow(X + 6, Y + 382, 528 * 0.85, 24, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
//计算页数
local PageStr = Page + 1 + " / " + ((PartyList.len() / PageMaxCount) + 1);
//绘制当前页数
L_sq_DrawCode(PageStr, X + 166 + LenheartTextClass.GetStringLength(PageStr) / 2, Y + 402, sq_RGBA(134, 120, 79, 255), 0, 1);
}
//重置所有选中
function ResetAllSelect() {
foreach(Index, TeamObj in PartyList) {
TeamObj.SelectState = false;
}
}
//移除队伍
function RemoveParty(TeamId) {
local ObjectID = null;
for (local i = 0; i< Childrens.len(); i++) {
local Cobj = Childrens[i];
if (Cobj instanceof Rindro_LukePartyC) {
if (Cobj.TeamObj.TeamId.tointeger() == TeamId.tointeger()) {
ObjectID = Cobj.ObjectId;
}
}
}
if (ObjectID) RemoveChild(ObjectID);
}
//移除所有队伍
function RemoveAllParty() {
for (local i = 0; i< Childrens.len(); i++) {
local Cobj = Childrens[i];
if (Cobj instanceof Rindro_LukePartyC) {
Childrens.remove(i);
i--;
}
}
}
//绘制队伍信息
function DrawPartyList(obj) {
if (PartyList.len() <= 0) return;
//先遍历一遍全部挪走
foreach(Index, TeamObj in PartyList) {
TeamObj.SyncPos(9999, 9999);
}
//在遍历需要显示的同步坐标
foreach(Index, TeamObj in PartyList.slice((((Page) * PageMaxCount) > 0) ? ((Page) * PageMaxCount) : 0, ((Page + 1) * PageMaxCount) > PartyList.len() ? PartyList.len() : ((Page + 1) * PageMaxCount))) {
TeamObj.SyncPos(X, Y + 2 + (Index % PageMaxCount) * 23);
}
}
function Show(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
MainButton = null;
//逻辑入口
function Proc(obj) {
//界面未打开
if (!this.Visible && L_sq_RA(0x1A5FB4C, "0x14+0x28+")< 2) {
//在甲板
if (RinDro_Luke_Obj.BaseConfig && RinDro_Luke_Obj.BaseConfig.channel_index.find("19") && L_sq_GetTownIndex() == RinDro_Luke_Obj.BaseConfig.town_index && L_sq_GetRegionIndex() >= 1) {
local PaW = sq_GetPopupWindowMainCotrol(6);
if (PaW) {
L_sq_UseSkill(DIK_ESCAPE);
this.Visible = true;
GetAllTeamCall();
}
}
}
LenheartNewUI_Windows.SyncPos(X, Y);
}
}

View File

@ -0,0 +1,311 @@
/*
文件名:Rindro_Luke_PartyInfo.nut
路径:Plugins/New_Luke/Rindro_Luke_PartyInfo.nut
创建日期:2024-07-15 22:12
文件用途:卢克队伍信息窗口
*/
class Rindro_LukePartyInfoC extends LenheartNewUI_Windows {
Visible = false;
//调试模式
// DeBugMode = true;
//是否存在信息
InfoFlag = false;
//队员列表
MembersList = null;
//队伍名称
TeamName = "";
//队伍ID
TeamID = 99999999;
//是否是我的攻坚队
IsMyTeam = false;
//是否是队长
IsCaptain = false;
//收到请求加入攻坚队包
function JoinTeamCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
local win = LenheartNewUI_CreateWindow(Rindro_LukeApplyJoinC, "卢克申请加入队伍窗口", 542, 348, 257, 240, 18);
win.Visible = true;
win.ResetFocus();
local T = {
Charc = Jso.charac, //角色对象
Level = Jso.charac.PlayerLevel,
Name = Jso.charac.PlayerName,
Job = Jso.charac.PlayerJob,
PvpLevel = Jso.charac.pvp,
JobName = Jso.charac.PlayerGrowTypeJob,
Coin = Jso.charac.PlayCoin,
Fatigue = Jso.charac.PlayFatigue,
Combat = Jso.charac.ZL,
ClearanceCount = Jso.charac.ClearanceCount,
AvatarArr = Jso.charac.equVos,
PlayerSession = Jso.charac.PlayerSession
}
//没人
if (win.RequestJoinTeamArr.len() == 0) {
win.RequestJoinTeamArr.append(T);
win.InitInfo();
} else win.RequestJoinTeamArr.append(T);
}
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
//注册控件
// RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
Pack_Control.rawset(20084006, JoinTeamCallBack.bindenv(this));
RegisterWidget();
}
function RegisterWidget() {
//关闭按钮
local CloseButton = LenheartNewUI_BaseButton(336, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
CloseButton.OnClick = function() {
CloseWindow();
}.bindenv(this);
AddChild(CloseButton);
//队伍按钮
local ModelButton = LenheartNewUI_ButtonText(9, 60, -18, "队伍");
ModelButton.Idx = 163;
ModelButton.DWidth = -8;
ModelButton.SetTextOffset(-9, 1);
AddChild(ModelButton);
//等级按钮
local StateButton = LenheartNewUI_ButtonText(51, 60, -18, "等级");
StateButton.Idx = 163;
StateButton.DWidth = -8;
StateButton.SetTextOffset(-9, 1);
AddChild(StateButton);
//角色名按钮
local ChannelButton = LenheartNewUI_ButtonText(93, 60, 44, "角色名");
ChannelButton.Idx = 163;
ChannelButton.DWidth = 120;
ChannelButton.FillWidth = 1;
ChannelButton.FirstWidth = 21;
ChannelButton.SetTextOffset(17, 1);
AddChild(ChannelButton);
//攻坚队名称按钮
local PartyNameButton = LenheartNewUI_ButtonText(196, 60, 36, "职业名");
PartyNameButton.Idx = 163;
PartyNameButton.DWidth = 100;
PartyNameButton.FillWidth = 1;
PartyNameButton.FirstWidth = 21;
PartyNameButton.SetTextOffset(11, 1);
AddChild(PartyNameButton);
//入场材料按钮
local StageButton = LenheartNewUI_ButtonText(289, 60, 0, "入场材料");
StageButton.Idx = 163;
StageButton.DWidth = 26;
StageButton.FillWidth = 1;
StageButton.FirstWidth = 21;
StageButton.SetTextOffset(-14, 1);
StageButton.SetCallBackFunc(function(window) {
if (RinDro_Luke_Obj.EndTime) window.TextStr = "通关次数";
else window.TextStr = "入场材料";
}.bindenv(this));
AddChild(StageButton);
//如果不是我的队伍 并且我没有攻坚队
local JoinPartyButton = LenheartNewUI_ButtonText(10, 268 + 8, 10, "参加攻坚队");
JoinPartyButton.SetTextOffset(-15, 1);
JoinPartyButton.OnClick = function() {
//时装 帽子 头部 脸 上衣 下装 鞋子 胸部 腰部 皮肤 光环
local AvatarInfoIdx = [0x3038, 0x3010, 0x3014, 0x3018, 0x301c, 0x3020, 0x3024, 0x3028, 0x302c, 0x3030, 0x3034];
local C_Object = L_sq_RA(0x1ab7cdc);
local avataritemsbuf = [];
foreach(offset in AvatarInfoIdx) {
local AvatarEquiAddress = L_sq_RA(C_Object + offset);
if (AvatarEquiAddress >= 0x400000) {
local Ab = [];
local NormalIndex = L_sq_RA(AvatarEquiAddress + 0x1c);
local ExIndex = L_sq_RA(AvatarEquiAddress + 0x13E0);
Ab.append(NormalIndex);
Ab.append(ExIndex);
avataritemsbuf.append(Ab);
} else {
local Ab = [];
Ab.append(0);
Ab.append(0);
avataritemsbuf.append(Ab);
}
}
local T = {
op = 20084005,
teamsId = TeamID,
items = avataritemsbuf,
}
SendPackEx(T);
}.bindenv(this);
JoinPartyButton.SetCallBackFunc(function(window) {
if (!IsMyTeam && !RinDro_Luke_Obj.MyRaidTeamId)
window.X = 10;
else window.X = 90000;
}.bindenv(this));
AddChild(JoinPartyButton);
//如果是我的队伍
//退出按钮
local ExitButton = LenheartNewUI_ButtonText(220, 268 + 8, 5, "退出");
ExitButton.SetTextOffset(-1, 1);
ExitButton.OnClick = function() {
local T = {
op = 20084009,
teamsId = TeamID
}
SendPackEx(T);
RinDro_Luke_Obj.MyCid = null;
RinDro_Luke_Obj.MyRaidTeamId = null;
RinDro_Luke_Obj.IsCaptain = null;
//重置所有选中 并且从攻坚大厅对象中移除这个子对象
local HallWin = LenheartNewUI_CreateWindow(Rindro_Luke_PartyHallC, "新卢克攻坚大厅窗口", 320, 40, 478, 434, 18);
HallWin.ResetAllSelect();
HallWin.RemoveParty(this.TeamID);
DestroyWindow();
}.bindenv(this);
ExitButton.SetCallBackFunc(function(window) {
if (!IsMyTeam) window.X = X + 900000;
else window.X = X + 220;
}.bindenv(this));
AddChild(ExitButton);
//队伍编制按钮
local PartyEditButton = LenheartNewUI_ButtonText(10, 268 + 8, 5, "队伍编制");
PartyEditButton.SetTextOffset(-12, 1);
PartyEditButton.OnClick = function() {
local win = LenheartNewUI_CreateWindow(Rindro_LukePartyFormation, "卢克我的队伍编队窗口", 105, 40, 294, 192, 18);
win.Visible = true;
win.ResetFocus();
}.bindenv(this);
PartyEditButton.SetCallBackFunc(function(window) {
if (!IsMyTeam || !IsCaptain) window.X = X + 900000;
else window.X = X + 10;
}.bindenv(this));
AddChild(PartyEditButton);
//修改信息按钮
local FqButton = LenheartNewUI_ButtonText(100, 267 + 8, 5, "修改信息");
FqButton.State = 8;
FqButton.SetTextOffset(-12, 1);
FqButton.SetCallBackFunc(function(window) {
if (!IsMyTeam || !IsCaptain) window.X = X + 900000;
else window.X = X + 100;
}.bindenv(this));
AddChild(FqButton);
//队伍招募按钮
local FqButton1 = LenheartNewUI_ButtonText(160, 267 + 8, 5, "队伍招募");
FqButton1.State = 8;
FqButton1.SetTextOffset(-12, 1);
FqButton1.SetCallBackFunc(function(window) {
if (!IsMyTeam || !IsCaptain) window.X = X + 900000;
else window.X = X + 160;
}.bindenv(this));
AddChild(FqButton1);
//队伍招募按钮
local FightOpenButton = LenheartNewUI_ButtonText(290, 268 + 8, 5, "开始攻坚");
FightOpenButton.SetTextOffset(-12, 1);
FightOpenButton.OnClick = function() {
local T = {
op = 20084051,
teamsId = TeamID
}
SendPackEx(T);
}.bindenv(this);
FightOpenButton.SetCallBackFunc(function(window) {
// if (!IsMyTeam || !IsCaptain || RinDro_Luke_Obj.EndTime) window.X = X + 900000;
// else window.X = X + 290;
if ((RinDro_Luke_Obj.MyRaidState == 0 || RinDro_Luke_Obj.MyRaidState == 2) && IsCaptain && IsMyTeam) window.X = X + 290;
else window.X = X + 900000;
}.bindenv(this));
AddChild(FightOpenButton);
}
//绘制主界面
function DrawMain(obj) {
//如果没有信息则直接返回不绘制
if (!InfoFlag) return;
//标题栏
L_sq_DrawButton(X, Y, 344, "interface/lenheartwindowcommon.img", 609, 2, 7);
//绘制队伍名字
L_sq_DrawCode(TeamName, X + 178 - LenheartTextClass.GetStringLength(TeamName) / 2, Y + 5, sq_RGBA(134, 120, 79, 255), 0, 1);
//Item信息框一般为211的宽度
L_sq_DrawWindow(X, Y + 17, 340, 252, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
//绘制头图
L_sq_DrawImg("interface2/gcontents/180621_fiendwar/raid/memberwindow.img", 1, X + 10, Y + 24);
//绘制阶段图 //TODO 根据阶段绘制img
L_sq_DrawImg("hud/rindroanton.img", 7, X + 296, Y + 34);
//绘制队伍List
DrawMembersList(obj);
}
//绘制队伍信息
function DrawMembersList(obj) {
if (MembersList.len() <= 0) return;
//遍历需要显示的同步坐标
foreach(Index, TeamObj in MembersList) {
TeamObj.SyncPos(X, Y + 2 + Index * 23);
}
}
function Show(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
//逻辑入口
function Proc(obj) {
LenheartNewUI_Windows.SyncPos(X, Y);
}
/*
# override # "
* @函数作用:
* @参数 name
* @返回值
*/
//鼠标左键弹起回调
function OnMouseLbUp(MousePos_X, MousePos_Y) {
foreach(Window in Childrens) {
Window.OnMouseLbUp(MousePos_X, MousePos_Y);
}
LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y);
//判断没有点到具体角色就隐藏
if (!sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y + 80, Width, MembersList.len() * 21)) {
//交互窗口需要隐藏
local Each = LenheartNewUI_CreateWindow(Rindro_LukePlayerInteractiveC, "卢克玩家交互", X, Y, 100, 21, 0);
Each.Visible = false;
}
}
}

View File

@ -0,0 +1,192 @@
/*
文件名:Rindro_Luke_PartyMemberInfo.nut
路径:Plugins/New_Luke/Rindro_Luke_PartyMemberInfo.nut
创建日期:2024-07-15 22:52
文件用途:卢克队伍横条
*/
//队员显示类
class Rindro_LukePartyInfoMemberC extends LenheartNewUI_CommonUi {
X = 0;
Y = 0;
Width = null;
Height = null;
InfoObj = null;
//构造时间
ConstructorTime = null;
//选中状态
SelectState = false;
//攻坚状态
OffensiveState = 0;
//头像框的颜色
HandBoxColor = [
0xff717272,
0xff7b2a29,
0xff874e0d,
0xff8b8108,
0xff658e2d,
0xff0f5c8a,
0xff27238f,
0xff4e2491,
0xff932586,
]
//X Y 裁切开始X Y 裁切结束X Y
OffsetArr = [
//男鬼剑士
[56, 112, 220, 222],
//女格斗家
[54, 103, 240, 278],
//男神枪手
[55, 130, 236, 246],
//女魔法师
[57, 88, 234, 291],
//男圣职者
[57, 124, 208, 190],
//女神枪手
[56, 119, 226, 209],
//暗夜使者
[56, 117, 225, 212],
//男格斗家
[56, 118, 233, 212],
//男魔法师
[54, 103, 236, 276],
//黑暗武士
[56, 112, 220, 222],
//缔造者
[57, 88, 234, 291],
]
constructor(gInfoObj) {
ConstructorTime = Clock();
InfoObj = gInfoObj;
this.Width = 458;
this.Height = 21;
this.OnClick = function() {
//还原其他 选中自己
foreach(Obj in Parent.MembersList) {
Obj.SelectState = false;
}
SelectState = !SelectState;
local win = LenheartNewUI_CreateWindow(Rindro_LukePartyFormation, "卢克我的队伍编队窗口", 105, 40, 294, 192, 18);
//编队状态
if (win.PartyMarkFlag != -1) {
//并且是属于我的攻坚队的成员
if (RinDro_Luke_Obj.MyRaidTeamId == InfoObj.PartyId) {
local gnum = win.PartyMarkFlag + 1;
if (gnum == 100) gnum = 0;
local T = {
op = 20084015,
teamsId = InfoObj.PartyId,
cidNew = InfoObj.Cid,
num = gnum
}
SendPackEx(T);
win.PartyMarkFlag = -1;
R_Mouse.SetType(0);
win.ResetFocus();
return;
}
//点了其他队伍成员要还原编队状态
else {
win.PartyMarkFlag = -1;
R_Mouse.SetType(0);
}
}
local Interactive = LenheartNewUI_CreateWindow(Rindro_LukePlayerInteractiveC, "卢克玩家交互", 0, 0, 100, 21, 0);
//改变鼠标坐标
Interactive.X = MousePos_X;
Interactive.Y = MousePos_Y;
//赋值对象参数
Interactive.InfoObj = InfoObj;
//对象不是我
if (InfoObj.Cid == RinDro_Luke_Obj.MyCid) {
Interactive.InfoObj.IsMyself <- true;
}
//刷新UI
Interactive.InitInfo();
}
LenheartNewUI_CommonUi.constructor(10, 82, this.Width, this.Height);
//如果没有材料要建立一个购买材料的Button 并且要判断是否是自己 //TODO 这里还不行 要拓展一个函数来比对名字
/*
local Name = L_Sq_GetObjectName(sq_GetMyMasterCharacter());
local Name2 = "夜刃";
Name == Name2 失败了
*/
// if (!InfoObj.StkHasFlag && InfoObj.Name == L_Sq_GetObjectName(sq_GetMyMasterCharacter())) {
// }
}
function Show(obj) {
// print(this);
//绘制底槽
L_sq_DrawImg("hud/rindroanton.img", 12, X, Y);
//绘制队伍编号
L_sq_DrawImg("interface/newstyle/windows/party/party_icon.img", InfoObj.TeamId * 3, X, Y + 1);
sq_DrawBox(X + 42, Y + 1, 22, 18, HandBoxColor[InfoObj.TeamId]);
//绘制队长头像
foreach(AvatarObj in InfoObj.EquVos) {
local AXpos = AvatarObj.F[0][2] + X + OffsetArr[InfoObj.Job][0];
local AYpos = AvatarObj.F[0][3] + Y + OffsetArr[InfoObj.Job][1];
setClip(AXpos + OffsetArr[InfoObj.Job][2], AYpos + OffsetArr[InfoObj.Job][3], AXpos + OffsetArr[InfoObj.Job][2] + 22, AYpos + OffsetArr[InfoObj.Job][3] + 18); //开始裁切
L_sq_DrawImg("character/" + AvatarObj.B + ".img", AvatarObj.F[0][0], AXpos, AYpos);
releaseClip(); //裁切结束
}
if (InfoObj.Captain) L_sq_DrawImg("hud/rindroanton.img", 18, X + 42, Y + 1);
//绘制等级
L_sq_DrawCode(InfoObj.Level, X + 76 - LenheartTextClass.GetStringLength(InfoObj.Level) / 2, Y + 5, sq_RGBA(134, 120, 79, 255), 0, 1);
//绘制角色名
L_sq_DrawCode(InfoObj.Name, X + 138 - LenheartTextClass.GetStringLength(InfoObj.Name) / 2, Y + 5, sq_RGBA(134, 120, 79, 255), 0, 1);
//绘制职业名
L_sq_DrawCode(InfoObj.JobName, X + 234 - LenheartTextClass.GetStringLength(InfoObj.JobName) / 2, Y + 5, sq_RGBA(134, 120, 79, 255), 0, 1);
//离线了
if (InfoObj.ExitTime > 0) {
local DrawTime = InfoObj.ExitTime - (Clock() - ConstructorTime);
local seconds = (DrawTime / 1000) % 60; // 计算秒数
local minutes = (DrawTime / (1000 * 60)) % 60; // 计算分钟数
local DrawTimeStr = format("%02d分%02d秒", minutes, seconds);
L_sq_DrawCode(DrawTimeStr, X + 306 - LenheartTextClass.GetStringLength(DrawTimeStr) / 2, Y + 5, sq_RGBA(255, 50, 50, 255), 0, 1);
}
//通关次数
else if (InfoObj.ClearanceCount > 0) {
L_sq_DrawCode((InfoObj.ClearanceCount - 1) + "/" + (InfoObj.ClearanceCountMax), X + 306 - LenheartTextClass.GetStringLength((InfoObj.ClearanceCount - 1) + "/" + (InfoObj.ClearanceCountMax)) / 2, Y + 5, sq_RGBA(250, 250, 181, 255), 0, 1);
} else if (InfoObj.StkHasFlag) {
L_sq_DrawImg("hud/rindroantonstk.img", 0, X + 280, Y + 3);
} else {
L_sq_DrawImg("hud/rindroantonstk.img", 1, X + 280, Y + 3);
}
if (SelectState) {
L_sq_DrawImg("hud/rindroanton.img", 13, X, Y);
}
if (isInRect) {
L_sq_DrawImg("hud/rindroanton.img", 13, X, Y);
}
}
MousePos_X = 0;
MousePos_Y = 0;
//鼠标事件回调
function OnMouseProc(Flag, gMousePos_X, gMousePos_Y) {
this.MousePos_X = gMousePos_X;
this.MousePos_Y = gMousePos_Y;
LenheartNewUI_CommonUi.OnMouseProc(Flag, gMousePos_X, gMousePos_Y);
}
}

View File

@ -0,0 +1,227 @@
/*
文件名:Rindro_Luke_PlayerInteractive.nut
路径:Plugins/New_Luke/Rindro_Luke_PlayerInteractive.nut
创建日期:2024-07-16 11:02
文件用途:卢克攻坚队玩家交互按钮
*/
//角色交互按钮需要传递参数所以重写
class Rindro_LukeInteractive_BaseButton extends LenheartNewUI_BaseButton {
OnShow = null;
constructor(X, Y, W, H, Path, Idx) {
LenheartNewUI_BaseButton.constructor(X, Y, W, H, Path, Idx);
}
//鼠标左键弹起回调
function OnMouseLbUp(MousePos_X, MousePos_Y) {
Y--;
if (isLBDown && OnClick) {
OnClick();
}
isLBDown = false;
local Each = LenheartNewUI_CreateWindow(Rindro_LukePlayerInteractiveC, "卢克玩家交互", X, Y, 100, 21, 0);
Each.Visible = false;
}
function Show(obj) {
//不可用
if (State == 8) {
L_sq_DrawImg(Path, Idx + 3, X, Y + 1);
} else {
//按下
if (isLBDown) {
Y++;
L_sq_DrawImg(Path, (Idx * 2) + 2, X, Y);
}
//悬停
else if (isInRect) {
L_sq_DrawImg(Path, (Idx * 2) + 1, X, Y);
}
//普通
else {
L_sq_DrawImg(Path, 0, X, Y);
}
}
if (OnShow) OnShow(X, Y);
}
}
//角色交互类
class Rindro_LukePlayerInteractiveC extends LenheartNewUI_Windows {
// DeBugMode = true;
//信息对象
InfoObj = null;
//初始化Flag 初始化以后才显示
InitInfoFlag = false;
//有多少个标签
InitIndexFlag = 1;
//头像框颜色
HandBoxColor = [
0xff717272,
0xff7b2a29,
0xff874e0d,
0xff8b8108,
0xff658e2d,
0xff0f5c8a,
0xff27238f,
0xff4e2491,
0xff932586,
]
//X Y 裁切开始X Y 裁切结束X Y
OffsetArr = [
//男鬼剑士
[56, 112, 220, 222],
//女格斗家
[54, 103, 240, 278],
//男神枪手
[55, 130, 236, 246],
//女魔法师
[57, 88, 234, 291],
//男圣职者
[57, 124, 208, 190],
//女神枪手
[56, 119, 226, 209],
//暗夜使者
[56, 117, 225, 212],
//男格斗家
[56, 118, 233, 212],
//男魔法师
[54, 103, 236, 276],
//黑暗武士
[56, 112, 220, 222],
//缔造者
[57, 88, 234, 291],
]
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
}
//初始化信息
function InitInfo() {
Childrens = [];
//还原标签数量
InitIndexFlag = 1;
//还原高度
Height = 21;
//还原可见性
Visible = true;
//置顶窗口
ResetFocus();
RegisterWidget();
InitInfoFlag = true;
}
function RegisterWidget() {
//是团长才能委任 并且不是我自己 并且我们在同一个攻坚队
if (RinDro_Luke_Obj.IsCaptain && !("IsMyself" in InfoObj) && RinDro_Luke_Obj.MyRaidTeamId == InfoObj.PartyId) {
//委任团长按钮
local GiveMasterButton = Rindro_LukeInteractive_BaseButton(0, 0 + (InitIndexFlag * 21), 100, 21, "interface2/popup_menu/popup_back.img", 0);
GiveMasterButton.OnShow = function(X, Y) {
L_sq_DrawImg("interface2/popup_menu/popup_icon_character.img", 11, X, Y + 2);
L_sq_DrawCode("委任团长", X + 36, Y + 5, sq_RGBA(104, 213, 237, 255), 0, 1);
}
GiveMasterButton.OnClick = function() {
}.bindenv(this);
AddChild(GiveMasterButton);
InitIndexFlag++;
Height += 21;
}
//查看信息按钮
local CheckInfoButton = Rindro_LukeInteractive_BaseButton(0, 0 + (InitIndexFlag * 21), 100, 21, "interface2/popup_menu/popup_back.img", 0);
CheckInfoButton.OnShow = function(X, Y) {
L_sq_DrawImg("interface2/popup_menu/popup_icon_character.img", 10, X, Y + 2);
L_sq_DrawCode("查看信息", X + 36, Y + 5, sq_RGBA(104, 213, 237, 255), 0, 1);
}
CheckInfoButton.OnClick = function() {
local obj = sq_GetMyMasterCharacter();
//obj.sq_PlaySound("CLICK_BUTTON1");
L_sq_SendPackType(8);
L_sq_SendPackWord(InfoObj.PlayerSession);
L_sq_SendPackByte(3);
L_sq_SendPack();
getroottable().WindowsShowABFlag <- false; //让原生窗口置顶
}.bindenv(this);
AddChild(CheckInfoButton);
InitIndexFlag++;
Height += 21;
if (!("IsMyself" in InfoObj)) {
//交易按钮
local TransactionButton = Rindro_LukeInteractive_BaseButton(0, 0 + (InitIndexFlag * 21), 100, 21, "interface2/popup_menu/popup_back.img", 0);
TransactionButton.OnShow = function(X, Y) {
L_sq_DrawImg("interface2/popup_menu/popup_icon_character.img", 0, X, Y + 2);
L_sq_DrawCode("交易", X + 46, Y + 5, sq_RGBA(104, 213, 237, 255), 0, 1);
}
TransactionButton.OnClick = function() {
local obj = sq_GetMyMasterCharacter();
//obj.sq_PlaySound("CLICK_BUTTON1");
L_sq_SendPackType(10);
L_sq_SendPackWord(InfoObj.PlayerSession);
L_sq_SendPackByte(1);
L_sq_SendPackDWord(22053);
L_sq_SendPack();
getroottable().WindowsShowABFlag <- false; //让原生窗口置顶
}.bindenv(this);
AddChild(TransactionButton);
InitIndexFlag++;
Height += 21;
if (RinDro_Luke_Obj.IsCaptain && RinDro_Luke_Obj.MyRaidTeamId == InfoObj.PartyId) {
//攻坚队员强退按钮
local KickMemberButton = Rindro_LukeInteractive_BaseButton(0, 0 + (InitIndexFlag * 21), 100, 21, "interface2/popup_menu/popup_back.img", 4);
KickMemberButton.OnShow = function(X, Y) {
L_sq_DrawImg("interface2/popup_menu/popup_icon_warning.img", 3, X, Y + 2);
L_sq_DrawCode("攻坚队员强退", X + 24, Y + 5, sq_RGBA(255, 50, 50, 255), 0, 1);
}
KickMemberButton.OnClick = function() {
local obj = sq_GetMyMasterCharacter();
//obj.sq_PlaySound("CLICK_BUTTON1");
local T = {
op = 20084021,
teamsId = InfoObj.PartyId,
charCid = InfoObj.Cid
}
SendPackEx(T);
}.bindenv(this);
AddChild(KickMemberButton);
InitIndexFlag++;
Height += 21;
}
}
}
function Show(obj) {
if (!InitInfoFlag) return;
L_sq_DrawImg("interface2/popup_menu/popup_back.img", 0, X, Y);
//绘制角色名
L_sq_DrawCode(InfoObj.Name, X + 61 - LenheartTextClass.GetStringLength(InfoObj.Name) / 2, Y + 4, sq_RGBA(169, 255, 171, 255), 0, 1);
//绘制头像
foreach(AvatarObj in InfoObj.EquVos) {
local AXpos = AvatarObj.F[0][2] + X + OffsetArr[InfoObj.Job][0] - 40;
local AYpos = AvatarObj.F[0][3] + Y + OffsetArr[InfoObj.Job][1];
setClip(AXpos + OffsetArr[InfoObj.Job][2], AYpos + OffsetArr[InfoObj.Job][3], AXpos + OffsetArr[InfoObj.Job][2] + 22, AYpos + OffsetArr[InfoObj.Job][3] + 18); //开始裁切
L_sq_DrawImg("character/" + AvatarObj.B + ".img", AvatarObj.F[0][0], AXpos, AYpos);
releaseClip(); //裁切结束
}
LenheartNewUI_Windows.Show(obj);
}
function Proc(obj) {
LenheartNewUI_Windows.SyncPos(X, Y);
}
}

View File

@ -0,0 +1,785 @@
/*
文件名:Rindro_Luke_Reward.nut
路径:Plugins/New_Luke/Rindro_Luke_Reward.nut
创建日期:2024-07-29 10:04
文件用途:卢克翻牌奖励
*/
class Rindro_Luke_RewardC extends LenheartNewUI_Windows {
//调试模式
// DeBugMode = true;
NoWindow = true;
//奖励阶段
Stage = 1;
//小队奖励包
PartyReward = null;
//团队奖励包
TeamReward = null;
//死亡次数
Deaths = 0;
//通关时间
Time = 0;
//奖励动画开始时间
AniStartFlag = null;
//紫色闪光
PurpleLight = null;
//粉色闪光
PinkLight = null;
//金色闪光
GoldenLight = null;
//彩色闪光
RarityLight = null;
ItemNameColor = [
0xffffffff, //白装
0xffedd568, //蓝装
0xffff6bb3, //紫装
0xfff000ff, //粉装
0xff0082ff, //传说
0xff00b1ff //史诗
]
//X Y 裁切开始X Y 裁切结束X Y
OffsetArr = [
//男鬼剑士
[56, 112, 220, 222],
//女格斗家
[54, 103, 240, 278],
//男神枪手
[55, 130, 236, 246],
//女魔法师
[57, 88, 234, 291],
//男圣职者
[57, 124, 208, 190],
//女神枪手
[56, 119, 226, 209],
//暗夜使者
[56, 117, 225, 212],
//男格斗家
[56, 118, 233, 212],
//男魔法师
[54, 103, 236, 276],
//黑暗武士
[56, 112, 220, 222],
//缔造者
[57, 88, 234, 291],
]
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
PurpleLight = [];
PinkLight = [];
GoldenLight = [];
RarityLight = [];
Childrens = [];
//注册控件
RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
local PurpleFrameArr = [];
for (local i = 0; i< 11; i++) {
local T = {
ImgIndex = i,
Delay = 60,
Pos = [0, 0]
}
PurpleFrameArr.append(T);
}
for (local i = 0; i< 24; i++) {
local PurpleLightBuf = Lenheart_Ani("", PurpleFrameArr, [0, 0]);
PurpleLightBuf.ImgPath = "common/commoneffect/itemdropeffect/rare_beam.img";
PurpleLightBuf.LoopFlag = false;
PurpleLight.append(PurpleLightBuf);
}
local PinkFrameArr = [];
for (local i = 0; i< 11; i++) {
local T = {
ImgIndex = i,
Delay = 60,
Pos = [0, 0]
}
PinkFrameArr.append(T);
}
for (local i = 0; i< 24; i++) {
local PinkLightBuf = Lenheart_Ani("", PinkFrameArr, [0, 0]);
PinkLightBuf.ImgPath = "common/commoneffect/itemdropeffect/unique_beam.img";
PinkLightBuf.LoopFlag = false;
PinkLight.append(PinkLightBuf);
}
local FrameArr = [];
for (local i = 0; i< 11; i++) {
local T = {
ImgIndex = i,
Delay = 60,
Pos = [0, 0]
}
FrameArr.append(T);
}
for (local i = 0; i< 24; i++) {
local GoldenLightBuf = Lenheart_Ani("anton/lightbar.img", FrameArr, [0, 0]);
GoldenLightBuf.ImgPath = "anton/lightbar.img";
GoldenLightBuf.LoopFlag = false;
GoldenLight.append(GoldenLightBuf);
}
local FrameArr2 = [];
for (local i = 0; i< 11; i++) {
local T = {
ImgIndex = i,
Delay = 60,
Pos = [0, 0]
}
FrameArr2.append(T);
}
for (local i = 0; i< 24; i++) {
local RarityLightBuf = Lenheart_Ani("anton/lightbar.img", FrameArr2, [0, 0]);
RarityLightBuf.ImgPath = "anton/ralightbar.img";
RarityLightBuf.LoopFlag = false;
RarityLight.append(RarityLightBuf);
}
}
function Init(Info) {
Stage = Info.state;
//小队奖励信息
PartyReward = [];
for (local i = 0; i< 4; i++) {
if (Info.rewards.len() > i && Info.rewards[i].item != -1) {
Info.rewards[i].Flag <- true;
PartyReward.append(Info.rewards[i]);
} else {
PartyReward.append({
Flag = false
});
}
}
TeamReward = [];
for (local i = 0; i< 20; i++) {
if (Info.rewards2.len() > i && Info.rewards2[i][0].item != -1) {
Info.rewards2[i][0].Flag <- true;
TeamReward.append(Info.rewards2[i][0]);
} else {
TeamReward.append({
Flag = false
});
}
}
Deaths = Info.deathsNum;
Time = Info.time;
AniName_Flag = Clock();
AniStartFlag = Clock();
InitActStage();
//重置演出Flag
ActFlag = 0;
//重置紫色闪光
foreach(obj in PurpleLight) {
obj.Reset();
}
//重置粉色闪光
foreach(obj in PinkLight) {
obj.Reset();
}
//重置金色闪光
foreach(obj in GoldenLight) {
obj.Reset();
}
//重置彩色闪光
foreach(obj in RarityLight) {
obj.Reset();
}
Visible = true;
ResetFocus();
}
function RegisterWidget() {
}
AniName_Flag = 0;
//演出Flag
ActFlag = 0;
//演出脚本List
ActStageList = null;
//演出脚本时间
ActStageTime = null;
//演出Img
ActStageImg = null;
//演出脚本初始化
function InitActStage() {
ActStageList = [];
ActStageImg = {};
ActStageTime = Clock();
ActStageImg.luke_reward_new <- Rindro_Image("interface2/raid/luke/reward/luke_reward_new.img");
ActStageImg.luke_reward_rank <- Rindro_Image("interface2/raid/luke/reward/luke_reward_rank/luke_reward_rank.img");
ActStageImg.luke_reward_digit <- Rindro_Image("interface2/raid/luke/reward/luke_reward_digit/luke_reward_digit.img");
ActStageImg.anton_reward <- Rindro_Image("interface2/raid/anton/reward/anton_reward.img");
//绘制背景
RegisterActStage(0, 9999999, function(CTime) {
//背景
ActStageImg.luke_reward_new.DrawExPng(10, X + 0, Y + 0, 0, sq_RGBA(255, 255, 255, 250), 1.0 * (getroottable().Rindro_Scr_Width / 800.0), 1.0);
//标题背景
ActStageImg.luke_reward_new.DrawPng(0, X + ((getroottable().Rindro_Scr_Width - 220) / 2), Y + 20);
})
//绘制标题
RegisterActStage(0, 9999999, function(CTime) {
local SX = ((getroottable().Rindro_Scr_Width - 135) / 2) - 43;
local TitleImgIdx = 1;
if (Stage == 2) TitleImgIdx = 7;
local TileMoveTime = 1000;
local TitleXposOffset = sq_GetAccel(0, 50, CTime, TileMoveTime, true);
local TitleAlphaOffset = sq_GetAccel(0, 250, CTime, TileMoveTime * 2, true);
ActStageImg.luke_reward_new.DrawExPng(TitleImgIdx + 1, SX + 50 - TitleXposOffset, Y + 12, 0, sq_RGBA(255, 255, 255, TitleAlphaOffset), 1.0, 1.0);
ActStageImg.luke_reward_new.DrawExPng(TitleImgIdx, SX + 50 - TitleXposOffset, Y + 12, 0, sq_RGBA(255, 255, 255, TitleAlphaOffset), 1.0, 1.0);
}.bindenv(this));
//绘制时间
RegisterActStage(1000, 9999999, function(CTime) {
local SX = ((getroottable().Rindro_Scr_Width - 507) / 2) - 25;
local obj = sq_getMyCharacter();
local TitleAlphaOffset = sq_GetAccel(0, 250, CTime, 1000 * 2, true);
ActStageImg.luke_reward_new.DrawExPng(11, SX, Y + 114, 0, sq_RGBA(255, 255, 255, TitleAlphaOffset), 1.0, 1.0);
ActStageImg.luke_reward_new.DrawExPng(12, SX, Y + 114, 0, sq_RGBA(255, 255, 255, TitleAlphaOffset), 1.0, 1.0);
T_DrawDynamicAni(obj, "common/luke/newre/reward_time_01.ani", SX + 500, Y + 147, "luke_reward_TimeLunAni" + ActStageTime);
local Yoffset = 136;
local al = sq_GetUniformVelocity(0, 100, CTime, 800);
local AlphaValue = al.tofloat() / 100.0;
local DrawTime = Time;
if (al< 100) {
DrawTime = (Time - 500) + ((500 * AlphaValue).tointeger());
}
local seconds = DrawTime / 10;
local hours = seconds / 3600;
local minutes = seconds / 60;
seconds %= 60;
hours = format("%02d", hours);
seconds = format("%02d", seconds).slice(-2);
minutes = format("%02d", minutes).slice(-2);
local Offset = 153;
ActStageImg.luke_reward_digit.DrawExPng(hours.slice(0, 1).tointeger(), SX - 280 + 240 + Offset, Y + Yoffset, 0, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
ActStageImg.luke_reward_digit.DrawExPng(hours.slice(1).tointeger(), SX - 280 + 255 + Offset, Y + Yoffset, 0, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
ActStageImg.luke_reward_digit.DrawExPng(11, SX - 280 + 276 + Offset, Y + Yoffset - 1, 0, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
Offset += 60;
ActStageImg.luke_reward_digit.DrawExPng(minutes.slice(0, 1).tointeger(), SX - 280 + 240 + Offset, Y + Yoffset, 0, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
ActStageImg.luke_reward_digit.DrawExPng(minutes.slice(1).tointeger(), SX - 280 + 255 + Offset, Y + Yoffset, 0, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
ActStageImg.luke_reward_digit.DrawExPng(12, SX - 280 + 286 + Offset, Y + Yoffset - 1, 0, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
Offset += 210;
local DrawDieStr = format("%02d", Deaths);
ActStageImg.luke_reward_digit.DrawExPng(DrawDieStr.slice(0, 1).tointeger(), SX - 280 + 240 + Offset, Y + Yoffset, 0, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
ActStageImg.luke_reward_digit.DrawExPng(DrawDieStr.slice(1).tointeger(), SX - 280 + 260 + Offset, Y + Yoffset, 0, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
ActStageImg.luke_reward_rank.DrawExPng(0, SX + 454, Y + 114, 0, sq_RGBA(255, 255, 255, TitleAlphaOffset), 1.0, 1.0);
}.bindenv(this))
//绘制小队分牌
RegisterActStage(2000, 3000, function(CTime) {
local SX = ((getroottable().Rindro_Scr_Width) / 2);
local obj = sq_getMyCharacter();
T_DrawDynamicAni(obj, "common/luke/newre/cardspread_000.ani", SX - 406, Y + 56, "cardspread_000" + ActStageTime);
}.bindenv(this));
// 绘制小队翻牌
RegisterActStage(3000, 7000, function(CTime) {
if (Stage == 1 && CTime >= 3000) ActStageTime = null;
local SX = ((getroottable().Rindro_Scr_Width) / 2);
local obj = sq_getMyCharacter();
local CradAlphaOffset = sq_GetAccel(0, 250, CTime, 400, true);
local OpenRealXrate = sq_GetAccel(0, 100, CTime, 400, true);
for (local i = 0; i< 4; i++) {
local CardInfo = PartyReward[i];
local Path = "common/luke/newre/reward_card_open1_00.ani";
if (CardInfo.Flag == false) {
Path = "common/luke/newre/reward_card_open2_00.ani";
}
local Ani = T_DrawDynamicAni(obj, Path, SX - 406 + 30 + (189 * i), Y + 56 + 225, Path + "2jd" + ActStageTime);
if (CardInfo.Flag == false) continue;
GetItemInfo(CardInfo.item);
local Rarity = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0xF4);
local NamePointer = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0x20);
local Name = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString();
ActStageImg.anton_reward.DrawExPng(5 + Rarity, SX - 311 + (189 * i), Y + 346, 0, sq_RGBA(255, 255, 255, CradAlphaOffset), OpenRealXrate / 100.0, 1.0);
//绘制物品
if (sq_GetCurrentTime(Ani) >= 350) {
DrawItemBase(SX - 308 + (189 * i), Y + 348, CardInfo.item, CardInfo.num);
L_sq_DrawCode(Name, SX - 293 + (189 * i) - LenheartTextClass.GetStringLength(Name) / 2, Y + 381, ItemNameColor[Rarity], 0, 1);
}
//物品出现光
if (!CardInfo.grade) {
if (Rarity <= 2) { //低于紫色闪紫光
PurpleLight[20 + i].X = SX - 378 + (160 * i) - 218 + 54;
PurpleLight[20 + i].Y = Y + 285 - 152 - 24 - 7;
L_sq_SetDrawImgModel(2, 0);
PurpleLight[20 + i].Show(Duration);
L_sq_ReleaseDrawImgModel();
} else if (Rarity == 3) { //粉光
PinkLight[20 + i].X = SX - 378 + (160 * i) - 218 + 54;
PinkLight[20 + i].Y = Y + 285 - 152 - 24 - 7;
L_sq_SetDrawImgModel(2, 0);
PinkLight[20 + i].Show(Duration);
L_sq_ReleaseDrawImgModel();
} else if (Rarity == 4) { //金光
GoldenLight[20 + i].X = SX - 378 + (160 * i) - 218;
GoldenLight[20 + i].Y = Y + 285 - 152 - 7;
GoldenLight[20 + i].Show(Duration);
}
} else { //彩光
RarityLight[20 + i].X = SX - 378 + (160 * i) - 218;
RarityLight[20 + i].Y = Y + 285 - 152 - 7;
RarityLight[20 + i].Show(Duration);
}
if (CardInfo.Flag) {
DrawProfile(CardInfo.cid, SX - 378 + (160 * i) - 218 + 313, Y + 285 - 152 - 7 + 180, 0);
}
}
}.bindenv(this));
//如果是二阶段
if (Stage == 2) {
//绘制团队分牌
RegisterActStage(7000, 8000, function(CTime) {
local SX = ((getroottable().Rindro_Scr_Width) / 2);
local obj = sq_getMyCharacter();
T_DrawDynamicAni(obj, "common/luke/newre/cardspread_00.ani", SX - 406, Y - 12, "cardspread_00" + ActStageTime);
}.bindenv(this));
//绘制小队翻牌
RegisterActStage(8000, 12000, function(CTime) {
if (Stage == 2 && CTime >= 3500) ActStageTime = null;
local SX = ((getroottable().Rindro_Scr_Width) / 2);
local obj = sq_getMyCharacter();
local CradAlphaOffset = sq_GetAccel(0, 250, CTime, 400, true);
local OpenRealXrate = sq_GetAccel(0, 100, CTime, 400, true);
for (local i = 0; i< 8; i++) {
local CardInfo = TeamReward[i];
local Path = "common/luke/newre/reward_card_open1_00.ani";
if (CardInfo.Flag == false) {
Path = "common/luke/newre/reward_card_open2_00.ani";
}
local Ani = T_DrawDynamicAni(obj, Path, SX - 406 + 30 + (189 * (i % 4)), Y - 12 + 225 + ((i / 4) * 185), Path + ActStageTime);
if (CardInfo.Flag == false) continue;
GetItemInfo(CardInfo.item);
local Rarity = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0xF4);
local NamePointer = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0x20);
local Name = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString();
ActStageImg.anton_reward.DrawExPng(5 + Rarity, SX - 406 + 30 + (189 * (i % 4)) + 65, Y - 12 + 225 + ((i / 4) * 185) + 65, 0, sq_RGBA(255, 255, 255, CradAlphaOffset), OpenRealXrate / 100.0, 1.0);
//绘制物品
if (sq_GetCurrentTime(Ani) >= 350) {
DrawItemBase(SX - 406 + 30 + (189 * (i % 4)) + 68, Y - 12 + 225 + ((i / 4) * 185) + 69, CardInfo.item, CardInfo.num);
L_sq_DrawCode(Name, SX - 406 + (189 * (i % 4)) + 112 - LenheartTextClass.GetStringLength(Name) / 2, Y - 12 + 225 + ((i / 4) * 185) + 104, ItemNameColor[Rarity], 0, 1);
}
//物品出现光
if (!CardInfo.grade) {
if (Rarity <= 2) { //低于紫色闪紫光
PurpleLight[20 + i].X = SX - 540 + (189 * (i % 4));
PurpleLight[20 + i].Y = Y - 12 + ((i / 4) * 185) + 45;
L_sq_SetDrawImgModel(2, 0);
PurpleLight[20 + i].Show(Duration);
L_sq_ReleaseDrawImgModel();
} else if (Rarity == 3) { //粉光
PinkLight[20 + i].X = SX - 540 + (189 * (i % 4));
PinkLight[20 + i].Y = Y - 12 + ((i / 4) * 185) + 45;
L_sq_SetDrawImgModel(2, 0);
PinkLight[20 + i].Show(Duration);
L_sq_ReleaseDrawImgModel();
} else if (Rarity == 4) { //金光
GoldenLight[20 + i].X = SX - 540 + (189 * (i % 4)) - 58;
GoldenLight[20 + i].Y = Y - 12 + 74 + ((i / 4) * 185);
GoldenLight[20 + i].Show(Duration);
}
} else { //彩光
RarityLight[20 + i].X = SX - 598 + (189 * (i % 4));
RarityLight[20 + i].Y = Y - 12 + 74 + ((i / 4) * 185);
RarityLight[20 + i].Show(Duration);
}
if (CardInfo.Flag) {
DrawProfile(CardInfo.cid, SX + (189 * (i % 4)) - 283, Y - 12 + 74 + 176 + ((i / 4) * 185), 0);
}
}
}.bindenv(this));
}
}
//演出脚本注册
function RegisterActStage(StartTime, EndTime, Func) {
local ActObject = {};
ActObject.StartTime <- StartTime;
ActObject.EndTime <- EndTime;
ActObject.Func <- Func;
ActStageList.append(ActObject);
}
//演出脚本执行
function RunActStage() {
if (!ActStageTime) return;
//当前演出时间
local C_Time = Clock() - ActStageTime;
foreach(ActObject in ActStageList) {
local ActStartTime = ActObject.StartTime;
local ActEndTime = ActObject.EndTime;
local ActFunc = ActObject.Func;
//如果演出时间在演出时间内
if (C_Time >= ActStartTime && C_Time <= ActEndTime) {
//传入的相对时间
ActFunc(C_Time - ActStartTime);
}
}
}
//绘制主界面
function DrawMain(obj) {
RunActStage();
return;
//如果初始化完成
if (AniStartFlag) {
local ExiTime = Clock() - AniStartFlag;
//已经过时间
local FlagTime = 0;
//绘制背景
L_sq_DrawImg("interface2/raid/luke/reward/luke_reward_new.img", 10, X + 0, Y + 0, 1, sq_RGBA(255, 255, 255, 250), 1.0, 1.0);
//绘制标题
local TitleImgIdx = 14;
if (Stage == 2) TitleImgIdx = 15;
local TileMoveTime = 350;
local TitleXposOffset = sq_GetAccel(0, 230, ExiTime, TileMoveTime, true);
local TitleAlphaOffset = sq_GetAccel(0, 100, ExiTime, TileMoveTime, true);
L_sq_DrawImg("interface2/raid/luke/reward/luke_reward.img", TitleImgIdx, X + TitleXposOffset - 50, Y + 40, 1, sq_RGBA(255, 255, 255, 150 + TitleAlphaOffset), 1.0, 1.0);
if (TitleXposOffset >= 230 && ActFlag == 0) {
ActFlag = 1;
}
FlagTime += TileMoveTime;
//绘制成功标志
if (ActFlag >= 1) {
//绘制成功
local SuccessMoveTime = 350;
local SuccessXposOffset = sq_GetAccel(150, 440, ExiTime - FlagTime, SuccessMoveTime, true);
local SuccessAlphaOffset = sq_GetAccel(0, 100, ExiTime - FlagTime, SuccessMoveTime, true);
L_sq_DrawImg("interface2/raid/luke/reward/luke_reward.img", 16, X + SuccessXposOffset - 70, Y + 26, 1, sq_RGBA(255, 255, 255, 150 + SuccessAlphaOffset), 1.0, 1.0);
if (SuccessXposOffset >= 440 && ActFlag == 1) {
ActFlag = 2;
}
FlagTime += SuccessMoveTime;
}
//绘制时间底槽
if (ActFlag >= 2) {
local TimeSlotMoveTime = 350;
local TimeSlotXposOffset = sq_GetAccel(280, 120, ExiTime - FlagTime, TimeSlotMoveTime, true);
local TimeSlotAlphaOffset = sq_GetAccel(0, 100, ExiTime - FlagTime, TimeSlotMoveTime, true);
L_sq_DrawImg("hud/newantondungeonreward.img", 3, X + TimeSlotXposOffset, Y + 100, 1, sq_RGBA(255, 255, 255, 150 + TimeSlotAlphaOffset), 1.0, 1.0);
if (TimeSlotXposOffset <= 120 && ActFlag == 2) {
ActFlag = 3;
FlagTime += TimeSlotMoveTime;
}
}
//绘制通关时间
if (ActFlag >= 3) {
local Yoffset = 114;
local al = sq_GetUniformVelocity(0, 100, ExiTime - FlagTime, 800);
local AlphaValue = al.tofloat() / 100.0;
local DrawTime = Time;
if (al< 100) {
DrawTime = (Time - 500) + ((500 * AlphaValue).tointeger());
}
local seconds = DrawTime / 10;
local hours = seconds / 3600;
local minutes = seconds / 60;
seconds %= 60;
hours = format("%02d", hours);
seconds = format("%02d", seconds).slice(-2);
minutes = format("%02d", minutes).slice(-2);
local Offset = -6;
L_sq_DrawImg("hud/newantonrewardtime.img", hours.slice(0, 1).tointeger(), X + 240 + Offset, Y + Yoffset, 1, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
L_sq_DrawImg("hud/newantonrewardtime.img", hours.slice(1).tointeger(), X + 260 + Offset, Y + Yoffset, 1, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
L_sq_DrawImg("hud/newantonrewardtime.img", 10, X + 286 + Offset, Y + Yoffset, 1, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
Offset += 60;
L_sq_DrawImg("hud/newantonrewardtime.img", minutes.slice(0, 1).tointeger(), X + 240 + Offset, Y + Yoffset, 1, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
L_sq_DrawImg("hud/newantonrewardtime.img", minutes.slice(1).tointeger(), X + 260 + Offset, Y + Yoffset, 1, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
L_sq_DrawImg("hud/newantonrewardtime.img", 10, X + 286 + Offset, Y + Yoffset, 1, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
Offset += 60;
L_sq_DrawImg("hud/newantonrewardtime.img", seconds.slice(0, 1).tointeger(), X + 240 + Offset, Y + Yoffset, 1, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
L_sq_DrawImg("hud/newantonrewardtime.img", seconds.slice(1).tointeger(), X + 260 + Offset, Y + Yoffset, 1, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
Offset += 160;
local DrawDieStr = format("%02d", Deaths);
L_sq_DrawImg("hud/newantonrewardtime.img", DrawDieStr.slice(0, 1).tointeger(), X + 240 + Offset, Y + Yoffset, 1, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
L_sq_DrawImg("hud/newantonrewardtime.img", DrawDieStr.slice(1).tointeger(), X + 260 + Offset, Y + Yoffset, 1, sq_RGBA(255, 255, 255, (250.0 * AlphaValue).tointeger()), 1.0, 1.0);
if (al >= 100) {
if (ActFlag == 3) {
ActFlag = 4;
FlagTime += 800;
}
}
}
//绘制评分
if (ActFlag >= 4) {
local Ani = T_DrawDynamicAni(obj, "common/anton/reward/reward_rank_00.ani", X + 570, Y + 76, "卢克评分" + AniName_Flag);
if (sq_IsEnd(Ani)) {
if (ActFlag == 4) {
ActFlag = 5;
FlagTime += 1900;
}
}
}
//绘制卡牌
if (ActFlag >= 5 && ActFlag< 7) {
local CardOpenFlag = false;
local CradMoveTime = 1500;
local CradAlphaOffset = sq_GetAccel(0, 250, ExiTime - FlagTime, CradMoveTime, true);
FlagTime += 1500;
local CradReduceTime = 300;
local CradXrate = sq_GetAccel(100, 2, ExiTime - FlagTime, CradReduceTime, true);
local RealXrate = CradXrate.tofloat() / 100.0;
FlagTime += 300;
local OpenCradReduceTime = 300;
local OpenCradXrate = sq_GetAccel(2, 100, ExiTime - FlagTime, CradReduceTime, true);
local OpenRealXrate = OpenCradXrate.tofloat() / 100.0;
FlagTime += 300;
//如果时间来到了打开就转换
if (OpenCradXrate > 2) CardOpenFlag = true;
//卢克标题
// L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 28, X + 124, Y + 180, 1, sq_RGBA(255, 255, 255, CradAlphaOffset), 1.0, 1.0);
for (local i = 0; i< 4; i++) {
local CardInfo = PartyReward[i];
local BackGroundAniIndex = 11;
//卡牌背面
if (!CardOpenFlag) { //空的卡牌奖励
L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 26, X + 94 + (160 * i), Y + 340, 1, sq_RGBA(255, 255, 255, CradAlphaOffset), RealXrate, 1.0);
} else {
//无奖励
if (CardInfo.Flag == false) {
L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 34, X + 94 + (160 * i), Y + 340, 1, sq_RGBA(255, 255, 255, CradAlphaOffset), OpenRealXrate, 1.0);
} else {
if (CardInfo.grade) {
L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 32, X + 94 + (160 * i), Y + 340, 1, sq_RGBA(255, 255, 255, CradAlphaOffset), OpenRealXrate, 1.0);
} else {
L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 31, X + 94 + (160 * i), Y + 340, 1, sq_RGBA(255, 255, 255, CradAlphaOffset), OpenRealXrate, 1.0);
}
//绘制物品边框
if (OpenRealXrate >= 0.6) {
GetItemInfo(CardInfo.item);
local Rarity = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0xF4);
local NamePointer = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0x20);
local Name = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString();
L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 5 + Rarity, X + 156 + (160 * i), Y + 378, 1, sq_RGBA(255, 255, 255, CradAlphaOffset), OpenRealXrate, 1.0);
//绘制物品
if (OpenRealXrate >= 1.0 && i == 3) {
DrawItemBase(X + 159 + (160 * i), Y + 380, CardInfo.item, CardInfo.num);
L_sq_DrawCode(Name, X + 174 + (160 * i) - LenheartTextClass.GetStringLength(Name) / 2, Y + 416, ItemNameColor[Rarity], 0, 1);
// if (ActFlag == 5) {
// ActFlag = 6;
// }
}
//物品出现光
if (!CardInfo.grade) {
if (Rarity <= 2) { //低于紫色闪紫光
PurpleLight[20 + i].X = X + 90 + (160 * i) - 218 + 54;
PurpleLight[20 + i].Y = Y + 320 - 152 - 24 - 7;
L_sq_SetDrawImgModel(2, 0);
PurpleLight[20 + i].Show(Duration);
L_sq_ReleaseDrawImgModel();
} else if (Rarity == 3) { //粉光
PinkLight[20 + i].X = X + 90 + (160 * i) - 218 + 54;
PinkLight[20 + i].Y = Y + 320 - 152 - 24 - 7;
L_sq_SetDrawImgModel(2, 0);
PinkLight[20 + i].Show(Duration);
L_sq_ReleaseDrawImgModel();
} else if (Rarity == 4) { //金光
GoldenLight[20 + i].X = X + 90 + (160 * i) - 218;
GoldenLight[20 + i].Y = Y + 320 - 152 - 7;
GoldenLight[20 + i].Show(Duration);
}
} else { //彩光
RarityLight[20 + i].X = X + 90 + (160 * i) - 218;
RarityLight[20 + i].Y = Y + 320 - 152 - 7;
RarityLight[20 + i].Show(Duration);
}
}
}
if (OpenRealXrate >= 1.0 && i == 3) {
if (ActFlag == 5) {
ActFlag = 6;
}
}
}
//绘制头像与名字
if (ActFlag >= 6) {
if (CardInfo.Flag) {
DrawProfile(CardInfo.cid, X + 174 + (160 * i), Y + 356, 0);
}
if (ExiTime - FlagTime >= 2000) {
if (ActFlag == 6) {
FlagTime += 2000;
ActFlag = 7;
}
}
}
}
} else {
FlagTime += 4100;
}
//渐渐淡出2阶段
if (ActFlag >= 7) {
local CradMoveTime = 1500;
local CradAlphaOffset = sq_GetAccel(0, 250, ExiTime - FlagTime, CradMoveTime, true);
FlagTime += 1500;
for (local i = 0; i< 20; i++) {
//奖励对象
local CardInfo = TeamReward[i];
if (CardInfo.Flag == false) {
L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 19, X + 89 + (128 * (i % 5)), Y + 220 + (80 * (i / 5)), 1, sq_RGBA(255, 255, 255, CradAlphaOffset), 1.0, 1.0);
} else {
//领取过奖励了
if (CardInfo.item == -1) {
L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 24, X + 89 + (128 * (i % 5)), Y + 220 + (80 * (i / 5)), 1, sq_RGBA(255, 255, 255, CradAlphaOffset), 1.0, 1.0);
} else {
L_sq_DrawImg("hud/newantondungeonreward.img", 22, X + 89 + (128 * (i % 5)), Y + 220 + (80 * (i / 5)), 1, sq_RGBA(255, 255, 255, CradAlphaOffset), 1.0, 1.0);
if (CradAlphaOffset >= 200) DrawItemEx(X + 133 + (128 * (i % 5)), Y + 252 + (80 * (i / 5)), CardInfo.item, CardInfo.num);
}
if (CradAlphaOffset >= 200)
DrawProfile(CardInfo.cid, X + 160 + (128 * (i % 5)), Y + 229 + (80 * (i / 5)), -6);
}
}
if (CradAlphaOffset >= 200) {
for (local i = 0; i< 20; i++) {
//奖励对象
local CardInfo = TeamReward[i];
if (CardInfo.Flag && CardInfo.item != -1) {
GetItemInfo(CardInfo.item);
local Rarity = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0xF4);
//物品出现光
if (!CardInfo.grade) {
if (Rarity <= 2) { //低于紫色闪紫光
PurpleLight[i].X = X + 133 + (128 * (i % 5)) - 230;
PurpleLight[i].Y = Y + 252 + (80 * (i / 5)) - 246;
L_sq_SetDrawImgModel(2, 0);
PurpleLight[i].Show(Duration);
L_sq_ReleaseDrawImgModel();
} else if (Rarity == 3) { //粉光
PinkLight[i].X = X + 133 + (128 * (i % 5)) - 230;
PinkLight[i].Y = Y + 252 + (80 * (i / 5)) - 246;
L_sq_SetDrawImgModel(2, 0);
PinkLight[i].Show(Duration);
L_sq_ReleaseDrawImgModel();
} else if (Rarity == 4) { //金光
GoldenLight[i].X = X + 133 + (128 * (i % 5)) - 284;
GoldenLight[i].Y = Y + 252 + (80 * (i / 5)) - 220;
GoldenLight[i].Show(Duration);
}
} else { //彩光
RarityLight[i].X = X + 133 + (128 * (i % 5)) - 284;
RarityLight[i].Y = Y + 252 + (80 * (i / 5)) - 220;
RarityLight[i].Show(Duration);
}
}
}
}
if (CradAlphaOffset >= 250 && (ExiTime - FlagTime >= 3000)) {
if (ActFlag == 7) {
FlagTime += 3000;
ActFlag = 8;
CloseWindow();
}
}
}
}
}
function DrawProfile(Cid, gx, gy, CodeXOffset) {
if (RinDro_Luke_Obj.Portrait.rawin(Cid)) {
local InfoObj = RinDro_Luke_Obj.Portrait[Cid];
//绘制队长头像
foreach(AvatarObj in InfoObj.EquVos) {
local AXpos = AvatarObj.F[0][2] + X + OffsetArr[InfoObj.Job][0] + gx - 110;
local AYpos = AvatarObj.F[0][3] + Y + OffsetArr[InfoObj.Job][1] + gy - 5;
setClip(AXpos + OffsetArr[InfoObj.Job][2], AYpos + OffsetArr[InfoObj.Job][3], AXpos + OffsetArr[InfoObj.Job][2] + 22, AYpos + OffsetArr[InfoObj.Job][3] + 18); //开始裁切
L_sq_DrawImg("character/" + AvatarObj.B + ".img", AvatarObj.F[0][0], AXpos, AYpos);
releaseClip(); //裁切结束
}
L_sq_DrawCode(InfoObj.Name, gx + CodeXOffset - LenheartTextClass.GetStringLength(InfoObj.Name) / 2, gy, 0xff00b1ff, 0, 1);
} else {
L_sq_DrawImg("interface/lenheartwindowcommon.img", 606, gx - 65, gy - 2);
L_sq_DrawCode("未知姓名玩家", gx - LenheartTextClass.GetStringLength("未知姓名玩家") / 2, gy, 0xff00b1ff, 0, 1);
}
}
function Show(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
//逻辑入口
function Proc(obj) {
LenheartNewUI_Windows.SyncPos(X, Y);
}
}
getroottable().rawdelete("RinDro_Luke_Obj");

View File

@ -8,6 +8,9 @@
dofile("sqr/Project/MarrySystem/MarrySystem_Request.nut");
dofile("sqr/Project/MarrySystem/MarrySystem_Response.nut");
dofile("sqr/Project/MarrySystem/MarrySystem_Preparation.nut");
dofile("sqr/Project/MarrySystem/MarrySystem_OpenAuditoriumList.nut");
dofile("sqr/Project/MarrySystem/MarrySystem_ActionAni.nut");
dofile("sqr/Project/MarrySystem/MarrySystem_Room.nut");
class MarrySystemC extends Rindro_BaseToolClass {
//调试模式
@ -21,6 +24,8 @@ class MarrySystemC extends Rindro_BaseToolClass {
//包头
OP = 20078000;
//配置
Config = null;
//结婚状态
MarryState = 0;
@ -31,9 +36,31 @@ class MarrySystemC extends Rindro_BaseToolClass {
ResponseWindow = null;
//准备婚礼窗口
PreparationWindow = null;
//礼堂列表窗口
OpenAuditoriumList = null;
//婚礼演出脚本对象
MarriageScript = null;
//我的结婚时间
MyMarryTime = null;
MyMarryTimeFlag = null;
//婚房逻辑
MarrySystemRoomObject = null;
//请求配置
function GetConfig() {
SendPackEx({
op = OP + 777
});
}
function GetConfigCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
Config = {};
Config.Town <- Jso.town;
Config.Area <- Jso.area;
}
//查看自己是否有结婚
@ -68,20 +95,48 @@ class MarrySystemC extends Rindro_BaseToolClass {
PreparationWindow.ResetFocus();
}
constructor() {
//打开礼堂列表窗口
function OpenAuditoriumListWindowCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
OpenAuditoriumList.List = Jso.info;
OpenAuditoriumList.Visible = true;
OpenAuditoriumList.ResetFocus();
}
//进入礼堂信息包
function OnEnterAuditoriumInfoCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
MyMarryTime = Jso.time;
MyMarryTimeFlag = Clock();
}
//结婚动画包
function ActionCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
MarriageScript.Init(Jso.info);
}
constructor() {
RequestWindow = MarrySystem_RequestC("结婚系统_申请订婚窗口", ((getroottable().Rindro_Scr_Width - 329) / 2).tointeger(), 180, 329, 166, 16);
ResponseWindow = MarrySystem_ResponseC("结婚系统_订婚答复窗口", ((getroottable().Rindro_Scr_Width - 329) / 2).tointeger(), 180, 329, 166, 16);
PreparationWindow = MarrySystem_PreparationC("结婚系统_准备婚礼窗口", ((getroottable().Rindro_Scr_Width - 256) / 2).tointeger(), 100, 260, 374, 28);
OpenAuditoriumList = MarrySystem_OpenAuditoriumListC("结婚系统_礼堂列表窗口", ((getroottable().Rindro_Scr_Width - 474) / 2).tointeger(), 100, 474, 354, 28);
MarriageScript = MarrySystem_ActionAniC();
MarrySystemRoomObject = MarrySystem_Room();
OnSetCharacter_Control.MarrySystem <- OnSetCharacter.bindenv(this);
Pack_Control.rawset(OP + 10, CheckMarryStateCallBack.bindenv(this));
Pack_Control.rawset(OP + 4, RequestMarryCallBack.bindenv(this));
Pack_Control.rawset(OP + 12, OpenPreparationWindowCallBack.bindenv(this));
Pack_Control.rawset(OP + 20, OpenAuditoriumListWindowCallBack.bindenv(this));
Pack_Control.rawset(OP + 22, OnEnterAuditoriumInfoCallBack.bindenv(this));
Pack_Control.rawset(OP + 34, ActionCallBack.bindenv(this));
Pack_Control.rawset(OP + 778, GetConfigCallBack.bindenv(this));
GetConfig();
CheckMarryState();
}
@ -195,6 +250,25 @@ class MarrySystemC extends Rindro_BaseToolClass {
SThis.AddChild(ApplyEngagementButton);
}.bindenv(this));
}
//无论如何都添加礼堂列表
EachManager.AddEachForNpc(20013, 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 = 23;
ApplyEngagementButton.Str = "礼堂列表";
ApplyEngagementButton.OnClick = function(Button) {
Button.Parent.CloseAllEach();
Button.Parent.CloseWindow();
local T = {
op = OP + 19,
}
SendPackEx(T);
}.bindenv(this);
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
SThis.AddChild(ApplyEngagementButton);
}.bindenv(this));
}
//重选角色回调
@ -202,14 +276,100 @@ class MarrySystemC extends Rindro_BaseToolClass {
CheckMarryState();
}
//逻辑入口
function Proc(obj) {
// print(getroottable().Camera_Pos);
//判断在礼堂房间
if (Config && L_sq_GetTownIndex() == Config.Town && L_sq_GetRegionIndex() == Config.Area) {
if (MyMarryTimeFlag && MyMarryTime) {
L_sq_DrawImg("map/church/chn_church_count_number.img", 0, 720 - getroottable().Camera_Pos.X, 72 - getroottable().Camera_Pos.Y);
DrawMarryTime(obj, MyMarryTime - ((Clock() / 1000) - (MyMarryTimeFlag / 1000)));
}
}
MarriageScript.Show(obj);
}
TimeFlag = Clock();
//攻坚时间
function DrawMarryTime(obj, RealTime) {
local X = 720 - getroottable().Camera_Pos.X;
local Y = 114 - getroottable().Camera_Pos.Y;
local seconds = RealTime;
local minutes = seconds / 60;
seconds %= 60;
if (seconds< 0 && minutes< 0) return;
seconds = format("%02d", seconds).slice(-2);
minutes = format("%02d", minutes).slice(-2);
local X1 = -15;
local X2 = X1 + 18;
local Offset = 0;
Offset += 46;
L_sq_DrawImg("map/church/chn_church_count_number.img", minutes.slice(0, 1).tointeger() + 1, X + X1 + Offset, Y + 28);
L_sq_DrawImg("map/church/chn_church_count_number.img", minutes.slice(1).tointeger() + 1, X + X2 + Offset, Y + 28);
Offset += 46;
L_sq_DrawImg("map/church/chn_church_count_number.img", seconds.slice(0, 1).tointeger() + 1, X + X1 + Offset, Y + 28);
L_sq_DrawImg("map/church/chn_church_count_number.img", seconds.slice(1).tointeger() + 1, X + X2 + Offset, Y + 28);
}
}
getroottable().rawdelete("MarrySystem_Obj");
// local ReadPath = L_sq_P2I(Memory.allocUtf8String("equipment/equipment.lst").C_Object);
// local Reader = Memory.alloc(409600);
// local ReadBuffer = L_sq_P2I(Reader.C_Object);
// print(format("%02x", ReadBuffer));
// L_Sq_CallFunc(0x11A2030, "int", FFI_FASTCALL, ["int", "int", "int", "int", "int", "int"], 0x1D17638, 0, ReadPath, ReadBuffer, 0x100000, 0x19DAF4);
// L_Sq_CallFunc(0x112A9F0, "int", FFI_THISCALL, ["int", "int", "int", "int","int", "int", "int"], L_sq_RA(0x1A5FAE4), AniPath, pATH2, 1,0,0,0);
// local ItemObject = L_sq_GetItem(601500069);
// print(format("%02x", ItemObject));
// local ThisC = L_Sq_CallFunc(0x11A5990, "int", FFI_THISCALL, ["int"], 508);
// print(format("%02x", ThisC));
// local AniPath = L_sq_P2I(Memory.allocUtf8String("character/swordman/animation/attack1.ani").C_Object);
//TTTAni <- L_Sq_CallFunc(0x108F8B0, "int", FFI_THISCALL, ["int", "int", "int", "int"], ThisC, AniPath, 1, 0);
// local AniPath = L_sq_P2I(Memory.allocUtf8String("character/swordman/animation/attack1.ani").C_Object);
// TTTAni <- L_Sq_CallFunc(0x112A9F0, "int", FFI_THISCALL, ["int", "int", "int", "int", "int", "int", "int"], 0x19dc64, AniPath, 1695745, 1, 0, 0, 0);
// Rindro_Haker.LoadHook(0x65de50, ["int", "int"],
// function(args) {
// // print(format("%02x", args[0]));
// // local AniPath = NativePointer(L_sq_I2P(args[0])).readUnicodeString();
// print(format("%02x", args[0]));
// // print(args[2]);
// return null;
// },
// function(args) {
// // print(666);
// // print(format("%02x", args.pop()));
// // TTTAni <- args.pop();
// return null;
// });
// local ItemObject = R_Utils.GetEquPath(601500069);
// print(NativePointer(L_sq_I2P(ItemObject)).readUnicodeString());
function Lenheart_MarrySystem_Fun(obj) {
local RootTab = getroottable();
if (!RootTab.rawin("MarrySystem_Obj")) {
@ -217,11 +377,17 @@ function Lenheart_MarrySystem_Fun(obj) {
} else {
RootTab["MarrySystem_Obj"].Proc(obj);
}
// if (TTTAni) {
// print(format("%02x", TTTAni));
// L_Sq_CallFunc(0x1091890, "char", FFI_THISCALL, ["int"], TTTAni);
// L_Sq_CallFunc(0x108B770, "int", FFI_THISCALL, ["int", "int", "int", "int", "int", "int"], TTTAni, L_sq_RA(0x1B45B94), 200, 200, 0, 0);
// }
}
getroottable()["LenheartFuncTab"].rawset("MarrySystemFuncN", Lenheart_MarrySystem_Fun);
// local asos = R_Utils.GetCharacByEqu(0, 0, [601550071, 601560067, 601570062, 601520061, 601500069, 601510068, 601530060, 601540069, 601580026, 101010035]);
// local asos = sq_CreateAICharacter(900);

View File

@ -0,0 +1,320 @@
/*
文件名:MarrySystem_ActionAni.nut
路径:Project/MarrySystem/MarrySystem_ActionAni.nut
创建日期:2024-10-07 19:12
文件用途:
*/
class MarrySystem_ActionAniC extends Rindro_BaseToolClass {
//调试模式
// DeBugMode = true;
//不是窗口
// NoWindow = true;
//是否可见
// Visible = false;
Flag = false;
//演出时间
ActTimer = null;
//幕布
Canvas = false;
//新郎
Groom = null;
//新娘
Bride = null;
//观众
Visitors = null;
FireworkPath = ["common/firework/chn_heart_firework_blue_dodge.ani",
"common/firework/chn_heart_firework_blue_normal.ani",
"common/firework/chn_heart_firework_pink_dodge_01.ani",
"common/firework/chn_heart_firework_pink_dodge.ani",
"common/firework/chn_heart_firework_pink_normal_01.ani",
"common/firework/chn_heart_firework_pink_normal.ani",
"common/firework/chn_heart_firework_purple_dodge.ani",
"common/firework/chn_heart_firework_purple_normal.ani",
"common/firework/chn_heart_firework_red_dodge.ani",
"common/firework/chn_heart_firework_red_normal.ani",
"common/firework/chn_heart_firework_sky_dodge_01.ani",
"common/firework/chn_heart_firework_sky_dodge.ani",
"common/firework/chn_heart_firework_sky_normal_01.ani",
"common/firework/chn_heart_firework_sky_normal.ani",
"common/firework/chn_heart_firework_yellow_dodge_01.ani",
"common/firework/chn_heart_firework_yellow_dodge.ani",
"common/firework/chn_heart_firework_yellow_normal_01.ani",
"common/firework/chn_heart_firework_yellow_normal.ani",
"common/firework/chn_heehee_firework_dodge.ani",
"common/firework/chn_heehee_firework_normal.ani"
];
FireworkAni = null;
constructor() {
Visitors = [];
FireworkAni = [];
}
function Init(Info) {
Groom = null;
//新娘
Bride = null;
//观众
Visitors = [];
ActTimer = Clock();
Canvas = false;
for (local i = 0; i< Info.len(); i++) {
local Object = {};
local InfoConfig = Info[i];
Object.Charc <- Rindro_Draw_Character(InfoConfig.job, InfoConfig.avatar, "rest.ani", null);
Object.Name <- InfoConfig.name;
if (i == 0) Groom = Object;
else if (i == 1) Bride = Object;
else {
Visitors.append(Object);
}
}
InitFirework();
Flag = true;
}
function InitFirework() {
FireworkAni = [];
for (local i = 0; i< 12; i++) {
FireworkAni.append({
ani = Rindro_Animation(FireworkPath[sq_getRandom(0, FireworkPath.len() - 1)]),
pos = {
x = sq_getRandom(0, 1066),
y = sq_getRandom(0, 800)
}
});
}
}
function ShowMessageBox(X, Y, STR) {
local StrDrawLen = LenheartTextClass.GetStringLength(STR);
local WLen = ((StrDrawLen - 30) / 12) + 1;
local HLen = (StrDrawLen / 110);
WLen = WLen > 7 ? 7 : WLen;
//Item信息框一般为211的宽度
L_sq_DrawImg("interface/messageballoon.img", 49, X + (30 + (WLen * 12)) * 0.7, Y + 16 + ((HLen + 1) * 13));
L_sq_DrawWindow(X, Y, 30 + (WLen * 12), 21 + (HLen * 13), "interface/messageballoon.img", 40, 9, 12, 9, 13);
//绘制字符串
local Buf = L_sq_GetStringDrawArray(STR, 123);
foreach(Line, Str in Buf) {
L_sq_DrawCode(Str, X + 8, Y + 8 + (Line * 14), sq_RGBA(255, 255, 255, 255), 0, 1);
}
}
function ShowMessageAct(CT, TimeFlag, X, Y, Str) {
if (CT >= TimeFlag && CT <= TimeFlag + 3000) {
ShowMessageBox(X, Y, Str);
}
return TimeFlag + 3000;
}
function Show(obj) {
if (!Flag) return;
local CT = Clock() - ActTimer;
DrawAuditoriumMap(obj);
//画新郎
if (Groom) {
Groom.Charc.Draw(680, 360);
}
//画新娘
if (Bride) {
Bride.Charc.Draw(686, 400);
}
//画宾客
foreach(Pos, Object in Visitors) {
Object.Charc.Draw(100 + ((Pos / 2) * 80), 350 + ((Pos % 2) * 60));
}
local TimeFlag = 5000;
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 175, format("[%s]和[%s]的婚礼现在开始!", Groom.Name, Bride.Name));
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 135, "婚姻是神圣的仪式,也是爱情和相互信任的升华,他需要的不仅是爱,更是双方一生一世的信赖。");
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 155, "在这里,我们两位新人将在来宾的见证下完成这最重要的承诺。");
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 155, "新郎,你愿意接受这个女人成为你的合法妻子并永远爱她吗?");
TimeFlag = ShowMessageAct(CT, TimeFlag, 630, 195, "是的,我愿意!");
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 155, "新娘,你愿意接受这个男人成为你的合法丈夫并永远爱他吗?");
TimeFlag = ShowMessageAct(CT, TimeFlag, 671, 215, "...");
TimeFlag = ShowMessageAct(CT, TimeFlag, 611, 215, "(害羞)我......我愿意!");
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 155, "好,我以神的名义宣布新郎新娘正式结为夫妻。");
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 155, "请所有的来宾一起祝福这对新人~");
if (CT >= TimeFlag && CT <= (TimeFlag + 5000)) {
{
L_sq_DrawImg("interface2/wedding/screenshot_bg.img", 0, 0, 0, 1, sq_RGBA(255, 255, 255, 250), getroottable().Rindro_Scr_Width / 800.0, 1.0);
for (local i = 0; i< 12; i++) {
local Info = FireworkAni[i];
Info.ani.Draw(Info.pos.x, Info.pos.y);
if (i == 11 && Info.ani.IsUsability == false) {
InitFirework();
}
}
}
}
if (CT >= (TimeFlag + 5000)) {
Groom = null;
//新娘
Bride = null;
//观众
Visitors = [];
ActTimer = Clock();
Canvas = false;
Flag = false;
}
// ShowMessageBox(810, 135, "婚姻是神圣的仪式,也是爱情和相互信任的升华,他需要的不仅是爱,更是双方一生一世的信赖。");
// ShowMessageBox(810, 155, "在这里,我们两位新人将在来宾的见证下完成这最重要的承诺。");
// ShowMessageBox(810, 155, "新郎,你愿意接受这个女人成为你的合法妻子并永远爱她吗?");
// ShowMessageBox(680, 155, "是的,我愿意!");
// ShowMessageBox(810, 155, "新娘,你愿意接受这个男人成为你的合法丈夫并永远爱他吗?");
// ShowMessageBox(686, 195, "...");
// ShowMessageBox(686, 195, "(害羞)我......我愿意!");
// ShowMessageBox(810, 155, "好,我以神的名义宣布新郎新娘正式结为夫妻。");
// ShowMessageBox(810, 155, "请所有的来宾一起祝福这对新人~");
// {
// L_sq_DrawImg("interface2/wedding/screenshot_bg.img", 0, 0, 0, 1, sq_RGBA(255, 255, 255, 250), getroottable().Rindro_Scr_Width / 800.0, 1.0);
// for (local i = 0; i< 12; i++) {
// local Info = FireworkAni[i];
// Info.ani.Draw(Info.pos.x, Info.pos.y);
// if (i == 11 && Info.ani.IsUsability == false) {
// InitFirework();
// }
// }
// }
if (!Canvas) {
local AlphaValue = sq_GetUniformVelocity(250, 0, CT - 2000, 3000);
//先画一个黑色背景
L_sq_DrawImg("marrysystem.img", 1, 0, 0, 1, sq_RGBA(255, 255, 255, AlphaValue), 1.0, 1.0);
if (CT >= 5000) {
Canvas = true;
}
}
}
ScriptMapPath = "map/cataclysm/town/church/";
MapXpos = 0;
MapYpos = 47;
function DrawAuditoriumMap(obj) {
//先画一个黑色背景
L_sq_DrawImg("marrysystem.img", 1, 0, 0);
//画地板
L_sq_DrawImg("Map/Church/ChurchTile.img", 1, 0 + MapXpos, -73);
L_sq_DrawImg("Map/Church/ChurchTile.img", 0, (224 * 1) + MapXpos, -80);
L_sq_DrawImg("Map/Church/ChurchTile.img", 1, (224 * 2) + MapXpos, -80);
L_sq_DrawImg("Map/Church/ChurchTile.img", 1, (224 * 3) + MapXpos, -80);
L_sq_DrawImg("Map/Church/ChurchTile.img", 0, (224 * 4) + MapXpos, -80);
for (local i = 0; i< 2; i++) {
L_sq_DrawImg("Map/Church/ChurchTileEx.img", 0, (224 * 0) + MapXpos, 467 + (i * 120));
L_sq_DrawImg("Map/Church/ChurchTileEx.img", 0, (224 * 1) + MapXpos, 467 + (i * 120));
L_sq_DrawImg("Map/Church/ChurchTileEx.img", 0, (224 * 2) + MapXpos, 467 + (i * 120));
L_sq_DrawImg("Map/Church/ChurchTileEx.img", 0, (224 * 3) + MapXpos, 467 + (i * 120));
L_sq_DrawImg("Map/Church/ChurchTileEx.img", 0, (224 * 4) + MapXpos, 467 + (i * 120));
}
//画地图
//closeback
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 153, 123);
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 288, 126);
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 420, 126);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 79, 117);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 211, 117);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 346, 118);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 482, 118);
DrawMapAni(obj, "Animation/chn_organ.ani", 790, 145);
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 582, 628);
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 176, 628);
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 312, 628);
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 447, 628);
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 721, 628);
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 863, 628);
//normal
DrawMapAni(obj, "Animation/chn_light_normal.ani", 833, 27);
DrawMapAni(obj, "Animation/chn_light_dodge.ani", 833, 27);
DrawMapAni(obj, "Animation/chn_light_normal.ani", 153, 29);
DrawMapAni(obj, "Animation/chn_light_dodge.ani", 153, 29);
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", 617, 332);
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", 393, 332);
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", 169, 332);
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", -55, 332);
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", 1065, 332);
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", 841, 332);
DrawNpc(obj, "npc/animation/chn_npc_father.ani", 888, 375, "MarryMapNpc" + 2);
DrawMapAni(obj, "Animation/chn_bridesmaid_normal_in_church.ani", 576, 37);
DrawMapAni(obj, "Animation/chn_chair.ani", 131, 232);
DrawMapAni(obj, "Animation/chn_chair.ani", 302, 232);
DrawMapAni(obj, "Animation/chn_chair.ani", 481, 232);
DrawMapAni(obj, "Animation/chn_flower_bigpot.ani", 838, 269);
DrawMapAni(obj, "Animation/chn_flower_tunnel.ani", 907, 323);
DrawMapAni(obj, "Animation/chn_flower_bigpot.ani", 959, 359);
DrawMapAni(obj, "Animation/chn_table.ani", 832, 373);
DrawMapAni(obj, "Animation/chn_tablering_dodge.ani", 832, 373);
DrawMapAni(obj, "Animation/chn_chair.ani", 971, 535);
DrawMapAni(obj, "Animation/chn_chair.ani", 661, 535);
DrawMapAni(obj, "Animation/chn_chair.ani", 114, 535);
DrawMapAni(obj, "Animation/chn_chair.ani", 485, 535);
DrawMapAni(obj, "Animation/chn_chair.ani", 297, 535);
DrawMapAni(obj, "Animation/chn_chair.ani", 817, 535);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 373, 617);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 507, 617);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 641, 617);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 102, 617);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 234, 617);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 783, 617);
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 923, 617);
//画NPC
DrawNpc(obj, "npc/Animation/chn_giftbox_in_church.ani", 691, 240, "MarryMapNpc" + 1);
}
function DrawNpc(obj, aniFileName, x, y, aniname) {
local ani = obj.getVar().GetAnimationMap(aniname, aniFileName);
ani.setImageRateFromOriginal(-1.0, 1.0);
sq_AnimationProc(ani);
sq_drawCurrentFrame(ani, x, y, true);
return ani;
}
function DrawMapAni(obj, Path, X, Y) {
T_DrawDynamicAni(obj, ScriptMapPath + Path, X + MapXpos, Y + MapYpos, "MarryMapAni" + Path);
}
}
getroottable().rawdelete("MarrySystem_Obj");

View File

@ -0,0 +1,195 @@
/*
文件名:MarrySystem_OpenAuditoriumList.nut
路径:Project/MarrySystem/MarrySystem_OpenAuditoriumList.nut
创建日期:2024-10-05 13:20
文件用途:打开礼堂列表
*/
class LenheartNewUI_MarrySystem_OpenAuditoriumListButton extends LenheartNewUI_CommonUi {
State = 0;
BaseIdx = 29;
DWidth = null;
Path = null;
Idx = null;
Info = null;
constructor(X, Y, W, H, Path, Idx) {
this.DWidth = W;
this.Path = Path;
this.Idx = Idx;
LenheartNewUI_CommonUi.constructor(X, Y, W, H);
}
function SetFrame(gPath, gIdx) {
if (gPath) Path = gPath;
Idx = gIdx;
}
function Show(obj) {
//不可用
if (State == 8) {
L_sq_DrawImg(Path, Idx + 3, X, Y + 1);
} else {
//按下
if (isLBDown) {
L_sq_DrawImg(Path, Idx + 2, X, Y);
}
//悬停
else if (isInRect) {
L_sq_DrawImg(Path, Idx + 1, X, Y);
}
//普通
else {
L_sq_DrawImg(Path, Idx, X, Y);
}
}
}
}
class MarrySystem_OpenAuditoriumListC extends LenheartNewUI_Windows {
//调试模式
// DeBugMode = true;
//不是窗口
// NoWindow = true;
//是否可见
Visible = false;
//包头
OP = 20078000;
//列表
List = null;
//滚动Flag
WheelFalg = 0;
function Time2Str(Time) {
if (Time< 0) return "已开始";
local str = "";
local minutes = Time / 60;
local seconds = (Time % 60);
str += minutes + "分";
str += seconds + "秒";
return str;
}
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
List = {};
//注册控件
RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
}
function RegisterWidget() {
//关闭按钮
local CloseButton = LenheartNewUI_BaseButton(458, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
CloseButton.OnClick = function() {
this.Visible = false;
}.bindenv(this);
Childrens.append(CloseButton);
for (local i = 0; i< 11; i++) {
local ButtonBuf = LenheartNewUI_MarrySystem_OpenAuditoriumListButton(412, 112 + (i * 21), 51, 17, "interface2/wedding/weddingcardreceive.img", 7);
ButtonBuf.Info = i;
ButtonBuf.OnClickEx = function(Button) {
local T = {
op = OP + 15,
room = List[Button.Info + WheelFalg][0]
}
SendPackEx(T);
CloseWindow();
}.bindenv(this);
ButtonBuf.SetCallBackFunc(function(Button) {
//有索引信息才显示
if (Button.Info<(List.len() - WheelFalg)) {
local DrawInfo = List[Button.Info + WheelFalg];
//绘制举办者名字
L_sq_DrawCode(DrawInfo[1], Button.X - 330 - LenheartTextClass.GetStringLength(DrawInfo[1]) / 2, Button.Y + 2, sq_RGBA(134, 120, 79, 255), 0, 1);
L_sq_DrawImg("interface2/wedding/weddingreservationpopupui.img", 1, Button.X - 310, Button.Y + 2);
L_sq_DrawCode(DrawInfo[5], Button.X - 285, Button.Y + 2, sq_RGBA(134, 120, 79, 255), 0, 1);
//绘制频道
L_sq_DrawCode(DrawInfo[8], Button.X - 186, Button.Y + 2, sq_RGBA(134, 120, 79, 255), 0, 1);
//绘制举办时间
local Time = Sq_Time();
local TimeStr = Time2Str(DrawInfo[9] + ((DrawInfo[2] + 1) * 10 * 60) - Time);
L_sq_DrawCode(TimeStr, Button.X - 100 - LenheartTextClass.GetStringLength(TimeStr) / 2, Button.Y + 2, sq_RGBA(134, 120, 79, 255), 0, 1);
//绘制人数
local CountStr = DrawInfo[7].tostring();
L_sq_DrawCode(CountStr, Button.X - 20 - LenheartTextClass.GetStringLength(CountStr) / 2, Button.Y + 2, sq_RGBA(134, 120, 79, 255), 0, 1);
Button.Visible = true;
} else {
Button.Visible = false;
}
}.bindenv(this));
Childrens.append(ButtonBuf);
}
}
//绘制主界面
function DrawMain(obj) {
//Item信息框一般为211的宽度
L_sq_DrawWindow(X, Y + 10, 540 * 0.85, 340 * 0.9, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
L_sq_DrawWindow(X + 6, Y + 19, 528 * 0.85, 47, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
L_sq_DrawWindow(X + 6, Y + 79, 528 * 0.85, 236, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
//标题栏
L_sq_DrawButton(X - 1, Y, 466, "interface/lenheartwindowcommon.img", 609, 2, 7);
//绘制窗口名字
L_sq_DrawCode("婚礼礼堂列表", X + 200, Y + 3, sq_RGBA(134, 120, 79, 255), 0, 1);
L_sq_DrawImg("interface2/wedding/weddingcardreceive.img", 10, X + 108, Y + 35);
sq_DrawBox(X + 10, Y + 87, 198, 17, sq_RGBA(134, 120, 79, 255), 1);
L_sq_DrawCode("婚礼举办者", X + 80, Y + 90, sq_RGBA(221, 197, 147, 255), 0, 1);
sq_DrawBox(X + 210, Y + 87, 40, 17, sq_RGBA(134, 120, 79, 255), 1);
L_sq_DrawCode("频道", X + 219, Y + 90, sq_RGBA(221, 197, 147, 255), 0, 1);
sq_DrawBox(X + 252, Y + 87, 122, 17, sq_RGBA(134, 120, 79, 255), 1);
L_sq_DrawCode("举办时间", X + 289, Y + 90, sq_RGBA(221, 197, 147, 255), 0, 1);
sq_DrawBox(X + 376, Y + 87, 32, 17, sq_RGBA(134, 120, 79, 255), 1);
L_sq_DrawCode("人数", X + 380, Y + 90, sq_RGBA(221, 197, 147, 255), 0, 1);
sq_DrawBox(X + 410, Y + 87, 54, 17, sq_RGBA(134, 120, 79, 255), 1);
L_sq_DrawCode("参加婚礼", X + 414, Y + 90, sq_RGBA(221, 197, 147, 255), 0, 1);
}
function Show(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
//逻辑入口
function Proc(obj) {
LenheartNewUI_Windows.SyncPos(X, Y);
}
//override
//鼠标滚轮事件回调
function OnMouseWheel(Flag, MousePos_X, MousePos_Y) {
if (Flag) {
if (WheelFalg > 0) WheelFalg--;
} else {
if (WheelFalg<(List.len() - 11)) WheelFalg++;
}
//调用原生方法
LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
}
}
getroottable().rawdelete("MarrySystem_Obj");

View File

@ -0,0 +1,23 @@
/*
文件名:MarrySystem_Room.nut
路径:Project/MarrySystem/MarrySystem_Room.nut
创建日期:2024-10-28 20:22
文件用途:婚房逻辑
*/
class MarrySystem_Room {
WorldMapImg = null;
constructor() {
DrawTownCallBackFunc.MarrySystem_Room <- Draw.bindenv(this);
WorldMapImg = Rindro_Image("worldmap.img");
}
function Draw() {
}
}
getroottable().rawdelete("MarrySystem_Obj");

View File

@ -0,0 +1,240 @@
/*
文件名:NewWorldMap.nut
路径:Project/NewWorldMap/NewWorldMap.nut
创建日期:2024-10-27 10:24
文件用途:新世界地图
*/
class NewWorldMapC extends LenheartNewUI_Windows {
//调试模式
// DeBugMode = true;
//不是窗口
// NoWindow = true;
//是否可见
// Visible = false;
//区域
Region = null;
//Img
WorldMapImg = null;
Ani = null;
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
Region = [];
//注册控件
RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
InitData();
// printT(Region);
LoadImg();
}
function LoadImg() {
WorldMapImg = Rindro_Image("worldmap.img");
}
function InitData() {
local RegionLst = R_Utils.GetScriptFileReader("region/region.lst");
if (RegionLst) {
local IO = Sq_Point2Blob(L_sq_P2I(RegionLst.Buffer.C_Object), RegionLst.Size);
local i = 2;
while (i< RegionLst.Size) {
if ((RegionLst.Size - i) >= 10) {
IO.seek(i + 6); //内容指示位
local FindKey = IO.readn('i');
local Key = Rindro_Script.GetBinString(FindKey);
if (Key) {
local StrFilePath = "region/" + Key.tolower();
InitRegion(StrFilePath);
}
} else break;
i += 10;
}
InitMiniMap();
}
}
function InitRegion(Path) {
local RegionData = R_Utils.GetScriptFileReader(Path);
if (RegionData) {
local Data = {};
if (RegionData.Size >= 7) {
//创建Blob对象
local IO = Sq_Point2Blob(L_sq_P2I(RegionData.Buffer.C_Object), RegionData.Size);
//以5为单步从第二位开始遍历字节
local i = 2;
while (true) {
if (i< RegionData.Size && RegionData.Size - i >= 5) {
local str = Rindro_Script.UnpackData(IO, i);
i += 5;
//城镇编号
if (str == "[towns]") {
Data.Towns <- {};
while (true) {
local Ret = Rindro_Script.UnpackData(IO, i);
i += 5;
if (Ret == "[/towns]") break;
Data.Towns.rawset((Ret.tointeger() - 9), {});
}
}
//名称
else if (str == "[name]" || str == "[english name]" || str == "[minimap]") {
local RealKey = str.slice(1, str.len() - 1);
local Ret = Rindro_Script.UnpackData(IO, i);
if (str == "[name]") Ret = Sq_ConvertWideChar(Ret, "big5")
Data[RealKey] <- Ret;
i += 5;
}
} else break;
}
}
Region.append(Data);
}
}
function InitMiniMap() {
foreach(Pos, Value in Region) {
local Path = "region/" + Value.minimap.tolower();
local MiniMapData = R_Utils.GetScriptFileReader(Path);
if (MiniMapData) {
local Data = {};
if (MiniMapData.Size >= 7) {
//创建Blob对象
local IO = Sq_Point2Blob(L_sq_P2I(MiniMapData.Buffer.C_Object), MiniMapData.Size);
//以5为单步从第二位开始遍历字节
local i = 2;
while (true) {
if (i< MiniMapData.Size && MiniMapData.Size - i >= 5) {
local str = Rindro_Script.UnpackData(IO, i);
i += 5;
//城镇编号
if (str == "[image]") {
Data.Image <- {};
while (true) {
local Ret = Rindro_Script.UnpackData(IO, i);
i += 5;
if (Ret == "[/image]") break;
local imgpath = Rindro_Script.UnpackData(IO, i);
i += 5;
local imgframe = Rindro_Script.UnpackData(IO, i).tointeger() - 9;
i += 5;
Data.Image.rawset(Ret, {
path = imgpath,
frame = imgframe
});
}
}
} else break;
}
}
}
}
}
function RegisterWidget() {
// //关闭按钮
// local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
// CloseButton.OnClick = function() {
// this.Visible = false;
// }.bindenv(this);
// Childrens.append(CloseButton);
}
Timer = Clock();
function GetMoveOffset(L, R) {
return (-L) + (L.tofloat() * (R.tofloat() / 100.0)).tointeger()
}
//绘制主界面
function DrawMain(obj) {
//绘制背景
WorldMapImg.DrawExPng(0, 0, -83, 0, 0xffffffff, 0.84, 0.84);
local UniRate = sq_GetAccel(0, 100, Clock() - Timer, 1000);
local AccRate = sq_GetAccel(0, 100, Clock() - Timer, 1000, true);
//绘制左上云1
WorldMapImg.DrawExPng(1, GetMoveOffset(100, AccRate), 0, 0, sq_RGBA(255, 255, 255, ((UniRate.tofloat() / 100.0) * 255.0).tointeger()), 0.84, 0.84);
//绘制左上云2
WorldMapImg.DrawExPng(2, GetMoveOffset(100, AccRate), GetMoveOffset(50, AccRate), 0, sq_RGBA(255, 255, 255, ((UniRate.tofloat() / 100.0) * 255.0).tointeger()), 0.84, 0.84);
//绘制左下云
WorldMapImg.DrawExPng(3, GetMoveOffset(100, AccRate), 404 + GetMoveOffset(-50, AccRate), 0, sq_RGBA(255, 255, 255, ((UniRate.tofloat() / 100.0) * 255.0).tointeger()), 0.84, 0.84);
//绘制右上云
WorldMapImg.DrawExPng(4, 868 + GetMoveOffset(-100, AccRate), 0, 0, sq_RGBA(255, 255, 255, ((UniRate.tofloat() / 100.0) * 255.0).tointeger()), 0.84, 0.84);
//绘制右下云
WorldMapImg.DrawExPng(5, 762 + GetMoveOffset(-100, AccRate), 389 + GetMoveOffset(-50, AccRate), 0, sq_RGBA(255, 255, 255, ((UniRate.tofloat() / 100.0) * 255.0).tointeger()), 0.84, 0.84);
// local ani = obj.getVar().GetAnimationMap("test", "common/test.ani");
// sq_SetfRotateAngle(ani, sq_ToRadian(60.0));
// sq_AnimationProc(ani);
// sq_drawCurrentFrame(ani, 200, 200, true);
// Ani.Draw(400, 400);
local angle = (GetMoveOffset(135, UniRate).tofloat()) % 360;
//中心点
local centerX = 120.0 * 0.6 / 2;
local centerY = 120.0 * 0.6 / 2;
local Lenght = sqrt(centerX * centerX + centerY * centerY);
local atan = sq_ToDegree(sq_Atan2(centerY, centerX));
local NextAngle = (atan + angle).tointeger();
local NextX = (Lenght * sq_CosTable(NextAngle));
local NextY = (Lenght * sq_SinTable(NextAngle));
local newRelX = (centerX - NextX);
local newRelY = (centerY - NextY);
WorldMapImg.DrawExPng(7, 20, 470, 0, sq_RGBA(255, 255, 255, ((UniRate.tofloat() / 100.0) * 255.0).tointeger()), 0.6, 0.6);
WorldMapImg.DrawExPng(6, 39 + newRelX, 489 + newRelY, sq_ToRadian(-angle.tofloat()), 0xffffffff, 0.6, 0.6);
}
function Show(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
//逻辑入口
function Proc(obj) {
LenheartNewUI_Windows.SyncPos(X, Y);
}
//简便性能高的开平方
function sqrt(sum) {
local i = (sum / 2).tofloat();
local isb = 0;
for (isb = 0; isb< 10; isb++) {
i = (i - ((i * i - sum) / (2 * i))).tofloat();
}
return i;
}
}
getroottable().rawdelete("NewWorldMap_Obj");
function Lenheart_NewWorldMap_Fun(obj) {
local RootTab = getroottable();
if (!RootTab.rawin("NewWorldMap_Obj")) {
RootTab.rawset("NewWorldMap_Obj", true);
LenheartNewUI_CreateWindow(NewWorldMapC, "新世界地图", 0, 0, getroottable().Rindro_Scr_Width, 600, 0);
}
}
getroottable()["LenheartFuncTab"].rawset("NewWorldMapFuncN", Lenheart_NewWorldMap_Fun);

View File

@ -106,5 +106,14 @@
},
"Project/MarrySystem": {
"description": "结婚系统"
},
"Project/EquipUseJewel": {
"description": "装备镶嵌"
},
"Project/NewWorldMap": {
"description": "新世界地图"
},
"Project/Luke": {
"description": "卢克"
}
}