This commit is contained in:
2024-09-16 17:09:36 +08:00
commit 39d60b284e
47 changed files with 12314 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
/*
文件名:Lenheart_Ani_Class.nut
路径:Base/UI/Lenheart_Ani_Class.nut
创建日期:2024-08-06 18:56
文件用途:Ani
*/
class Lenheart_Ani {
X = 0;
Y = 0;
ImgPath = null;
ImgFrame = null;
//播放状态
State = 0;
//循环
LoopFlag = true;
//当前帧数
CurFrame = 0;
//初始化时间
InitTime = 0;
//Ani当前帧播放时间
PlayCurTime = 0;
//img 路径 调用帧数组
constructor(path, frame, Pos) {
ImgPath = ("Character/" + path + ".img").tolower();
ImgFrame = frame;
InitTime = Clock();
State = 1;
X = Pos[0];
Y = Pos[1];
}
function Show(dt) {
if (State == 1) {
if (ImgFrame) {
local NowFrameObj = ImgFrame[CurFrame];
PlayCurTime += dt;
L_sq_DrawImg(ImgPath, NowFrameObj.ImgIndex, NowFrameObj.Pos[0] + X, NowFrameObj.Pos[1] + Y);
if (PlayCurTime >= NowFrameObj.Delay) {
CurFrame++;
//播放完成
if (CurFrame >= ImgFrame.len()) {
if (LoopFlag) CurFrame = 0;
else State = 0;
}
InitTime = Clock();
PlayCurTime = 0;
}
}
}
}
function ShowEx(dt,gRgba,rate_x,rate_y) {
if (State == 1) {
if (ImgFrame) {
local NowFrameObj = ImgFrame[CurFrame];
PlayCurTime += dt;
L_sq_DrawImg(ImgPath, NowFrameObj.ImgIndex, NowFrameObj.Pos[0] + X, NowFrameObj.Pos[1] + Y,1,gRgba,rate_x,rate_y);
if (PlayCurTime >= NowFrameObj.Delay) {
CurFrame++;
//播放完成
if (CurFrame >= ImgFrame.len()) {
if (LoopFlag) CurFrame = 0;
else State = 0;
}
InitTime = Clock();
PlayCurTime = 0;
}
}
}
}
function Reset()
{
CurFrame = 0;
State = 1;
}
}

View File

