111
This commit is contained in:
32
Base/CallBack/DrawHudMain.nut
Normal file
32
Base/CallBack/DrawHudMain.nut
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
文件名:DrawHudMain.nut
|
||||
路径:Base/CallBack/DrawHudMain.nut
|
||||
创建日期:2024-08-29 09:39
|
||||
文件用途:血槽绘制入口(图层在血槽层)
|
||||
*/
|
||||
function L_HUD_BloodBackground() {
|
||||
local RootTab = getroottable();
|
||||
local obj = sq_getMyCharacter();
|
||||
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;
|
||||
|
||||
function L_Sync_Camera_Pos(Xpos) {
|
||||
getroottable().Camera_Pos = Xpos;
|
||||
// print(Xpos);
|
||||
}
|
||||
|
||||
|
||||
function Sq_DrawChannel() {
|
||||
// L_sq_DrawImg("interface2/cs_shop/cs_packageevent/2021_summer/hearoursummer_calendarui.img", 0, 0, 0);
|
||||
print(Clock());
|
||||
}
|
||||
162
Base/CallBack/DrawMain.nut
Normal file
162
Base/CallBack/DrawMain.nut
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
文件名:DrawMain.nut
|
||||
路径:Base/CallBack/DrawMain.nut
|
||||
创建日期:2024-08-06 18:58
|
||||
文件用途:绘制回调
|
||||
*/
|
||||
//在DrawMain后面调用
|
||||
function L_drawMainCustomUI_All() {
|
||||
local obj = sq_getMyCharacter();
|
||||
if (!obj) return;
|
||||
|
||||
local RootTab = getroottable();
|
||||
//下帧执行任务事件
|
||||
if (RootTab.rawin("LenheartNextFrameFuncTab")) {
|
||||
foreach(Func in RootTab["LenheartNextFrameFuncTab"]) {
|
||||
Func();
|
||||
}
|
||||
RootTab["LenheartNextFrameFuncTab"] = [];
|
||||
} else {
|
||||
RootTab.LenheartNextFrameFuncTab <- [];
|
||||
}
|
||||
|
||||
//重载逻辑
|
||||
try {
|
||||
local Func = loadfile("Yosin_Game_Reloading.Sign", true);
|
||||
Func();
|
||||
L_Cmd("cmd.exe /c del Yosin_Game_Reloading.Sign");
|
||||
//清空窗口
|
||||
L_Windows_List = [];
|
||||
//清空活动图标窗口
|
||||
getroottable().rawdelete("EventList_Obj");
|
||||
//清空插件初始化状态
|
||||
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||||
|
||||
getroottable().rawdelete("RINDRO_GET_ITEM_FLAG");
|
||||
//特殊清空
|
||||
getroottable().rawdelete("OnlineAnnouncement_Obj");
|
||||
//血槽UI
|
||||
getroottable().rawdelete("HudUi_Obj");
|
||||
|
||||
//战令
|
||||
getroottable().rawdelete("AradPass_Obj");
|
||||
//战斗力系统
|
||||
getroottable().rawdelete("CombatRankC_Obj");
|
||||
//刷图签到
|
||||
getroottable().rawdelete("FightSign_Obj");
|
||||
//希曼音乐会
|
||||
getroottable().rawdelete("MidsummerParty_Obj");
|
||||
//在线签到
|
||||
getroottable().rawdelete("OnilneSign_Obj");
|
||||
//全服竞拍
|
||||
getroottable().rawdelete("ServerAuction_Obj");
|
||||
|
||||
} catch (exception) {
|
||||
if (exception != "cannot open the file")
|
||||
print("Reloading Script Fail !!! \n" + exception);
|
||||
}
|
||||
|
||||
//
|
||||
local RootTab = getroottable();
|
||||
|
||||
|
||||
//尝试调用百级UI
|
||||
// if (getroottable().rawin("Lenheart_100UI_Event_BackGround")) Lenheart_100UI_Event_BackGround();
|
||||
// if (getroottable().rawin("Lenheart_100UI")) Lenheart_100UI(obj);
|
||||
|
||||
//初始化活动图标
|
||||
Lenheart_EventList_Fun(obj);
|
||||
|
||||
//加载注册Base函数窗口
|
||||
if (RootTab.rawin("LenheartBaseFuncTab")) {
|
||||
if (RINDRO_INIT_FLAG) {
|
||||
local LenheartFunc = RootTab["LenheartBaseFuncTab"];
|
||||
foreach(Func in LenheartFunc) {
|
||||
Func(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//加载注册Ex函数窗口
|
||||
if (RootTab.rawin("LenheartFuncTab")) {
|
||||
if (RINDRO_INIT_FLAG) {
|
||||
local LenheartFunc = RootTab["LenheartFuncTab"];
|
||||
foreach(Func in LenheartFunc) {
|
||||
Func(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//所有插件初始化完毕
|
||||
if (!getroottable().rawin("LenheartPluginsInitFlag")) {
|
||||
if (RINDRO_INIT_FLAG) {
|
||||
local T = {
|
||||
op = 25001021,
|
||||
}
|
||||
Rindro_BaseToolClass.SendPackEx(T);
|
||||
getroottable().LenheartPluginsInitFlag <- true;
|
||||
}
|
||||
}
|
||||
|
||||
//初始化Item信息
|
||||
if (!getroottable().rawin("RINDRO_GET_ITEM_FLAG")) {
|
||||
getroottable().RINDRO_GET_ITEM_FLAG <- true;
|
||||
Rindro_BaseToolClass.SendPackEx({
|
||||
op = 20069005,
|
||||
md5 = Rindro_GetMd5()
|
||||
});
|
||||
}
|
||||
|
||||
// if (Clock() - getroottable().Lsnzz >= 50) {
|
||||
// getroottable().Lsnzz = Clock();
|
||||
// local T = {
|
||||
// op = 25001021,
|
||||
// }
|
||||
// Rindro_BaseToolClass.SendPackEx(T);
|
||||
// }
|
||||
|
||||
// if (!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "appendage/curreny.nut")) {
|
||||
// local appendage1 = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, 174, false, "appendage/curreny.nut", true);
|
||||
// }
|
||||
|
||||
// print(format("%02X", L_sq_RA(0x1B474D4)));
|
||||
// print(R_Mouse.IsLock());
|
||||
// print(format("%02X", L_sq_RA(0x3431de00 + 0x14)));
|
||||
// L_sq_WA(0x3431de00 + 0x14,200);
|
||||
// print(format("%02X", L_sq_RA(0x1AE94C4, "0x590+0x44+")));
|
||||
//外界主界面
|
||||
// if(L_sq_RA(0x1B474D4) == 0x3C7FB100)print(true);
|
||||
// else print(false);
|
||||
// print(CheckInOldW());
|
||||
// GetTownBaseBackgroundAddress();
|
||||
|
||||
// print(getroottable().WindowsShowABFlag);
|
||||
|
||||
// L_Sq_GetPlayerEachName();
|
||||
// Sout("%L",L_Sq_GetPlayerEachName());
|
||||
// print(Rindro_BaseToolClass.GetEachNpcId());
|
||||
|
||||
|
||||
|
||||
// local EachCount = 0;
|
||||
// local EachClassObject = L_sq_RA(0x1ADE0E0);
|
||||
// if (EachClassObject) {
|
||||
// local FristChildOffset = (EachClassObject + 0x68);
|
||||
// for (local i = 0; i< 74; i++) {
|
||||
// local AddressBuf = FristChildOffset + (4 * i);
|
||||
// local ChildAddress = L_sq_RA(AddressBuf);
|
||||
// if (ChildAddress) {
|
||||
// local OpenFlag = L_sq_RA(ChildAddress + 0xC);
|
||||
// if (OpenFlag == 257) EachCount++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// print(EachCount);
|
||||
|
||||
// for (local i = 0; i< 400; i++) {
|
||||
// local WindowAddress = L_sq_GetWindowById(i);
|
||||
// if (WindowAddress != 0) print(format("%02X", WindowAddress));
|
||||
// if (WindowAddress == 0x39F56000) print(i);
|
||||
// }
|
||||
}
|
||||
// getroottable().Lsnzz <- Clock();
|
||||
72
Base/CallBack/GetDamageRate.nut
Normal file
72
Base/CallBack/GetDamageRate.nut
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
文件名:GetDamageRate.nut
|
||||
路径:Base/CallBack/GetDamageRate.nut
|
||||
创建日期:2024-08-09 14:10
|
||||
文件用途:获取伤害倍率
|
||||
*/
|
||||
function L_getCurrentModuleDamageRate(obj) {
|
||||
if (!obj)
|
||||
return 1.0;
|
||||
local rate;
|
||||
if (getroottable().rawin("LenheartCurrentModuleDamageRate")) {
|
||||
rate = 1.0 + getroottable()["LenheartCurrentModuleDamageRate"];
|
||||
} else {
|
||||
rate = 1.0;
|
||||
}
|
||||
|
||||
//超时空伤害
|
||||
if (getroottable().rawin("LenheartFiendModuleDamageRate")) {
|
||||
rate *= getroottable()["LenheartFiendModuleDamageRate"];
|
||||
} else {
|
||||
rate *= 1.0;
|
||||
}
|
||||
|
||||
//pvf伤害
|
||||
local ClientRat = 1.0;
|
||||
try {
|
||||
ClientRat = getCurrentModuleDamageRate(obj).tofloat();
|
||||
} catch (exception) {
|
||||
ClientRat = 1.0;
|
||||
}
|
||||
|
||||
//副本伤害控制
|
||||
try {
|
||||
local stage = sq_GetGlobaludpModuleStage();
|
||||
local dungeon = sq_GetDungeonByStage(stage);
|
||||
local dungeonIndex = sq_GetDuegonIndex(dungeon);
|
||||
local fbsh = 100;
|
||||
|
||||
foreach(id in DungeonIndex) {
|
||||
if (dungeonIndex == id[0]) {
|
||||
fbsh = id[1];
|
||||
}
|
||||
}
|
||||
local nrate = fbsh.tofloat() / 100.0;
|
||||
rate = rate.tofloat() * nrate;
|
||||
} catch (exception) {
|
||||
|
||||
}
|
||||
|
||||
//职业伤害控制
|
||||
try {
|
||||
local LLJob = sq_getJob(obj);
|
||||
local LLGrowT = sq_getGrowType(obj);
|
||||
|
||||
local LLLen = GrowType.len();
|
||||
for (local i = 0; i< 11; ++i) {
|
||||
if (i == LLLen) break;
|
||||
if (LLJob == i) {
|
||||
foreach(GR in GrowType[i]) {
|
||||
if (LLGrowT == GR[0])
|
||||
rate = rate.tofloat() * GR[1].tofloat();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (exception) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return (rate * ClientRat);
|
||||
}
|
||||
39
Base/CallBack/PushDamage.nut
Normal file
39
Base/CallBack/PushDamage.nut
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
文件名:PushDamage.nut
|
||||
路径:Base/CallBack/PushDamage.nut
|
||||
创建日期:2024-08-30 14:41
|
||||
文件用途:发生伤害时
|
||||
*/
|
||||
PushDamageFontDataFuncTab <- {};
|
||||
PushDamageFontFuncTab <- {};
|
||||
|
||||
function Sq_PushDamageData(ObjAddress, MySelfAddress, Value) {
|
||||
// print("MyCharacter: " + format("%02x", L_sq_RA(0x1AB7CDC)));
|
||||
// print("ObjAddress: " + format("%02x", ObjAddress));
|
||||
// print("A1: " + format("%02x", A1));
|
||||
// print("A2: " + format("%02x", A2));
|
||||
// print(" ");
|
||||
foreach(Func in PushDamageFontFuncTab) {
|
||||
Func(ObjAddress, MySelfAddress, Value);
|
||||
}
|
||||
}
|
||||
|
||||
function Sq_PushDamageFontData(ObjAddress, X, Y, Z, Value, Type, A1, A2) {
|
||||
// print("MyCharacter: " + format("%02x", L_sq_RA(0x1AB7CDC)));
|
||||
// print("ObjAddress: " + format("%02x", ObjAddress));
|
||||
// print("A1: " + format("%02x", A1));
|
||||
// print("A2: " + format("%02x", A2));
|
||||
// print(" ");
|
||||
|
||||
// if (A2)
|
||||
// print(format("%02x", L_Sq_GetObjectIsCharacter(A2)));
|
||||
local Flag = true;
|
||||
foreach(Func in PushDamageFontDataFuncTab) {
|
||||
local Ret = Func(ObjAddress, X, Y, Z, Value, Type, A1, A2);
|
||||
if (Ret == false) {
|
||||
Flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
return Flag;
|
||||
}
|
||||
71
Base/CallBack/Window_Get.nut
Normal file
71
Base/CallBack/Window_Get.nut
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
文件名:Window_Get.nut
|
||||
路径:Base/CallBack/Window_Get.nut
|
||||
创建日期:2024-08-08 13:38
|
||||
文件用途:窗口被获取时经过的函数
|
||||
*/
|
||||
getroottable().RindroOneRunTable <- {};
|
||||
|
||||
function OneRunCode(Func, Key, Window_Obj) {
|
||||
if (!RindroOneRunTable.rawin(Key)) {
|
||||
Func(Window_Obj);
|
||||
RindroOneRunTable.rawset(Key, true);
|
||||
}
|
||||
}
|
||||
|
||||
function L_Old_Window_Get(Window_Obj) {
|
||||
// print(L_sq_RA(Window_Obj + 0xC));
|
||||
// L_sq_WA(Window_Obj + 0xC,257);
|
||||
// L_sq_RA(Window_Obj, "0xC+");
|
||||
|
||||
// if (L_sq_RA(Window_Obj + 0x14) == 0) {
|
||||
// print(L_sq_RA(Window_Obj + 0x18));
|
||||
// print(format("%02x", Window_Obj));
|
||||
// }
|
||||
|
||||
// if (0x422e2100 == Window_Obj) {
|
||||
// print(L_sq_RA(Window_Obj + 0x14));
|
||||
// }
|
||||
|
||||
|
||||
// OneRunCode(function(Window_Obj) {
|
||||
// if (0x185242C == L_sq_RA(Window_Obj)) {
|
||||
// //任务提示
|
||||
// if (L_sq_RAB(Window_Obj + 0x78) == 131 && L_sq_RAB(Window_Obj + 0x79) == 2) {
|
||||
// L_sq_WA(Window_Obj + 0x14, 144);
|
||||
// L_sq_WA(Window_Obj + 0x18, 53);
|
||||
// }
|
||||
// }
|
||||
// }, "任务提示设置", Window_Obj);
|
||||
|
||||
|
||||
// //任务提示
|
||||
// if (0x185242C == L_sq_RA(Window_Obj)) {
|
||||
// if (L_sq_RA(Window_Obj + 0x44) == 131 && L_sq_RAB(Window_Obj + 0x79) == 2) {
|
||||
// L_sq_WA(Window_Obj + 0x14, 144);
|
||||
// L_sq_WA(Window_Obj + 0x18, 53);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// if(369 == L_sq_RA(Window_Obj + 0x78))
|
||||
// print(format("%02X", Window_Obj));
|
||||
}
|
||||
|
||||
|
||||
//窗口是否打开
|
||||
function L_Old_Window_Visible(WindowObject, Flag) {
|
||||
// print(format("%02X", WindowObject));
|
||||
|
||||
// if (Character_Info_Window_Address.rawin(WindowObject)) {
|
||||
// L_sq_WAB(WindowObject + 0xc, 0);
|
||||
// // print(L_sq_RA(WindowObject + 0x14));
|
||||
// // print(format("%02X", WindowObject));
|
||||
// }
|
||||
// print(1213);
|
||||
// foreach(Key, Table in Character_Info_Window_Address) {
|
||||
// L_sq_WA(Key + 0xC, 256);
|
||||
// // print(format("%02X", Key));
|
||||
// }
|
||||
}
|
||||
38
Base/PackControl/PackControl.nut
Normal file
38
Base/PackControl/PackControl.nut
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
文件名:PackControl.nut
|
||||
路径:Base/PackControl/PackControl.nut
|
||||
创建日期:2024-08-06 22:13
|
||||
文件用途:
|
||||
*/
|
||||
Pack_Control <- {}
|
||||
|
||||
function Sq_Pack_Control(Chunk) {
|
||||
try {
|
||||
local Pack_Json = Json.Decode(Chunk);
|
||||
if (Pack_Control.rawin(Pack_Json.op)) {
|
||||
try {
|
||||
Pack_Control[Pack_Json.op](Chunk);
|
||||
} catch (exception) {
|
||||
print("error pack: " + Pack_Json.op);
|
||||
}
|
||||
}
|
||||
} catch (exception) {
|
||||
print("error packmsg: " + Pack_Json.op);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Sq_Pack_ControlLocal(Chunk) {
|
||||
local Pack_Json = Json.Decode(Chunk);
|
||||
if (Pack_Control.rawin(Pack_Json.op)) Pack_Control[Pack_Json.op](Chunk);
|
||||
}
|
||||
|
||||
|
||||
//进入副本回调
|
||||
function LenheartGotoDgnCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
local DgnId = Jso.map.id;
|
||||
local DgnRate = Jso.map.ra;
|
||||
L_sq_GoDungeon(DgnId);
|
||||
}
|
||||
Pack_Control.rawset(2024041602, LenheartGotoDgnCallBack);
|
||||
85
Base/UI/Lenheart_Ani_Class.nut
Normal file
85
Base/UI/Lenheart_Ani_Class.nut
Normal 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;
|
||||
}
|
||||
}
|
||||
512
Base/UI/Lenheart_Character_Info_Class.nut
Normal file
512
Base/UI/Lenheart_Character_Info_Class.nut
Normal 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);
|
||||
359
Base/UI/Lenheart_Event_Class.nut
Normal file
359
Base/UI/Lenheart_Event_Class.nut
Normal 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;
|
||||
}
|
||||
}
|
||||
*/
|
||||
1100
Base/UI/Lenheart_UI_Class.nut
Normal file
1100
Base/UI/Lenheart_UI_Class.nut
Normal file
File diff suppressed because it is too large
Load Diff
52
Base/UI/OldWindowsMap.nut
Normal file
52
Base/UI/OldWindowsMap.nut
Normal 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);
|
||||
241
Base/_ENUM/_ENUM_KEY.nut
Normal file
241
Base/_ENUM/_ENUM_KEY.nut
Normal file
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
文件名:_ENUM_KEY.nut
|
||||
路径:Base/_ENUM/_ENUM_KEY.nut
|
||||
创建日期:2024-08-06 22:09
|
||||
文件用途:按键枚举类
|
||||
*/
|
||||
//反遍历
|
||||
L_sq_WA(0x1370FD7, 0);
|
||||
DIK_ESCAPE <- 0x01
|
||||
DIK_1 <- 0x02
|
||||
DIK_2 <- 0x03
|
||||
DIK_3 <- 0x04
|
||||
DIK_4 <- 0x05
|
||||
DIK_5 <- 0x06
|
||||
DIK_6 <- 0x07
|
||||
DIK_7 <- 0x08
|
||||
DIK_8 <- 0x09
|
||||
DIK_9 <- 0x0A
|
||||
DIK_0 <- 0x0B
|
||||
DIK_MINUS <- 0x0C /* - on main keyboard */
|
||||
DIK_EQUALS <- 0x0D
|
||||
DIK_BACK <- 0x0E /* backspace */
|
||||
DIK_TAB <- 0x0F
|
||||
DIK_Q <- 0x10
|
||||
DIK_W <- 0x11
|
||||
DIK_E <- 0x12
|
||||
DIK_R <- 0x13
|
||||
DIK_T <- 0x14
|
||||
DIK_Y <- 0x15
|
||||
DIK_U <- 0x16
|
||||
DIK_I <- 0x17
|
||||
DIK_O <- 0x18
|
||||
DIK_P <- 0x19
|
||||
DIK_LBRACKET <- 0x1A
|
||||
DIK_RBRACKET <- 0x1B
|
||||
DIK_RETURN <- 0x1C /* Enter on main keyboard */
|
||||
DIK_LCONTROL <- 0x1D
|
||||
DIK_A <- 0x1E
|
||||
DIK_S <- 0x1F
|
||||
DIK_D <- 0x20
|
||||
DIK_F <- 0x21
|
||||
DIK_G <- 0x22
|
||||
DIK_H <- 0x23
|
||||
DIK_J <- 0x24
|
||||
DIK_K <- 0x25
|
||||
DIK_L <- 0x26
|
||||
DIK_SEMICOLON <- 0x27
|
||||
DIK_APOSTROPHE <- 0x28
|
||||
DIK_GRAVE <- 0x29 /* accent grave */
|
||||
DIK_LSHIFT <- 0x2A
|
||||
DIK_BACKSLASH <- 0x2B
|
||||
DIK_Z <- 0x2C
|
||||
DIK_X <- 0x2D
|
||||
DIK_C <- 0x2E
|
||||
DIK_V <- 0x2F
|
||||
DIK_B <- 0x30
|
||||
DIK_N <- 0x31
|
||||
DIK_M <- 0x32
|
||||
DIK_COMMA <- 0x33
|
||||
DIK_PERIOD <- 0x34 /* . on main keyboard */
|
||||
DIK_SLASH <- 0x35 /* / on main keyboard */
|
||||
DIK_RSHIFT <- 0x36
|
||||
DIK_MULTIPLY <- 0x37 /* * on numeric keypad */
|
||||
DIK_LMENU <- 0x38 /* left Alt */
|
||||
DIK_SPACE <- 0x39
|
||||
DIK_CAPITAL <- 0x3A
|
||||
DIK_F1 <- 0x3B
|
||||
DIK_F2 <- 0x3C
|
||||
DIK_F3 <- 0x3D
|
||||
DIK_F4 <- 0x3E
|
||||
DIK_F5 <- 0x3F
|
||||
DIK_F6 <- 0x40
|
||||
DIK_F7 <- 0x41
|
||||
DIK_F8 <- 0x42
|
||||
DIK_F9 <- 0x43
|
||||
DIK_F10 <- 0x44
|
||||
DIK_NUMLOCK <- 0x45
|
||||
DIK_SCROLL <- 0x46 /* Scroll Lock */
|
||||
DIK_NUMPAD7 <- 0x47
|
||||
DIK_NUMPAD8 <- 0x48
|
||||
DIK_NUMPAD9 <- 0x49
|
||||
DIK_SUBTRACT <- 0x4A /* - on numeric keypad */
|
||||
DIK_NUMPAD4 <- 0x4B
|
||||
DIK_NUMPAD5 <- 0x4C
|
||||
DIK_NUMPAD6 <- 0x4D
|
||||
DIK_ADD <- 0x4E /* + on numeric keypad */
|
||||
DIK_NUMPAD1 <- 0x4F
|
||||
DIK_NUMPAD2 <- 0x50
|
||||
DIK_NUMPAD3 <- 0x51
|
||||
DIK_NUMPAD0 <- 0x52
|
||||
DIK_DECIMAL <- 0x53 /* . on numeric keypad */
|
||||
DIK_OEM_102 <- 0x56 /* <> or \| on RT 102-key keyboard (Non-U.S.) */
|
||||
DIK_F11 <- 0x57
|
||||
DIK_F12 <- 0x58
|
||||
DIK_F13 <- 0x64 /* (NEC PC98) */
|
||||
DIK_F14 <- 0x65 /* (NEC PC98) */
|
||||
DIK_F15 <- 0x66 /* (NEC PC98) */
|
||||
DIK_KANA <- 0x70 /* (Japanese keyboard) */
|
||||
DIK_ABNT_C1 <- 0x73 /* /? on Brazilian keyboard */
|
||||
DIK_CONVERT <- 0x79 /* (Japanese keyboard) */
|
||||
DIK_NOCONVERT <- 0x7B /* (Japanese keyboard) */
|
||||
DIK_YEN <- 0x7D /* (Japanese keyboard) */
|
||||
DIK_ABNT_C2 <- 0x7E /* Numpad . on Brazilian keyboard */
|
||||
DIK_NUMPADEQUALS <- 0x8D /* = on numeric keypad (NEC PC98) */
|
||||
DIK_PREVTRACK <- 0x90 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */
|
||||
DIK_AT <- 0x91 /* (NEC PC98) */
|
||||
DIK_COLON <- 0x92 /* (NEC PC98) */
|
||||
DIK_UNDERLINE <- 0x93 /* (NEC PC98) */
|
||||
DIK_KANJI <- 0x94 /* (Japanese keyboard) */
|
||||
DIK_STOP <- 0x95 /* (NEC PC98) */
|
||||
DIK_AX <- 0x96 /* (Japan AX) */
|
||||
DIK_UNLABELED <- 0x97 /* (J3100) */
|
||||
DIK_NEXTTRACK <- 0x99 /* Next Track */
|
||||
DIK_NUMPADENTER <- 0x9C /* Enter on numeric keypad */
|
||||
DIK_RCONTROL <- 0x9D
|
||||
DIK_MUTE <- 0xA0 /* Mute */
|
||||
DIK_CALCULATOR <- 0xA1 /* Calculator */
|
||||
DIK_PLAYPAUSE <- 0xA2 /* Play / Pause */
|
||||
DIK_MEDIASTOP <- 0xA4 /* Media Stop */
|
||||
DIK_VOLUMEDOWN <- 0xAE /* Volume - */
|
||||
DIK_VOLUMEUP <- 0xB0 /* Volume + */
|
||||
DIK_WEBHOME <- 0xB2 /* Web home */
|
||||
DIK_NUMPADCOMMA <- 0xB3 /* , on numeric keypad (NEC PC98) */
|
||||
DIK_DIVIDE <- 0xB5 /* / on numeric keypad */
|
||||
DIK_SYSRQ <- 0xB7
|
||||
DIK_RMENU <- 0xB8 /* right Alt */
|
||||
DIK_PAUSE <- 0xC5 /* Pause */
|
||||
DIK_HOME <- 0xC7 /* Home on arrow keypad */
|
||||
DIK_UP <- 0xC8 /* UpArrow on arrow keypad */
|
||||
DIK_PRIOR <- 0xC9 /* PgUp on arrow keypad */
|
||||
DIK_LEFT <- 0xCB /* LeftArrow on arrow keypad */
|
||||
DIK_RIGHT <- 0xCD /* RightArrow on arrow keypad */
|
||||
DIK_END <- 0xCF /* End on arrow keypad */
|
||||
DIK_DOWN <- 0xD0 /* DownArrow on arrow keypad */
|
||||
DIK_NEXT <- 0xD1 /* PgDn on arrow keypad */
|
||||
DIK_INSERT <- 0xD2 /* Insert on arrow keypad */
|
||||
DIK_DELETE <- 0xD3 /* Delete on arrow keypad */
|
||||
DIK_LWIN <- 0xDB /* Left Windows key */
|
||||
DIK_RWIN <- 0xDC /* Right Windows key */
|
||||
DIK_APPS <- 0xDD /* AppMenu key */
|
||||
DIK_POWER <- 0xDE /* System Power */
|
||||
DIK_SLEEP <- 0xDF /* System Sleep */
|
||||
DIK_WAKE <- 0xE3 /* System Wake */
|
||||
DIK_WEBSEARCH <- 0xE5 /* Web Search */
|
||||
DIK_WEBFAVORITES <- 0xE6 /* Web Favorites */
|
||||
DIK_WEBREFRESH <- 0xE7 /* Web Refresh */
|
||||
DIK_WEBSTOP <- 0xE8 /* Web Stop */
|
||||
DIK_WEBFORWARD <- 0xE9 /* Web Forward */
|
||||
DIK_WEBBACK <- 0xEA /* Web Back */
|
||||
DIK_MYCOMPUTER <- 0xEB /* My Computer */
|
||||
DIK_MAIL <- 0xEC /* Mail */
|
||||
DIK_MEDIASELECT <- 0xED /* Media Select */
|
||||
|
||||
function Rindro_GetEquAddr(addr) {
|
||||
switch (addr) {
|
||||
case 1:
|
||||
return 0x3038;
|
||||
break;
|
||||
case 2:
|
||||
return 0x304C;
|
||||
break;
|
||||
case 3:
|
||||
return 0x3048;
|
||||
break;
|
||||
case 4:
|
||||
return 0x3050;
|
||||
break;
|
||||
case 5:
|
||||
return 0x3044;
|
||||
break;
|
||||
case 6:
|
||||
return 0x3040;
|
||||
break;
|
||||
case 7:
|
||||
return 0x3058;
|
||||
break;
|
||||
case 8:
|
||||
return 0x305C;
|
||||
break;
|
||||
case 9:
|
||||
return 0x3054;
|
||||
break;
|
||||
case 10:
|
||||
return 0x3060;
|
||||
break;
|
||||
case 11:
|
||||
return 0x3064;
|
||||
break;
|
||||
case 12:
|
||||
return 0x303c;
|
||||
break;
|
||||
|
||||
|
||||
case 13: //帽子
|
||||
return 0x3010;
|
||||
break;
|
||||
case 14: //头部
|
||||
return 0x3014;
|
||||
break;
|
||||
case 15: //脸
|
||||
return 0x3018;
|
||||
break;
|
||||
case 16:
|
||||
return 0x301c;
|
||||
break;
|
||||
case 17:
|
||||
return 0x3020;
|
||||
break;
|
||||
case 18:
|
||||
return 0x3024;
|
||||
break;
|
||||
case 19:
|
||||
return 0x3028;
|
||||
break;
|
||||
case 20:
|
||||
return 0x302c;
|
||||
break;
|
||||
case 21:
|
||||
return 0x3030;
|
||||
break;
|
||||
case 22:
|
||||
return 0x3034;
|
||||
break;
|
||||
case 23:
|
||||
return 0x3030;
|
||||
break;
|
||||
case 24:
|
||||
return 0x3068;
|
||||
break;
|
||||
case 25:
|
||||
return 0x306C;
|
||||
break;
|
||||
case 26:
|
||||
return 0x3070;
|
||||
break;
|
||||
case 27:
|
||||
return 0x3074;
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
277
Base/_Tool/BaseTool_Class.nut
Normal file
277
Base/_Tool/BaseTool_Class.nut
Normal file
@@ -0,0 +1,277 @@
|
||||
/*
|
||||
文件名:BaseTool_Class.nut
|
||||
路径:Base/_Tool/BaseTool_Class.nut
|
||||
创建日期:2024-08-06 23:49
|
||||
文件用途:基础工具类
|
||||
*/
|
||||
//Json类
|
||||
class Json {
|
||||
function Encode(Table) {
|
||||
local Size = Table.len();
|
||||
local Pos = 0;
|
||||
local Str = "{";
|
||||
foreach(Key, Value in Table) {
|
||||
++Pos;
|
||||
Str += "\"";
|
||||
Str += Key.tostring();
|
||||
Str += "\"";
|
||||
Str += ":";
|
||||
if (typeof(Value) == "string") {
|
||||
Str += "\"";
|
||||
Str += Value;
|
||||
Str += "\"";
|
||||
} else if (typeof(Value) == "table") {
|
||||
Str += Json.Encode(Value);
|
||||
} else if (typeof(Value) == "array") {
|
||||
Str += "[";
|
||||
foreach(ArrObj in Value) {
|
||||
if (typeof(ArrObj) == "table") Str += Json.Encode(Value);
|
||||
else {
|
||||
Str += ArrObj;
|
||||
Str += ",";
|
||||
}
|
||||
}
|
||||
Str = Str.slice(0, Str.len() - 1);
|
||||
Str += "]";
|
||||
} else Str += Value;
|
||||
if (Pos != Size) Str += ",";
|
||||
}
|
||||
Str += "}";
|
||||
return Str;
|
||||
}
|
||||
|
||||
function Decode(Str) {
|
||||
Str = L_sq_DecondeJson(Str);
|
||||
local Str = "local _M = " + Str + ";\n return _M;\n";
|
||||
local Func = compilestring(Str);
|
||||
return Func();
|
||||
}
|
||||
}
|
||||
//Key 键盘按键类
|
||||
class KeyPress {
|
||||
function KeyDown(obj, KeyValue) {
|
||||
local KeyEvent = obj.getVar(KeyValue.tostring()); //声明储存器
|
||||
KeyEvent.clear_vector(); //清空储存器的向量位
|
||||
if (sq_IsKeyDown(KeyValue, ENUM_SUBKEY_TYPE_ALL) && KeyEvent.getInt(0) == 0) {
|
||||
KeyEvent.setInt(0, 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function KeyUp(obj, KeyValue) {
|
||||
local KeyEvent = obj.getVar(KeyValue.tostring()); //声明储存器
|
||||
if (sq_IsKeyUp(KeyValue, ENUM_SUBKEY_TYPE_ALL)) {
|
||||
KeyEvent.setInt(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function isKeyPress(KeyValue) {
|
||||
local obj = sq_getMyCharacter();
|
||||
if (KeyPress.KeyDown(obj, KeyValue)) {
|
||||
return true;
|
||||
}
|
||||
KeyPress.KeyUp(obj, KeyValue);
|
||||
}
|
||||
}
|
||||
//Key 键盘按键类
|
||||
class KeyPressNB {
|
||||
function KeyDown(obj, KeyValue, VarKey) {
|
||||
local KeyEvent = obj.getVar(VarKey); //声明储存器
|
||||
KeyEvent.clear_vector(); //清空储存器的向量位
|
||||
if (sq_IsKeyDown(KeyValue, ENUM_SUBKEY_TYPE_ALL) && KeyEvent.getInt(0) == 0) {
|
||||
KeyEvent.setInt(0, 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function KeyUp(obj, KeyValue, VarKey) {
|
||||
local KeyEvent = obj.getVar(VarKey); //声明储存器
|
||||
if (sq_IsKeyUp(KeyValue, ENUM_SUBKEY_TYPE_ALL)) {
|
||||
KeyEvent.setInt(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function isKeyPress(KeyValue, VarKey) {
|
||||
local obj = sq_getMyCharacter();
|
||||
obj = sq_GetCNRDObjectToActiveObject(obj);
|
||||
if (KeyPressNB.KeyDown(obj, KeyValue, VarKey)) {
|
||||
return true;
|
||||
}
|
||||
KeyPressNB.KeyUp(obj, KeyValue, VarKey);
|
||||
}
|
||||
}
|
||||
//基础工具类
|
||||
class Rindro_BaseToolClass {
|
||||
|
||||
function SendPack(T) {
|
||||
local str = Json.Encode(T);
|
||||
L_sq_SendPackType(130);
|
||||
L_sq_SendPackWChar(str);
|
||||
L_sq_SendPack();
|
||||
}
|
||||
|
||||
function SendPackEx(T) {
|
||||
local str = L_sq_EncondeJson(T);
|
||||
L_sq_SendPackType(130);
|
||||
L_sq_SendPackWChar(str);
|
||||
L_sq_SendPack();
|
||||
}
|
||||
|
||||
//绘制简易静态Ani // obj -- ani路径 -- X -- Y -- 第几帧 -- ani名字
|
||||
function T_DrawStayAni(obj, aniFileName, x, y, index, aniname) {
|
||||
local SelectAni = obj.getVar().GetAnimationMap(aniname, aniFileName);
|
||||
//sq_AnimationProc(SelectAni);
|
||||
sq_DrawSpecificFrame(SelectAni, x, y, false, index, false, 1.0);
|
||||
return SelectAni;
|
||||
}
|
||||
|
||||
//绘制简易静态Ani // obj -- ani路径 -- X -- Y -- 第几帧 -- ani名字
|
||||
function T_DrawStayAniRate(obj, aniFileName, x, y, index, aniname, rate) {
|
||||
local SelectAni = obj.getVar().GetAnimationMap(aniname, aniFileName);
|
||||
SelectAni.setImageRateFromOriginal(rate, rate);
|
||||
//sq_AnimationProc(SelectAni);
|
||||
sq_DrawSpecificFrame(SelectAni, x, y, false, index, false, 1.0);
|
||||
return SelectAni;
|
||||
}
|
||||
|
||||
//绘制简易动态Ani // obj -- ani路径 -- X -- Y -- ani名字
|
||||
function T_DrawDynamicAni(obj, aniFileName, x, y, aniname) {
|
||||
local ani = obj.getVar().GetAnimationMap(aniname, aniFileName);
|
||||
sq_AnimationProc(ani);
|
||||
sq_drawCurrentFrame(ani, x, y, true);
|
||||
return ani;
|
||||
}
|
||||
|
||||
|
||||
//初始化根表成员
|
||||
function InitClass(Name) {
|
||||
local RootTab = getroottable();
|
||||
if (RootTab.rawin(Name) == true) {
|
||||
RootTab.rawdelete(Name);
|
||||
}
|
||||
}
|
||||
|
||||
//获取交互Npc名称
|
||||
function GetEachNpcId() {
|
||||
local OneAddress = L_sq_RA(0x1ADE0E0);
|
||||
if (OneAddress) {
|
||||
local TowAddress = L_sq_RA(OneAddress + 8);
|
||||
if (TowAddress) {
|
||||
local Id = L_sq_RA(TowAddress + 0x210);
|
||||
return Id;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
//获取文字绘制长度
|
||||
class LenheartTextClass {
|
||||
|
||||
function GetStringLength(str) {
|
||||
return L_sq_GetStringDrawLength(str);
|
||||
}
|
||||
|
||||
}
|
||||
class MemoryTool {
|
||||
//给指定地址写入字节数组
|
||||
function WirteByteArr(Address, ByteArr) {
|
||||
for (local i = 0; i< ByteArr.len(); i++) {
|
||||
L_sq_WAB(Address + i, ByteArr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//解密读取内存地址的数据
|
||||
function DecodeMemoryData(Address) {
|
||||
local nEax, nEcx8, nEsi, nEdx, nTmp;
|
||||
nEax = L_sq_RA(Address);
|
||||
if (nEax == -1) return nEax;
|
||||
nEcx8 = L_sq_RA(Address + 8);
|
||||
if (nEcx8 == -1) return nEcx8;
|
||||
nEsi = L_sq_RA(0x1AF8D78);
|
||||
nEdx = nEax >> 16;
|
||||
nTmp = (nEdx << 2) + nEsi + 36;
|
||||
nEdx = L_sq_RA(nTmp);
|
||||
if (nEdx == -1) return nEdx;
|
||||
nEax = nEax & 65535;
|
||||
nTmp = (nEax << 2) + nEdx + 8468;
|
||||
nEax = L_sq_RA(nTmp);
|
||||
if (nEax == -1) return nEax;
|
||||
nEdx = nEax & 0xFFFF;
|
||||
nEsi = nEdx << 16;
|
||||
nEsi = nEsi | nEdx;
|
||||
nEax = nEsi ^ nEcx8;
|
||||
return nEax;
|
||||
}
|
||||
|
||||
//加密写入内存地址数据
|
||||
function EncodeMemoryData() {
|
||||
local JEdi, JEcx, JEax, JEsi, JEdx, JSs;
|
||||
JEcx = AddreSs;
|
||||
JEax = L_sq_RA(0x1AF8DB8);
|
||||
JEax = JEax + 1;
|
||||
L_sq_WA(0x1AF8DB8, JEax);
|
||||
JEdx = JEax;
|
||||
JEdx = JEdx >> 8;
|
||||
JEdx = JEdx << 24;
|
||||
JEdx = JEdx >> 24;
|
||||
JEdx = L_sq_RA(JEdx * 2 + 0x1843F58);
|
||||
JEdx = JEdx & 0xFFFF;
|
||||
JEax = JEax << 24;
|
||||
JEax = JEax >> 24;
|
||||
JSs = L_sq_RA(JEax * 2 + 0x1844158);
|
||||
JSs = JSs & 0xFFFF;
|
||||
JEdx = JEdx ^ JSs;
|
||||
JEax = JEdx;
|
||||
JEax = JEax & 0xFFFF;
|
||||
JEsi = Data;
|
||||
JEdx = JEsi >> 16;
|
||||
|
||||
JSs = JEsi & 0xFFFF;
|
||||
JEdx = JEdx + JSs;
|
||||
JEdx = JEdx ^ JEax;
|
||||
JEdi = JEdx;
|
||||
JEdx = JEax;
|
||||
JEax = JEax << 16;
|
||||
JEax = JEax + JEdx;
|
||||
JEsi = Data;
|
||||
JEax = JEax ^ JEsi;
|
||||
JEsi = AddreSs + 8;
|
||||
L_sq_WA(JEsi, JEax);
|
||||
JEax = L_sq_RA(AddreSs);
|
||||
JEsi = L_sq_RA(0x1AF8D78);
|
||||
|
||||
JEcx = JEdi;
|
||||
JEcx = JEcx << 16;
|
||||
JEcx = JEcx + JEdx;
|
||||
JEdx = JEax;
|
||||
JEdx = JEdx >> 16;
|
||||
JEdx = L_sq_RA(JEsi + JEdx * 4 + 36);
|
||||
JEax = JEax & 0xFFFF;
|
||||
L_sq_WA(JEdx + JEax * 4 + 8468, JEcx);
|
||||
}
|
||||
|
||||
function DecodeMemoryDataF(Address) {
|
||||
local Value = MemoryTool.DecodeMemoryData(Address);
|
||||
local Bl = blob();
|
||||
Bl.writen(Value, 'i');
|
||||
Bl.seek(0);
|
||||
return Bl.readn('f');
|
||||
}
|
||||
|
||||
function ReadFloat(Address) {
|
||||
local Arr = [];
|
||||
for (local i = 0; i< 4; i++) {
|
||||
Arr.append(L_sq_RAB(Address + i));
|
||||
}
|
||||
// local Value = L_sq_RAB(Address);
|
||||
// print(Value);
|
||||
local Bl = blob();
|
||||
foreach(intvalue in Arr) {
|
||||
Bl.writen(intvalue, 'c');
|
||||
}
|
||||
// Bl.writen(Value, 'i');
|
||||
Bl.seek(0);
|
||||
return Bl.readn('f');
|
||||
}
|
||||
}
|
||||
113
Base/_Z_Data/CharacterInfoData.nut
Normal file
113
Base/_Z_Data/CharacterInfoData.nut
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
文件名:CharacterInfoData.nut
|
||||
路径:Base/_Z_Data/CharacterInfoData.nut
|
||||
创建日期:2024-09-03 11:34
|
||||
文件用途:角色信息数据
|
||||
*/
|
||||
|
||||
//读取属性数据
|
||||
function Lenheart_Character_GetAttribute(Address) {
|
||||
//传入读传入不传读自己
|
||||
local ObjectAddress = Address;
|
||||
if (ObjectAddress == null)
|
||||
ObjectAddress = L_sq_RA(0x1AB7CDC);
|
||||
if (!ObjectAddress) return;
|
||||
|
||||
local Info = {};
|
||||
//当前HP
|
||||
Info.CurHp <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2BEC);
|
||||
//总HP
|
||||
Info.MaxHp <- L_sq_RA(ObjectAddress + 0x36A0);
|
||||
//当前MP
|
||||
Info.CurMp <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2BF8);
|
||||
//总MP
|
||||
Info.MaxMp <- L_sq_RA(ObjectAddress + 0x36A4);
|
||||
|
||||
//力量
|
||||
Info.Strength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2364);
|
||||
//智力
|
||||
Info.Intellect <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2394);
|
||||
//体力
|
||||
Info.Vitality <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x237C);
|
||||
//精神
|
||||
Info.Spirit <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x23AC);
|
||||
//物理攻击 (没读武器精通)
|
||||
Info.PhysicalAttack <- (MemoryTool.DecodeMemoryData(ObjectAddress + 0x1E54) * (Info.Strength.tofloat() * 0.004 + 1)).tointeger() + MemoryTool.DecodeMemoryData(ObjectAddress + 0x1EB4);
|
||||
//魔法攻击
|
||||
Info.MagicalAttack <- (MemoryTool.DecodeMemoryData(ObjectAddress + 0x1E84) * (Info.Intellect.tofloat() * 0.004 + 1)).tointeger() + MemoryTool.DecodeMemoryData(ObjectAddress + 0x1ED8);
|
||||
//独立攻击力 //TODO 需要加上成长独立攻击力 需要服务端发送给我
|
||||
Info.IndependentAttack <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x22C8) + MemoryTool.DecodeMemoryData(ObjectAddress + 0x22F8);
|
||||
|
||||
//物理防御
|
||||
Info.PhysicalDefend <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x273C);
|
||||
//魔法防御
|
||||
Info.MagicalDefend <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x276C);
|
||||
//物理暴击
|
||||
Info.PhysicalCrit <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1F14);
|
||||
//魔法暴击
|
||||
Info.MagicalCrit <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1F20);
|
||||
|
||||
//攻击速度
|
||||
Info.AttackSpeed <- (MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x2688) - 1.0) * 100.0;
|
||||
//释放速度
|
||||
Info.ReleaseSpeed <- (MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x26A0) - 1.0) * 100.0;
|
||||
//移动速度
|
||||
Info.MoveSpeed <- (MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x2670) - 1.0) * 100.0;
|
||||
|
||||
//抗魔值
|
||||
local Kbuf = 0;
|
||||
for (local i = 1; i< 13; ++i) {
|
||||
local EquOffset = Rindro_GetEquAddr(i);
|
||||
local AbAddress = L_sq_RA(ObjectAddress + EquOffset);
|
||||
if (AbAddress) {
|
||||
Kbuf += MemoryTool.DecodeMemoryData(AbAddress + 0xAD4);
|
||||
}
|
||||
}
|
||||
Info.AntiMagic <- Kbuf;
|
||||
|
||||
|
||||
//命中率
|
||||
Info.HitRate <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1F50);
|
||||
//闪避率
|
||||
Info.DodgeRate <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1C50);
|
||||
//HP回复量
|
||||
Info.HPRecovery <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1D64) * 1.6;
|
||||
//MP回复量
|
||||
Info.MPRecovery <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1D7C) * 7.2;
|
||||
//僵直度
|
||||
Info.StunRate <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1DF4);
|
||||
//硬直
|
||||
Info.StunResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1DDC);
|
||||
|
||||
//火属性强化
|
||||
Info.FireStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B54);
|
||||
//冰属性强化
|
||||
Info.IceStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B60);
|
||||
//光属性强化
|
||||
Info.LightStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B78);
|
||||
//暗属性强化
|
||||
Info.DarkStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B6C);
|
||||
//火属性抗性
|
||||
Info.FireResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1AF4);
|
||||
//冰属性抗性
|
||||
Info.IceResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B00);
|
||||
//光属性抗性
|
||||
Info.LightResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B18);
|
||||
//暗属性抗性
|
||||
Info.DarkResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B0C);
|
||||
|
||||
//名望值
|
||||
Info.Fame <- 0;
|
||||
//最终伤害
|
||||
Info.FinalDamage <- 0;
|
||||
|
||||
return Info;
|
||||
}
|
||||
|
||||
function Rindro_GetCharacterInfoCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
Jso.op <- 20069011;
|
||||
Jso.Info <- Lenheart_Character_GetAttribute(null);
|
||||
Rindro_BaseToolClass.SendPackEx(Jso);
|
||||
}
|
||||
Pack_Control.rawset(20069010, Rindro_GetCharacterInfoCallBack);
|
||||
302
Base/_Z_Data/ItemData.nut
Normal file
302
Base/_Z_Data/ItemData.nut
Normal file
@@ -0,0 +1,302 @@
|
||||
/*
|
||||
文件名:ItemData.nut
|
||||
路径:Base/_Z_Data/ItemData.nut
|
||||
创建日期:2024-08-06 23:58
|
||||
文件用途:用于存放Item数据
|
||||
*/
|
||||
if (!getroottable().rawin("Rindro_ItemInfoObject")) Rindro_ItemInfoObject <- {};
|
||||
if (!getroottable().rawin("Rindro_ItemInfoBuf")) Rindro_ItemInfoBuf <- "";
|
||||
if (!getroottable().rawin("RINDRO_INIT_FLAG")) RINDRO_INIT_FLAG <- false;
|
||||
|
||||
//获取本地配置
|
||||
function Rindro_GetLocalConfig() {
|
||||
local Buf = L_sq_GetLocalConfig();
|
||||
if (!Buf) {
|
||||
return {
|
||||
md5 = -1
|
||||
};
|
||||
} else return Json.Decode(Buf);
|
||||
}
|
||||
// if (!getroottable().rawin("RINDRO_CONFIG"))
|
||||
RINDRO_CONFIG <- Rindro_GetLocalConfig();
|
||||
|
||||
//获取本地信息版本
|
||||
function Rindro_GetMd5() {
|
||||
return RINDRO_CONFIG.md5;
|
||||
}
|
||||
|
||||
//初始化各种信息
|
||||
function Rindro_Init() {
|
||||
//道具信息
|
||||
local ItemArray = getroottable().RINDRO_CONFIG.itemInfo;
|
||||
Rindro_ItemInfoBuf = "";
|
||||
foreach(Value in ItemArray) {
|
||||
if (Value.Name2.len() == 0)
|
||||
Value.Name2 = "Rindro-Team";
|
||||
getroottable().Rindro_ItemInfoObject[Value.Id] <- Value;
|
||||
}
|
||||
RINDRO_INIT_FLAG = true;
|
||||
}
|
||||
//更新本地配置
|
||||
function Rindro_ItemInfoCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
if ("ZipSEnd" in Jso) {
|
||||
getroottable().Rindro_ItemInfoObject <- {};
|
||||
Rindro_ItemInfoBuf += Jso.ZipS;
|
||||
local ZlibStrBuf = L_sq_Dezlib(Rindro_ItemInfoBuf);
|
||||
if (ZlibStrBuf == "null") {
|
||||
Rindro_ItemInfoBuf = "";
|
||||
return;
|
||||
}
|
||||
L_sq_SetLocalConfig(ZlibStrBuf);
|
||||
|
||||
getroottable().RINDRO_CONFIG <- Json.Decode(ZlibStrBuf);
|
||||
|
||||
Rindro_Init();
|
||||
} else {
|
||||
Rindro_ItemInfoBuf += Jso.ZipS;
|
||||
}
|
||||
}
|
||||
Pack_Control.rawset(20240422, Rindro_ItemInfoCallBack);
|
||||
//无需更新本地配置
|
||||
Pack_Control.rawset(20240424, function(Chunk) {
|
||||
Rindro_Init();
|
||||
});
|
||||
|
||||
|
||||
//道具绘制类
|
||||
class ItemInfoClass {
|
||||
|
||||
//Gm模式
|
||||
GmModel = true;
|
||||
|
||||
Info = null;
|
||||
PageLength = 0;
|
||||
|
||||
//静态品级颜色
|
||||
static RarityColor = [
|
||||
0xFFFFFFFF, //白
|
||||
0xFFEDD568, //蓝
|
||||
0xFFFF6BB3, //紫
|
||||
0xFFF000FF, //粉
|
||||
0xFF00B1FF, //黄
|
||||
0xFF6666FF, //红
|
||||
0xFF0055FF, //橙
|
||||
];
|
||||
|
||||
//我的品级颜色
|
||||
MyRarityColor = null;
|
||||
//我的售价长度
|
||||
MyPriceLength = null;
|
||||
//我的冷却时间长度
|
||||
MyCoolTimeLength = null;
|
||||
|
||||
//获取真实类型
|
||||
function GetRealType(Type) {
|
||||
switch (Type) {
|
||||
case "[material]":
|
||||
return "材料";
|
||||
case "[recipe]":
|
||||
return "设计图";
|
||||
case "[upgradable legacy]":
|
||||
return "袖珍罐";
|
||||
case "[quest]":
|
||||
return "任务";
|
||||
case "[booster random]":
|
||||
case "[multi upgradable legacy]":
|
||||
case "[booster selection]":
|
||||
case "[cera booster]":
|
||||
case "[unlimited waste]":
|
||||
case "[usable cera package]":
|
||||
case "[only effect]":
|
||||
return "消耗品";
|
||||
case "[weapon]":
|
||||
return "武器";
|
||||
case "[title name]":
|
||||
return "称号";
|
||||
case "[coat]":
|
||||
return "上衣";
|
||||
case "[pants]":
|
||||
return "下衣";
|
||||
case "[hat]":
|
||||
return "帽子";
|
||||
case "[shoulder]":
|
||||
return "护肩";
|
||||
case "[waist]":
|
||||
return "腰带";
|
||||
case "[shoes]":
|
||||
return "鞋子";
|
||||
case "[amulet]":
|
||||
return "项链";
|
||||
case "[wrist]":
|
||||
return "手镯";
|
||||
case "[ring]":
|
||||
return "戒指";
|
||||
case "[support]":
|
||||
return "辅助装备";
|
||||
case "[aurora avatar]":
|
||||
return "光环";
|
||||
case "[magic stone]":
|
||||
return "魔法石";
|
||||
case "[creature]":
|
||||
return "寵物";
|
||||
case "[artifact red]":
|
||||
return "宠物装备 红";
|
||||
case "[artifact blue]":
|
||||
return "宠物装备 蓝";
|
||||
case "[artifact green]":
|
||||
return "宠物装备 绿";
|
||||
case "[skin avatar]":
|
||||
return "皮肤";
|
||||
case "[hair avatar]":
|
||||
return "头部装扮";
|
||||
case "[waist avatar]":
|
||||
return "腰部装扮";
|
||||
case "[hat avatar]":
|
||||
return "帽子装扮";
|
||||
case "[coat avatar]":
|
||||
return "上衣装扮";
|
||||
case "[face avatar]":
|
||||
return "脸部装扮";
|
||||
case "[breast avatar]":
|
||||
return "胸部装扮";
|
||||
case "[pants avatar]":
|
||||
return "下装装扮";
|
||||
case "[shoes avatar]":
|
||||
return "鞋装扮";
|
||||
default:
|
||||
return "道具";
|
||||
}
|
||||
}
|
||||
|
||||
constructor(gInfo) {
|
||||
Info = clone(gInfo);
|
||||
|
||||
//Gm模式显示编号
|
||||
if (GmModel) Info.Name += "[" + Info.Id + "]";
|
||||
|
||||
//配置品级颜色
|
||||
if (Info.Rarity< 0 || Info.Rarity > 6) {
|
||||
MyRarityColor = Info.Rarity;
|
||||
} else {
|
||||
MyRarityColor = RarityColor[Info.Rarity];
|
||||
}
|
||||
|
||||
//配置售价长度
|
||||
if ("Price" in Info) {
|
||||
MyPriceLength = LenheartTextClass.GetStringLength(Info.Price.tostring());
|
||||
}
|
||||
|
||||
//配置冷却时间长度
|
||||
if ("CoolTime" in Info) {
|
||||
MyCoolTimeLength = LenheartTextClass.GetStringLength((Info.CoolTime / 1000.0).tostring());
|
||||
}
|
||||
|
||||
//配置类型
|
||||
if ("Type" in Info) {
|
||||
Info.Type = GetRealType(Info.Type);
|
||||
}
|
||||
//配置装备类型
|
||||
else if ("EquipmentType" in Info) {
|
||||
Info.Type <- GetRealType(Info.EquipmentType);
|
||||
}
|
||||
|
||||
PageLength += 72;
|
||||
CheckStrLength();
|
||||
}
|
||||
|
||||
function CheckInfoLength(TableKey, AddLength) {
|
||||
if (TableKey in Info) {
|
||||
PageLength += AddLength;
|
||||
}
|
||||
}
|
||||
|
||||
function CheckStrLength() {
|
||||
if ("Explain" in Info) {
|
||||
// local Buf = LenheartTextClass.GetStringLength(Info.Explain.tostring());
|
||||
// local Pn = (Buf / 211.0);
|
||||
// if (Pn< 1) PageLength += 12;
|
||||
// if (Pn > 1) Pn = Pn.tointeger() + 1;
|
||||
// PageLength += (16 * Pn);
|
||||
|
||||
local Buf = L_sq_GetStringDrawArray(Info.Explain, 220);
|
||||
PageLength += (Buf.len() * 16);
|
||||
// PageLength += 12;
|
||||
}
|
||||
}
|
||||
|
||||
//高级绘制文字(带换行)
|
||||
function L_sq_DrawCode_Ex(str, x, y, rgba, mb, jc, hl) {
|
||||
local strarr = [];
|
||||
if (str.find("\n") == null) L_sq_DrawCode(str, x, y, rgba, mb, jc);
|
||||
else {
|
||||
local Bpos = 0;
|
||||
while (true) {
|
||||
local Npos = str.find("\n", Bpos);
|
||||
if (!Npos) {
|
||||
local strbuff = str.slice(Bpos, str.len());
|
||||
strarr.append(strbuff);
|
||||
break;
|
||||
}
|
||||
local strbuff = str.slice(Bpos, Npos);
|
||||
strarr.append(strbuff);
|
||||
Bpos = Npos + 1;
|
||||
}
|
||||
for (local z = 0; z< strarr.len(); z++) {
|
||||
L_sq_DrawCode(strarr[z], x, y + (z * 14), rgba, mb, jc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Show(X, Y) {
|
||||
if (X< 0) X = 0;
|
||||
if ((X + 211) > 800) X = (800 - 211);
|
||||
if (Y< 0) Y = 0;
|
||||
if (Y + PageLength > 600) Y = 600 - PageLength;
|
||||
|
||||
//Item信息框一般为211的宽度
|
||||
L_sq_DrawWindow(X, Y, 211, PageLength, "interface2/popup/popup.img", 134, 6, 12, 6, 13);
|
||||
|
||||
//绘制名字 和 图标
|
||||
if ("Id" in Info) L_Sq_DrawItem(X + 8 + 174, Y + 8, Info.Id, 1, 0, 0, 0);
|
||||
if ("Name2" in Info) L_sq_DrawCode(Info.Name2, X + 8, Y + 9, MyRarityColor, 1, 1);
|
||||
if ("Name" in Info) L_sq_DrawCode(Info.Name, X + 8, Y + 23, MyRarityColor, 1, 1);
|
||||
|
||||
|
||||
//绘制线
|
||||
L_sq_DrawImg("interface2/popup/popup.img", 270, X + 7, Y + 26 + 16);
|
||||
|
||||
//绘制重量
|
||||
if ("Weight" in Info) {
|
||||
L_sq_DrawCode((Info.Weight.tofloat() / 1000.0).tostring() + "kg", X + 7, Y + 24 + 24, 0xFFFFFFFF, 1, 1);
|
||||
}
|
||||
|
||||
//绘制售价
|
||||
if ("Price" in Info) {
|
||||
L_sq_DrawCode("金币", X + 186, Y + 24 + 24, 0xFFFFFFFF, 1, 1);
|
||||
L_sq_DrawCode(Info.Price.tostring(), X - MyPriceLength + 186, Y + 24 + 24, 0xFFFFFFFF, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
//绘制类型
|
||||
if ("Type" in Info) {
|
||||
L_sq_DrawCode(Info.Type.tostring(), X + 7, Y + 48 + 16, 0xFFFFFFFF, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//绘制冷却时间
|
||||
if ("CoolTime" in Info) {
|
||||
L_sq_DrawCode("秒", X + 186 + 12, Y + 48 + 16, 0xFFFFFFFF, 1, 1);
|
||||
L_sq_DrawCode((Info.CoolTime / 1000.0).tostring(), X - MyCoolTimeLength + 214 - 18, Y + 48 + 16, 0xFFFFFFFF, 1, 1);
|
||||
}
|
||||
|
||||
//绘制普通描述
|
||||
if ("Explain" in Info) {
|
||||
local a = L_sq_GetStringDrawArray(Info.Explain, 220);
|
||||
foreach(Pos, va in a) {
|
||||
L_sq_DrawCode(va, X + 7, Y + 48 + 12 + 24 + (Pos * 16), 0xFFEDD568, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user