@@ -0,0 +1,512 @@
/*
文件名:Lenheart_Character_Info_Class.nut
路径:Base/UI/Lenheart_Character_Info_Class.nut
创建日期:2024-08-27 12:13
文件用途:个人信息属性面板
*/
class Lenheart_Character_Info_ClassC extends LenheartNewUI_Windows {
//调试模式
// DeBugMode = true;
//不是窗口
NoWindow = true;
//是否可见
Visible = false;
//图标路径
IconPath = "interface2/profile/profile_icon1.img";
//我的信息
MyInfo = null;
//滚轮偏移值
YOffset = 0;
function My_GetCharacterInfoCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
MyInfo = Jso.Attribute;
}
//初始化
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
//注册控件
RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
Pack_Control.rawset(20069014, My_GetCharacterInfoCallBack.bindenv(this));
}
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);
}
//绘制主界面
function DrawMain(obj) {
DrawInfo(obj);
}
function CheckPosInDrawBox(PosY) {
if ((PosY + YOffset) >= 0 && (PosY + YOffset)< 144) return true;
return false;
}
//绘制信息
function DrawInfo(obj) {
if (MyInfo) {
//生命魔法值
local PosOffset = 0;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 0, X + 4, Y + 3 + YOffset);
L_sq_DrawCode("HP", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local HpStr = MyInfo.CurHp.tostring() + "/" + MyInfo.MaxHp.tostring();
L_sq_DrawCode(HpStr, X + 128 - LenheartTextClass.GetStringLength(HpStr), Y + 4 + (0 * 18) + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
L_sq_DrawImg(IconPath, 1, X + 130, Y + 3 + YOffset);
L_sq_DrawCode("MP", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local HpStr = MyInfo.CurMp.tostring() + "/" + MyInfo.MaxMp.tostring();
L_sq_DrawCode(HpStr, X + 248 - LenheartTextClass.GetStringLength(HpStr), Y + 4 + (0 * 18) + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
}
//力量智力
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 2, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("力量", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.Strength.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
L_sq_DrawImg(IconPath, 3, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("智力", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.Intellect.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
}
//体力精神
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 4, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("体力", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.Vitality.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
L_sq_DrawImg(IconPath, 5, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("精神", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.Spirit.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
}
//物理攻击魔法攻击
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 6, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("物理攻击", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.PhysicalAttack.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
L_sq_DrawImg(IconPath, 7, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("魔法攻击", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.MagicalAttack.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
}
//独立攻击力
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 31, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("独立攻击力(物理/魔法)", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.IndependentAttack.tostring();
L_sq_DrawCode(Str, X + 248 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
}
//物理防御魔法防御
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 8, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("物理防御", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.PhysicalDefend.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
L_sq_DrawImg(IconPath, 9, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("魔法防御", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.MagicalDefend.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
}
//物理暴击 魔法暴击
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 10, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("物理暴击", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = format("%0.1f%%", MyInfo.PhysicalCrit);
L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 11, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("魔法暴击", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = format("%0.1f%%", MyInfo.MagicalCrit);
L_sq_DrawCode(Str2, X + 253 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
//攻击速度 释放速度
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 12, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("攻击速度", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = format("%0.1f%%", MyInfo.AttackSpeed);
L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 13, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("释放速度", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = format("%0.1f%%", MyInfo.ReleaseSpeed);
L_sq_DrawCode(Str2, X + 253 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
//移动速度 抗魔
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 14, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("移动速度", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = format("%0.1f%%", MyInfo.MoveSpeed);
L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 15, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("抗魔", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.AntiMagic.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
//命中率 回避率
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 16, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("命中率", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = format("%0.1f%%", MyInfo.HitRate);
L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 17, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("回避率", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = format("%0.1f%%", MyInfo.DodgeRate);
L_sq_DrawCode(Str2, X + 253 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
//HP恢复量 MP恢复量
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 18, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("HP恢复量", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.HPRecovery.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 19, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("MP恢复量", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.MPRecovery.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
//僵直度 硬直
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 20, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("僵直度", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.StunRate.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 21, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("硬直", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.StunResist.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
//火属性强化 火属性抗性
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 22, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("火属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.FireStrength.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 23, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("火属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.FireResist.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
//冰属性强化 冰属性抗性
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 24, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("冰属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.IceStrength.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 25, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("冰属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.IceResist.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
//光属性强化 光属性抗性
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 26, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("光属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.LightStrength.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 27, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("光属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.LightResist.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
//暗属性强化 暗属性抗性
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 28, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("暗属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.DarkStrength.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 29, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("暗属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.DarkResist.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
//名望值 罪恶值
PosOffset += 18;
if (CheckPosInDrawBox(PosOffset)) {
L_sq_DrawImg(IconPath, 53, X + 4, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("名望值", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str = MyInfo.Fame.tostring();
L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
L_sq_DrawImg(IconPath, 45, X + 130, Y + 3 + PosOffset + YOffset);
L_sq_DrawCode("最终伤害", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
local Str2 = MyInfo.FinalDamage.tostring();
L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
}
}
}
function Show(obj) {
}
function RealShow(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
//override
//鼠标滚轮事件回调
function OnMouseWheel(Flag, MousePos_X, MousePos_Y) {
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) {
if (Flag) {
if (YOffset< 0) YOffset += 18;
}
if (!Flag) {
if (YOffset > (-145)) YOffset -= 18;
}
}
//调用原生方法
LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
}
GetMyInfoFlag = false;
//逻辑入口
function Proc(obj) {
Visible = false;
LenheartNewUI_Windows.SyncPos(X, Y);
local WindowX = sq_GetPopupWindowMainCotrol(74);
if (!WindowX) {
GetMyInfoFlag = false;
}
if (!WindowX || !OldWindowAddress) return;
if (!GetMyInfoFlag) {
GetMyInfoFlag = true;
local T = {
op = 20069013,
Info = Lenheart_Character_GetAttribute(null)
}
SendPackEx(T);
}
X = L_sq_RA(OldWindowAddress + 0x14);
Y = L_sq_RA(OldWindowAddress + 0x18);
}
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 <= 0x20000) {
OldWindowAddress = Address;
local obj = sq_getMyCharacter();
RealShow(obj);
Visible = true;
return true;
}
}
}
//个人信息窗口逻辑
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;
}
getroottable().rawdelete("Lenheart_Character_Info_Class_Obj");
function Lenheart_Character_Info_Class_Fun(obj) {
local RootTab = getroottable();
if (!RootTab.rawin("Lenheart_Character_Info_Class_Obj")) {
RootTab.rawset("Lenheart_Character_Info_Class_Obj", LenheartNewUI_CreateWindow(Lenheart_Character_Info_ClassC, "个人信息属性面板窗口", 0, 0, 263, 146, 0));
}
}
getroottable()["LenheartFuncTab"].rawset("Lenheart_Character_Info_ClassFuncN", Lenheart_Character_Info_Class_Fun);
class Lenheart_Other_Character_Info_ClassC extends Lenheart_Character_Info_ClassC {
//调试模式
// DeBugMode = true;
//不是窗口
NoWindow = true;
//是否可见
Visible = false;
//图标路径
IconPath = "interface2/profile/profile_icon1.img";
//我的信息
MyInfo = null;
//滚轮偏移值
YOffset = 0;
function Other_GetCharacterInfoCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
MyInfo = Jso.Attribute;
}
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
//注册控件
RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
Pack_Control.rawset(20069012, Other_GetCharacterInfoCallBack.bindenv(this));
}
function RegisterWidget() {
}
function Show(obj) {
}
function DrawMain(obj) {
DrawInfo(obj);
}
function RealShow(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
//override
//鼠标滚轮事件回调
function OnMouseWheel(Flag, MousePos_X, MousePos_Y) {
if (Flag) {
if (YOffset< 0) YOffset += 18;
}
if (!Flag) {
if (YOffset > (-145)) YOffset -= 18;
}
//调用原生方法
LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
}
//逻辑入口
function Proc(obj) {
Visible = false;
LenheartNewUI_Windows.SyncPos(X, Y);
local WindowX = sq_GetPopupWindowMainCotrol(74);
if (!WindowX || !OldWindowAddress) return;
X = L_sq_RA(OldWindowAddress + 0x14);
Y = L_sq_RA(OldWindowAddress + 0x18) + 154;
}
OldWindowAddress = null;
function SyncState(Address) {
OldWindowAddress = Address;
local obj = sq_getMyCharacter();
RealShow(obj);
Visible = true;
return true;
}
}
//他人信息窗口逻辑
function L_Other_Character_Info_Window(WindowObject) {
//返回Flase 原逻辑继续执行 返回Tue 原逻辑终止执行
local Flag = false;
if (getroottable().rawin("Lenheart_Other_Character_Info_Class_Obj")) {
local MyWindow = getroottable().rawget("Lenheart_Other_Character_Info_Class_Obj");
local Ret = MyWindow.SyncState(WindowObject);
if (Ret) Flag = true;
}
return Flag;
}
getroottable().rawdelete("Lenheart_Other_Character_Info_Class_Obj");
function Lenheart_Other_Character_Info_Class_Fun(obj) {
local RootTab = getroottable();
if (!RootTab.rawin("Lenheart_Other_Character_Info_Class_Obj")) {
RootTab.rawset("Lenheart_Other_Character_Info_Class_Obj", LenheartNewUI_CreateWindow(Lenheart_Other_Character_Info_ClassC, "他人信息属性面板窗口", 0, 0, 263, 146, 0));
}
}
getroottable()["LenheartFuncTab"].rawset("Lenheart_Other_Character_Info_ClassFuncN", Lenheart_Other_Character_Info_Class_Fun);

View File

@@ -0,0 +1,359 @@
/*
文件名:Lenheart_Event_Class.nut
路径:Base/UI/Lenheart_Event_Class.nut
创建日期:2024-08-11 09:47
文件用途:活动图标
*/
class LenheartNewUI_EventButton extends LenheartNewUI_CommonUi {
State = 0;
BaseIdx = 29;
DWidth = null;
Path = null;
Idx = null;
BindObj = null;
Timer = 0;
EffFlag = true;
ShowName = null;
constructor(X, Y, Path, Idx) {
this.DWidth = 20;
this.Path = Path;
this.Idx = Idx;
LenheartNewUI_CommonUi.constructor(X, Y, 20, 20);
Timer = Clock();
}
function SetFrame(gPath, gIdx) {
if (gPath) Path = gPath;
Idx = gIdx;
}
function Show(obj) {
T_DrawDynamicAni(obj, "common/yosinevent/eventsystemeff.ani", X, Y, "EventIcon" + ObjectId);
//不可用
if (State == 8) {
L_sq_DrawImg(Path, Idx + 3, X, Y + 1);
} else {
//按下
if (isLBDown) {
L_sq_DrawImg(Path, Idx + 1, X, Y);
}
//悬停
else if (isInRect) {
L_sq_DrawImg(Path, Idx, X, Y);
}
//普通
else {
L_sq_DrawImg(Path, Idx, X, Y);
}
}
}
//鼠标左键按下回调
function OnMouseLbDown(MousePos_X, MousePos_Y) {
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) isLBDown = true;
}
//鼠标左键弹起回调 overr
function OnMouseLbUp(MousePos_X, MousePos_Y) {
if (isLBDown && OnClick) {
local obj = sq_getMyCharacter();
obj.sq_PlaySound("CLICK_BUTTON1");
OnClick(this);
}
isLBDown = false;
}
}
class Rindro_Event extends LenheartNewUI_Windows {
//调试模式
// DeBugMode = true;
EventFlag = true;
//不是窗口
NoWindow = true;
//显示标志位
PosIdx = null;
//闪烁透明度
Alpha = 250;
//闪烁模式
BlinkMode = false;
//时间
Timer = 0;
//是否可见
Visible = true;
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
Timer = Clock();
}
//绘制主界面
function DrawMain(obj) {
local RT = Clock() - Timer;
//根据模式调整透明度
if (!BlinkMode) Alpha = sq_GetUniformVelocity(250, 130, RT, 500);
else Alpha = sq_GetUniformVelocity(130, 250, RT, 500);
//转换模式
if (RT >= 500) {
Timer = Clock();
BlinkMode = !BlinkMode;
}
L_sq_SetDrawImgModel(2, 0);
L_sq_DrawImg("interface2/yosin/eventsystemeff.img", 0, X, Y, 1, sq_RGBA(255, 255, 255, Alpha), 1.0, 1.0);
L_sq_ReleaseDrawImgModel();
}
function Show(obj) {
// DrawMain(obj);
// LenheartNewUI_Windows.Show(obj);
}
function EventShow(obj) {
DrawMain(obj);
LenheartNewUI_Windows.Show(obj);
}
function TopShow(obj) {
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X, Y, 20, 20)) {
L_sq_DrawImg("interface2/yosin/eventsystem.img", 0, X - 7, Y - 24);
local Len = ObjectId.len() / 3;
for (local i = 0; i< Len; i++) {
L_sq_DrawImg("interface2/yosin/eventsystem.img", 1, X - 2 + (15 * i), Y - 24);
}
L_sq_DrawImg("interface2/yosin/eventsystem.img", 2, X - 2 + (15 * Len - 1), Y - 24);
L_sq_DrawCode(ObjectId, X + 5, Y - 17, sq_RGBA(255, 255, 255, 250), 0, 1);
}
}
function SyncEventIcon() {
local Count = L_sq_RA(L_sq_RA(0x1A39C2C) + 0x6c);
X = EventList_Obj.X + (((Count + PosIdx) % 8) * 20);
Y = EventList_Obj.Y - ((Count + PosIdx) / 8) * 20;
}
//逻辑入口
function Proc(obj) {
//同步图标位置
SyncEventIcon();
LenheartNewUI_Windows.SyncPos(X, Y);
}
}
class Rindro_EventList {
X = 0;
Y = 0;
//活动数组
Events = null;
function YosinEventIconInfoCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
X = Jso.YosinEventIconInfoXpos;
Y = Jso.YosinEventIconInfoYpos;
getroottable()["LenheartEventOffset"] <- {
x = X - 456,
y = Y
};
}
constructor() {
Events = [];
Pack_Control.rawset(30002, YosinEventIconInfoCallBack.bindenv(this));
}
//添加活动
function AddEvent(Name, Idx, WindowObject, ...) {
local Window = LenheartNewUI_CreateWindow(Rindro_Event, Name, 0, 0, 20, 20, 0)
local Flag = Events.len();
local ImgPath = "interface2/yosin/eventsystemlist.img";
if (vargc == 1) ImgPath = vargv[0];
local ButtonBuf = LenheartNewUI_EventButton(0, 0, ImgPath, Idx);
ButtonBuf.BindObj = WindowObject;
ButtonBuf.ShowName = Name;
ButtonBuf.OnClick = function(B_obj) {
if (B_obj.BindObj) B_obj.BindObj.OpenCallBack();
}.bindenv(this);
Window.AddChild(ButtonBuf);
Window.PosIdx = Events.len();
Events.append(Window);
}
//检测是否悬停活动图标
function CheckInEvent(MousePos_X, MousePos_Y) {
if (sq_GetPopupWindowMainCotrol(244)) return;
foreach(Window in Events) {
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, Window.X, Window.Y, Window.Width, Window.Height)) {
getroottable().WindowsShowABFlag <- true;
}
}
}
}
getroottable().rawdelete("EventList_Obj")
function Lenheart_EventList_Fun(obj) {
local RootTab = getroottable();
if (!RootTab.rawin("EventList_Obj")) {
RootTab.rawset("EventList_Obj", Rindro_EventList());
}
}
//获取活动图标坐标 在活动图标变动时会被调用
function Sq_Get_Event_Pos_X() {
if (getroottable().rawin("LenheartEventOffset")) {
return getroottable()["LenheartEventOffset"].x;
} else {
getroottable()["LenheartEventOffset"] <- {
x = 277,
y = 530
};
return getroottable()["LenheartEventOffset"].x;
}
}
function Sq_Get_Event_Pos_Y() {
if (getroottable().rawin("LenheartEventOffset")) {
return getroottable()["LenheartEventOffset"].y;
} else {
getroottable()["LenheartEventOffset"] <- {
x = 277,
y = 530
};
return getroottable()["LenheartEventOffset"].y;
}
}
/*
//活动图标类
class Rindro_EventIcon extends LenheartNewUI_CommonUi {
//Key
Key = null;
//活动图标文字
EventStr = null;
//活动图标Ani编号
EventFrame = null;
//绑定对象
BandObject = null;
//图标img路径
ImgPath = "interface2/yosin/eventsystemlist.img";
x = null;
y = null;
constructor(gEventStr, gEventFrame, gKey, gBandObject) {
this.EventStr = gEventStr;
this.EventFrame = gEventFrame;
this.Key = gKey;
this.BandObject = gBandObject;
local RootTab = getroottable();
if (RootTab.rawin("YosinEventSystem")) {
local Arr = RootTab["YosinEventSystem"];
local TryAppend = true;
local wpos;
foreach(pos, value in Arr) {
if (value.Key == this.Key) {
TryAppend = false;
wpos = pos;
}
}
if (TryAppend) {
Arr.append(this);
RootTab.rawset("YosinEventSystem", Arr);
} else {
Arr[wpos] = this;
RootTab.rawset("YosinEventSystem", Arr);
}
} else {
local Arr = [];
Arr.append(this);
RootTab.rawset("YosinEventSystem", Arr);
}
}
function Show(obj, X, Y) {
x = X;
y = Y;
//绘制框
T_DrawDynamicAni(obj, "common/yosinevent/eventsystemeff.ani", X, Y, "YosinEventIconEffA");
try {
if (isLBDown()) {
//绘制活动图标
L_sq_DrawImg(ImgPath, EventFrame, X, Y + 1);
//T_DrawStayAni(obj, "common/yosinevent/eventsystemlist.ani", X, Y + 1, EventFrame, "YosinEventIconKey" + Key);
} else {
//绘制活动图标
L_sq_DrawImg(ImgPath, EventFrame, X, Y);
}
} catch (exception) {
if (isLBDown()) {
//绘制活动图标
T_DrawStayAni(obj, "common/yosinevent/eventsystemlist.ani", X, Y + 1, EventFrame, "YosinEventIconKey" + Key);
} else {
//绘制活动图标
T_DrawStayAni(obj, "common/yosinevent/eventsystemlist.ani", X, Y, EventFrame, "YosinEventIconKey" + Key);
}
}
}
function StrShow(obj, X, Y) {
//悬停
if (isInRect() && EventStr) {
local count = EventStr.len() / 3;
T_DrawStayAni(obj, "common/yosinevent/eventsystem.ani", X - (count * 7), Y - 24, 0, "YosinEventIconStrEffL");
for (local i = 0; i< count; i++) {
T_DrawStayAni(obj, "common/yosinevent/eventsystem.ani", X - (count * 7) + 5 + (i * 15), Y - 24, 1, "YosinEventIconStrEffZ");
}
T_DrawStayAni(obj, "common/yosinevent/eventsystem.ani", X - (count * 7) + 5 + (count * 15), Y - 24, 2, "YosinEventIconStrEffR");
L_sq_DrawCode(EventStr, X - (count * 4), Y - 17, sq_RGBA(255, 255, 255, 250), 0, 1);
}
if (isLBActive()) {
BandObject.MainState = true;
BandObject.OpenClassCallBack();
}
}
//悬停状态
function isInRect() {
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, x, y, 20, 20)) return true;
else return false;
}
//左键按下状态
function isLBDown() {
if (isInRect() && Mobj.Lb == 1) return true;
else return false;
}
//左键弹起状态
function isLBUp() {
if (isInRect() && Mobj.Lb == 0) return true;
else return false;
}
//左键单击状态
function isLBActive() {
if (isInRect() && Mobj.LbEvent) return true;
else return false;
}
}
*/

File diff suppressed because it is too large Load Diff

52
Base/UI/OldWindowsMap.nut Normal file
View File

@@ -0,0 +1,52 @@
/*
文件名:OldWindowsMap.nut
路径:Base/UI/OldWindowsMap.nut
创建日期:2024-08-06 18:56
文件用途:用于查询是否鼠标悬停在原生窗口上的Flag 以下编号代表着没有悬停其他均为悬停在原生窗口
*/
NotOldWindowsMap <- {}
NotOldWindowsMap.rawset(92, 1);
NotOldWindowsMap.rawset(79, 1);
NotOldWindowsMap.rawset(2395, 1);
NotOldWindowsMap.rawset(2396, 1);
NotOldWindowsMap.rawset(3877, 1);
NotOldWindowsMap.rawset(3878, 1);
NotOldWindowsMap.rawset(3873, 1);
NotOldWindowsMap.rawset(3874, 1);
NotOldWindowsMap.rawset(3858, 1);
NotOldWindowsMap.rawset(3871, 1);
NotOldWindowsMap.rawset(3857, 1);
NotOldWindowsMap.rawset(3861, 1);
NotOldWindowsMap.rawset(3862, 1);
NotOldWindowsMap.rawset(93, 1);
NotOldWindowsMap.rawset(94, 1);
NotOldWindowsMap.rawset(95, 1);
NotOldWindowsMap.rawset(96, 1);
NotOldWindowsMap.rawset(97, 1);
NotOldWindowsMap.rawset(98, 1);
NotOldWindowsMap.rawset(99, 1);
NotOldWindowsMap.rawset(100, 1);
NotOldWindowsMap.rawset(101, 1);
NotOldWindowsMap.rawset(114, 1);
NotOldWindowsMap.rawset(88, 1);
NotOldWindowsMap.rawset(102, 1);
NotOldWindowsMap.rawset(108, 1);
NotOldWindowsMap.rawset(109, 1);
NotOldWindowsMap.rawset(103, 1);
NotOldWindowsMap.rawset(104, 1);
NotOldWindowsMap.rawset(110, 1);
NotOldWindowsMap.rawset(111, 1);
NotOldWindowsMap.rawset(105, 1);
NotOldWindowsMap.rawset(106, 1);
NotOldWindowsMap.rawset(112, 1);
NotOldWindowsMap.rawset(113, 1);
NotOldWindowsMap.rawset(107, 1);
NotOldWindowsMap.rawset(87, 1);
NotOldWindowsMap.rawset(86, 1);
NotOldWindowsMap.rawset(80, 1);
NotOldWindowsMap.rawset(81, 1);
NotOldWindowsMap.rawset(82, 1);
NotOldWindowsMap.rawset(83, 1);
NotOldWindowsMap.rawset(4067, 1);
NotOldWindowsMap.rawset(122, 1);
NotOldWindowsMap.rawset(120, 1);