Compare commits
4 Commits
39d60b284e
...
c1df659af4
| Author | SHA1 | Date |
|---|---|---|
|
|
c1df659af4 | |
|
|
8c2522f366 | |
|
|
16be225768 | |
|
|
b2133d8463 |
|
|
@ -27,6 +27,12 @@ function L_drawMainCustomUI_All() {
|
||||||
L_Cmd("cmd.exe /c del Yosin_Game_Reloading.Sign");
|
L_Cmd("cmd.exe /c del Yosin_Game_Reloading.Sign");
|
||||||
//清空窗口
|
//清空窗口
|
||||||
L_Windows_List = [];
|
L_Windows_List = [];
|
||||||
|
//清空所有注册包
|
||||||
|
Pack_Control = {};
|
||||||
|
|
||||||
|
PushDamageFontDataFuncTab <- {};
|
||||||
|
PushDamageFontFuncTab <- {};
|
||||||
|
|
||||||
//清空活动图标窗口
|
//清空活动图标窗口
|
||||||
getroottable().rawdelete("EventList_Obj");
|
getroottable().rawdelete("EventList_Obj");
|
||||||
//清空插件初始化状态
|
//清空插件初始化状态
|
||||||
|
|
@ -37,6 +43,8 @@ function L_drawMainCustomUI_All() {
|
||||||
getroottable().rawdelete("OnlineAnnouncement_Obj");
|
getroottable().rawdelete("OnlineAnnouncement_Obj");
|
||||||
//血槽UI
|
//血槽UI
|
||||||
getroottable().rawdelete("HudUi_Obj");
|
getroottable().rawdelete("HudUi_Obj");
|
||||||
|
//交互UI
|
||||||
|
getroottable().rawdelete("L_Each_Obj");
|
||||||
|
|
||||||
//战令
|
//战令
|
||||||
getroottable().rawdelete("AradPass_Obj");
|
getroottable().rawdelete("AradPass_Obj");
|
||||||
|
|
@ -50,6 +58,10 @@ function L_drawMainCustomUI_All() {
|
||||||
getroottable().rawdelete("OnilneSign_Obj");
|
getroottable().rawdelete("OnilneSign_Obj");
|
||||||
//全服竞拍
|
//全服竞拍
|
||||||
getroottable().rawdelete("ServerAuction_Obj");
|
getroottable().rawdelete("ServerAuction_Obj");
|
||||||
|
//秒伤统计
|
||||||
|
getroottable().rawdelete("DamagePerSecond_Obj");
|
||||||
|
//皮肤仓库
|
||||||
|
getroottable().rawdelete("SkinHub_Obj");
|
||||||
|
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
if (exception != "cannot open the file")
|
if (exception != "cannot open the file")
|
||||||
|
|
@ -100,6 +112,7 @@ function L_drawMainCustomUI_All() {
|
||||||
|
|
||||||
//初始化Item信息
|
//初始化Item信息
|
||||||
if (!getroottable().rawin("RINDRO_GET_ITEM_FLAG")) {
|
if (!getroottable().rawin("RINDRO_GET_ITEM_FLAG")) {
|
||||||
|
RINDRO_CONFIG <- Rindro_GetLocalConfig();
|
||||||
getroottable().RINDRO_GET_ITEM_FLAG <- true;
|
getroottable().RINDRO_GET_ITEM_FLAG <- true;
|
||||||
Rindro_BaseToolClass.SendPackEx({
|
Rindro_BaseToolClass.SendPackEx({
|
||||||
op = 20069005,
|
op = 20069005,
|
||||||
|
|
@ -107,6 +120,7 @@ function L_drawMainCustomUI_All() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if (Clock() - getroottable().Lsnzz >= 50) {
|
// if (Clock() - getroottable().Lsnzz >= 50) {
|
||||||
// getroottable().Lsnzz = Clock();
|
// getroottable().Lsnzz = Clock();
|
||||||
// local T = {
|
// local T = {
|
||||||
|
|
@ -138,25 +152,23 @@ function L_drawMainCustomUI_All() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 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++) {
|
// for (local i = 0; i< 400; i++) {
|
||||||
// local WindowAddress = L_sq_GetWindowById(i);
|
// local WindowAddress = L_sq_GetWindowById(i);
|
||||||
// if (WindowAddress != 0) print(format("%02X", WindowAddress));
|
// if (WindowAddress != 0) print(format("%02X", WindowAddress));
|
||||||
// if (WindowAddress == 0x39F56000) print(i);
|
// if (WindowAddress == 0x39F56000) print(i);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// if (Clock() - getroottable().SINNU >= 10) {
|
||||||
|
// getroottable().SINNU = Clock();
|
||||||
|
// L_sq_MoveTown(1, 1, 474, 249);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// print(sq_GetCurrentModuleType());
|
||||||
}
|
}
|
||||||
|
// getroottable().SINNU <- Clock();
|
||||||
// getroottable().Lsnzz <- Clock();
|
// getroottable().Lsnzz <- Clock();
|
||||||
|
|
||||||
|
// dofile("sqr/Base/_Tool/Json.nut");
|
||||||
|
|
||||||
|
// print(T);
|
||||||
|
|
@ -7,21 +7,8 @@
|
||||||
function L_getCurrentModuleDamageRate(obj) {
|
function L_getCurrentModuleDamageRate(obj) {
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return 1.0;
|
return 1.0;
|
||||||
local rate;
|
local rate = 1.0;
|
||||||
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;
|
local ClientRat = 1.0;
|
||||||
try {
|
try {
|
||||||
ClientRat = getCurrentModuleDamageRate(obj).tofloat();
|
ClientRat = getCurrentModuleDamageRate(obj).tofloat();
|
||||||
|
|
@ -29,44 +16,5 @@ function L_getCurrentModuleDamageRate(obj) {
|
||||||
ClientRat = 1.0;
|
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);
|
return (rate * ClientRat);
|
||||||
}
|
}
|
||||||
|
|
@ -19,14 +19,7 @@ function Sq_PushDamageData(ObjAddress, MySelfAddress, Value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Sq_PushDamageFontData(ObjAddress, X, Y, Z, Value, Type, A1, A2) {
|
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;
|
local Flag = true;
|
||||||
foreach(Func in PushDamageFontDataFuncTab) {
|
foreach(Func in PushDamageFontDataFuncTab) {
|
||||||
local Ret = Func(ObjAddress, X, Y, Z, Value, Type, A1, A2);
|
local Ret = Func(ObjAddress, X, Y, Z, Value, Type, A1, A2);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,9 @@ function Sq_Pack_Control(Chunk) {
|
||||||
|
|
||||||
function Sq_Pack_ControlLocal(Chunk) {
|
function Sq_Pack_ControlLocal(Chunk) {
|
||||||
local Pack_Json = Json.Decode(Chunk);
|
local Pack_Json = Json.Decode(Chunk);
|
||||||
if (Pack_Control.rawin(Pack_Json.op)) Pack_Control[Pack_Json.op](Chunk);
|
if (Pack_Control.rawin(Pack_Json.op)) {
|
||||||
|
Pack_Control[Pack_Json.op](Chunk);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -359,9 +359,8 @@ class Lenheart_Character_Info_ClassC extends LenheartNewUI_Windows {
|
||||||
local WindowX = sq_GetPopupWindowMainCotrol(74);
|
local WindowX = sq_GetPopupWindowMainCotrol(74);
|
||||||
local WindowAddress = L_sq_GetWindowById(74);
|
local WindowAddress = L_sq_GetWindowById(74);
|
||||||
if (!WindowX || !WindowAddress) return false;
|
if (!WindowX || !WindowAddress) return false;
|
||||||
|
|
||||||
//确定是个人信息窗口才执行逻辑 并且返回true 不执行原逻辑
|
//确定是个人信息窗口才执行逻辑 并且返回true 不执行原逻辑
|
||||||
if (Address - WindowAddress <= 0x20000) {
|
if (Address - WindowAddress <= 0x50000 && L_sq_RA(Address + 0x34) == 4089) {
|
||||||
OldWindowAddress = Address;
|
OldWindowAddress = Address;
|
||||||
local obj = sq_getMyCharacter();
|
local obj = sq_getMyCharacter();
|
||||||
RealShow(obj);
|
RealShow(obj);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
文件名:Lenheart_Cursor_Class.nut
|
||||||
|
路径:Base/UI/Lenheart_Cursor_Class.nut
|
||||||
|
创建日期:2024-09-25 19:23
|
||||||
|
文件用途:鼠标绘制逻辑
|
||||||
|
*/
|
||||||
|
class Rindro_Cursor {
|
||||||
|
|
||||||
|
UseState = 0;
|
||||||
|
|
||||||
|
TypeState = 0;
|
||||||
|
SubState = 0;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function Proc(Xpos, Ypos) {
|
||||||
|
|
||||||
|
//使用自建的鼠标绘制函数
|
||||||
|
if (UseState) {
|
||||||
|
//工作类型为0
|
||||||
|
if (TypeState == 0) {
|
||||||
|
//常规状态
|
||||||
|
if (SubState == 0) {
|
||||||
|
L_sq_DrawImg("interface/newstyle/windows/cursor.img", 0, Xpos, Ypos);
|
||||||
|
}
|
||||||
|
//按下状态
|
||||||
|
else if (SubState == 1) {
|
||||||
|
L_sq_DrawImg("interface/newstyle/windows/cursor.img", 1, Xpos, Ypos);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
L_sq_DrawImg("interface/newstyle/windows/cursor.img", TypeState, Xpos, Ypos);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Sync(Xpos, Ypos) {
|
||||||
|
Proc(Xpos, Ypos);
|
||||||
|
return UseState;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_Rindro_Cusor_ <- Rindro_Cursor();
|
||||||
|
|
||||||
|
function SyncRindro_Cursor(Xpos, Ypos) {
|
||||||
|
if (getroottable().rawin("_Rindro_Cusor_")) {
|
||||||
|
local Ret = _Rindro_Cusor_.Sync(Xpos, Ypos);
|
||||||
|
return Ret;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,244 @@
|
||||||
|
/*
|
||||||
|
文件名:Lenheart_Each_Class.nut
|
||||||
|
路径:Base/UI/Lenheart_Each_Class.nut
|
||||||
|
创建日期:2024-09-30 14:46
|
||||||
|
文件用途:交互界面类
|
||||||
|
*/
|
||||||
|
class LenheartNewUI_Each_BaseButton extends LenheartNewUI_CommonUi {
|
||||||
|
State = 0;
|
||||||
|
BaseIdx = 29;
|
||||||
|
DWidth = null;
|
||||||
|
Path = null;
|
||||||
|
Idx = null;
|
||||||
|
SetFlag = null;
|
||||||
|
SetIndex = null;
|
||||||
|
|
||||||
|
Icon = null;
|
||||||
|
IconIdx = null;
|
||||||
|
Str = null;
|
||||||
|
StrColor = sq_RGBA(189, 159, 126, 250);
|
||||||
|
|
||||||
|
constructor(X, Y, W, H, Path, Idx) {
|
||||||
|
this.DWidth = W;
|
||||||
|
this.Path = Path;
|
||||||
|
this.Idx = Idx;
|
||||||
|
LenheartNewUI_CommonUi.constructor(X, Y, W, H);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function SetFrame(gPath, gIdx) {
|
||||||
|
if (gPath) Path = gPath;
|
||||||
|
Idx = gIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
//不可用
|
||||||
|
if (State == 8) {
|
||||||
|
// L_sq_DrawImg(Path, Idx + 3, X, Y);
|
||||||
|
} else {
|
||||||
|
//按下
|
||||||
|
if (isLBDown) {
|
||||||
|
L_sq_DrawImg(Path, Idx + 1, X, Y);
|
||||||
|
if (Icon) L_sq_DrawImg(Icon, IconIdx, X + 3, Y + 2);
|
||||||
|
if (Str) L_sq_DrawCode(Str, X + 60 - LenheartTextClass.GetStringLength(Str) / 2, Y + 5, StrColor, 0, 1);
|
||||||
|
}
|
||||||
|
//悬停
|
||||||
|
else if (isInRect) {
|
||||||
|
L_sq_DrawImg(Path, Idx, X, Y);
|
||||||
|
if (Icon) L_sq_DrawImg(Icon, IconIdx, X + 3, Y + 1);
|
||||||
|
if (Str) L_sq_DrawCode(Str, X + 60 - LenheartTextClass.GetStringLength(Str) / 2, Y + 4, StrColor, 0, 1);
|
||||||
|
}
|
||||||
|
//普通
|
||||||
|
else {
|
||||||
|
L_sq_DrawImg(Path, 0, X, Y);
|
||||||
|
if (Icon) L_sq_DrawImg(Icon, IconIdx, X + 3, Y + 1);
|
||||||
|
if (Str) L_sq_DrawCode(Str, X + 60 - LenheartTextClass.GetStringLength(Str) / 2, Y + 4, StrColor, 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//鼠标左键弹起回调
|
||||||
|
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
||||||
|
if (isLBDown && OnClick) {
|
||||||
|
OnClick(this);
|
||||||
|
}
|
||||||
|
isLBDown = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Lenheart_EachC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
// Visible = false;
|
||||||
|
|
||||||
|
Info = null;
|
||||||
|
|
||||||
|
NPC_Index = null;
|
||||||
|
NPC_Flag = false;
|
||||||
|
NPC_ButtonMap = null;
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
NPC_ButtonMap = {};
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function TopShow(obj) {
|
||||||
|
if (NPC_Index) {
|
||||||
|
SyncPos();
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function DrawMain(obj) {
|
||||||
|
// if (Info) {
|
||||||
|
// local NPC_Index = Rindro_BaseToolClass.GetEachNpcId();
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// function BottomShow() {}
|
||||||
|
|
||||||
|
//初始化NPC按钮
|
||||||
|
function InitNpcButton() {
|
||||||
|
Childrens = [];
|
||||||
|
if (NPC_ButtonMap.rawin(NPC_Index)) {
|
||||||
|
NPC_ButtonMap[NPC_Index](this);
|
||||||
|
}
|
||||||
|
this.Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function AddEachForNpc(Index, Func) {
|
||||||
|
NPC_ButtonMap.rawset(Index, Func);
|
||||||
|
}
|
||||||
|
|
||||||
|
function RemoveEachForNpc(Index) {
|
||||||
|
NPC_ButtonMap.rawdelete(Index);
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
|
||||||
|
NPC_Index = Rindro_BaseToolClass.GetEachNpcId();
|
||||||
|
if (NPC_Index) {
|
||||||
|
if (!NPC_Flag) {
|
||||||
|
NPC_Flag = true;
|
||||||
|
InitNpcButton();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
NPC_Flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function CloseAllEach() {
|
||||||
|
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) L_sq_WA(ChildAddress + 0xC, 256);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Lenheart_Get_Each_Info() {
|
||||||
|
local EachCount = 0;
|
||||||
|
local Xpos = 0;
|
||||||
|
local Ypos = 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++;
|
||||||
|
}
|
||||||
|
//第0个的时候记录一下坐标
|
||||||
|
if (i == 0) {
|
||||||
|
Xpos = L_sq_RA(ChildAddress + 0x14);
|
||||||
|
Ypos = L_sq_RA(ChildAddress + 0x18);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
Count = EachCount,
|
||||||
|
X = Xpos,
|
||||||
|
Y = Ypos
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//override
|
||||||
|
//鼠标左键弹起回调
|
||||||
|
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
||||||
|
//调用原生方法
|
||||||
|
LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function SyncPos() {
|
||||||
|
//读取交互坐标数据
|
||||||
|
Info = Lenheart_Get_Each_Info();
|
||||||
|
|
||||||
|
X = Info.X;
|
||||||
|
Y = Info.Y + (21 * Info.Count);
|
||||||
|
//宽度
|
||||||
|
Width = 100;
|
||||||
|
//高度
|
||||||
|
Height = (21 * Childrens.len());
|
||||||
|
//同步子对象坐标
|
||||||
|
foreach(pos, winobj in Childrens) {
|
||||||
|
winobj.X = Info.X;
|
||||||
|
winobj.Y = Info.Y + (21 * (Info.Count + pos));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Lenheart_Each_Fun(obj) {
|
||||||
|
local RootTab = getroottable();
|
||||||
|
if (!RootTab.rawin("L_Each_Obj")) {
|
||||||
|
RootTab.rawset("L_Each_Obj", LenheartNewUI_CreateWindow(Lenheart_EachC, "玩家与NPC交互界面窗口", 0, 0, 0, 0, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getroottable()["LenheartFuncTab"].rawset("Lenheart_EachN", Lenheart_Each_Fun);
|
||||||
|
|
||||||
|
|
||||||
|
// Rindro_Haker.LoadHook(0x10041D0, ["int", "int", "int"],
|
||||||
|
// function(args) {
|
||||||
|
// if (getroottable().rawin("L_Each_Obj")) {
|
||||||
|
// getroottable()["L_Each_Obj"].BottomShow();
|
||||||
|
// }
|
||||||
|
// return null;
|
||||||
|
// },
|
||||||
|
// function(args) {
|
||||||
|
// return null;
|
||||||
|
// });
|
||||||
|
|
@ -168,6 +168,8 @@ class Rindro_EventList {
|
||||||
x = X - 456,
|
x = X - 456,
|
||||||
y = Y
|
y = Y
|
||||||
};
|
};
|
||||||
|
|
||||||
|
L_sq_RefreshEventIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -21,26 +21,32 @@ class R_Mouse {
|
||||||
}
|
}
|
||||||
//锁定鼠标
|
//锁定鼠标
|
||||||
function Lock() {
|
function Lock() {
|
||||||
|
_Rindro_Cusor_.UseState = 1;
|
||||||
L_sq_WAB(0x1B46886, 1);
|
L_sq_WAB(0x1B46886, 1);
|
||||||
}
|
}
|
||||||
//解锁鼠标
|
//解锁鼠标
|
||||||
function UnLock() {
|
function UnLock() {
|
||||||
|
_Rindro_Cusor_.UseState = 0;
|
||||||
L_sq_WAB(0x1B46886, 0);
|
L_sq_WAB(0x1B46886, 0);
|
||||||
}
|
}
|
||||||
//获取鼠标工作类型
|
//获取鼠标工作类型
|
||||||
function GetType() {
|
function GetType() {
|
||||||
|
return _Rindro_Cusor_.TypeState;
|
||||||
// return L_sq_RAB(0x1b46898);
|
// return L_sq_RAB(0x1b46898);
|
||||||
}
|
}
|
||||||
//设置鼠标工作类型
|
//设置鼠标工作类型
|
||||||
function SetType(Type) {
|
function SetType(Type) {
|
||||||
|
_Rindro_Cusor_.TypeState = Type;
|
||||||
// L_sq_WAB(0x1b46898, Type);
|
// L_sq_WAB(0x1b46898, Type);
|
||||||
}
|
}
|
||||||
//鼠标0状态下是否按下
|
//鼠标0状态下是否按下
|
||||||
function GetBaseState() {
|
function GetBaseState() {
|
||||||
|
return _Rindro_Cusor_.SubState;
|
||||||
// return L_sq_RAB(0x1B46874);
|
// return L_sq_RAB(0x1B46874);
|
||||||
}
|
}
|
||||||
//鼠标0状态设置是否按下
|
//鼠标0状态设置是否按下
|
||||||
function SetBaseState(Flag) {
|
function SetBaseState(Flag) {
|
||||||
|
_Rindro_Cusor_.SubState = Flag;
|
||||||
// return L_sq_WAB(0x1B46874, Flag);
|
// return L_sq_WAB(0x1B46874, Flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -51,7 +57,7 @@ class R_Mouse {
|
||||||
//如果鼠标工作类型不是0则设置为0
|
//如果鼠标工作类型不是0则设置为0
|
||||||
if (R_Mouse.GetType() != 0) R_Mouse.SetType(0);
|
if (R_Mouse.GetType() != 0) R_Mouse.SetType(0);
|
||||||
//如果鼠标是按下状态则设置为未按下
|
//如果鼠标是按下状态则设置为未按下
|
||||||
// if (R_Mouse.GetBaseState() != 0) R_Mouse.SetBaseState(0);
|
if (R_Mouse.GetBaseState() != 0) R_Mouse.SetBaseState(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//基础窗口类 所有UI类继承与本类
|
//基础窗口类 所有UI类继承与本类
|
||||||
|
|
@ -254,53 +260,47 @@ class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow {
|
||||||
// L_sq_MouseClick();
|
// L_sq_MouseClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//道具信息窗口地址
|
||||||
ItemInfoDrawS = null;
|
ItemInfoDrawS = null;
|
||||||
//绘制道具相信信息
|
//绘制道具相信信息
|
||||||
ItemObject = null;
|
ItemObject = null;
|
||||||
|
|
||||||
|
//获取道具信息并生成缓存
|
||||||
|
function GetItemInfo(Id) {
|
||||||
|
if (!Rindro_ItemInfoObject.rawin(Id)) {
|
||||||
|
local ItemObject = L_sq_GetItem(Id);
|
||||||
|
if (!ItemObject) ItemObject = L_sq_GetItem(3037);
|
||||||
|
Rindro_ItemInfoObject.rawset(Id, ItemObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
//绘制道具带道具信息 带道具边框
|
//绘制道具带道具信息 带道具边框
|
||||||
function DrawItemEx(X, Y, Id, Count) {
|
function DrawItemEx(X, Y, Id, Count) {
|
||||||
if (!Rindro_ItemInfoObject.rawin(Id)) Id = 3037;
|
GetItemInfo(Id);
|
||||||
if (Id != -1) {
|
local Rarity = L_sq_RA(Rindro_ItemInfoObject[Id] + 0xF4);
|
||||||
local Rarity = Rindro_ItemInfoObject[Id].Rarity ? Rindro_ItemInfoObject[Id].Rarity : 0;
|
|
||||||
L_sq_DrawImg("interface2/rindro_reward.img", Rarity, X - 3, Y - 3);
|
L_sq_DrawImg("interface2/rindro_reward.img", Rarity, X - 3, Y - 3);
|
||||||
L_Sq_DrawItem(X, Y, Id, Count, 0, 0, 0);
|
DrawItemBase(X, Y, Id, Count);
|
||||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X, Y, 24, 24)) {
|
|
||||||
ItemInfoDrawS = {};
|
|
||||||
ItemInfoDrawS.X <- X;
|
|
||||||
ItemInfoDrawS.Y <- Y;
|
|
||||||
ItemInfoDrawS.ItemId <- Id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//绘制道具带道具信息
|
//绘制道具带道具信息
|
||||||
function DrawItemBase(X, Y, Id, Count) {
|
function DrawItemBase(X, Y, Id, Count) {
|
||||||
if (!Rindro_ItemInfoObject.rawin(Id)) Id = 3037;
|
GetItemInfo(Id);
|
||||||
if (Id != -1) {
|
|
||||||
local Rarity = Rindro_ItemInfoObject[Id].Rarity ? Rindro_ItemInfoObject[Id].Rarity : 0;
|
|
||||||
L_Sq_DrawItem(X, Y, Id, Count, 0, 0, 0);
|
L_Sq_DrawItem(X, Y, Id, Count, 0, 0, 0);
|
||||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X, Y, 24, 24)) {
|
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X, Y, 24, 24)) {
|
||||||
ItemInfoDrawS = {};
|
//打开道具信息窗口
|
||||||
ItemInfoDrawS.X <- X;
|
if (!ItemInfoDrawS) {
|
||||||
ItemInfoDrawS.Y <- Y;
|
ItemInfoDrawS = L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], L_sq_RA(0x1A5FB20), 275, Rindro_ItemInfoObject[Id], 41);
|
||||||
ItemInfoDrawS.ItemId <- Id;
|
//校准道具信息窗口位置
|
||||||
|
L_Sq_CallFunc(0xF3B3B0, "int", FFI_THISCALL, ["int", "int", "int", "int", "int"], ItemInfoDrawS, IMouse.GetXPos(), IMouse.GetYPos(), 28, 28);
|
||||||
|
//我自己UI打开的道具信息窗口需要把渲染队列改为下层 以显示我打开的道具
|
||||||
|
getroottable().WindowsShowABFlag <- false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
//绘制悬停
|
|
||||||
function DrawItemInfo() {
|
|
||||||
if (ItemInfoDrawS) {
|
|
||||||
if (!ItemObject) {
|
|
||||||
local ItemId = ItemInfoDrawS.ItemId;
|
|
||||||
if (Rindro_ItemInfoObject.rawin(ItemId)) {
|
|
||||||
ItemObject = ItemInfoClass(Rindro_ItemInfoObject[ItemId]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ItemObject.Show(ItemInfoDrawS.X, ItemInfoDrawS.Y - ItemObject.PageLength);
|
|
||||||
} else {
|
} else {
|
||||||
ItemObject = null;
|
if (ItemInfoDrawS) {
|
||||||
|
L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0);
|
||||||
|
ItemInfoDrawS = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//生成DT
|
//生成DT
|
||||||
function GenerateDt() {
|
function GenerateDt() {
|
||||||
|
|
@ -321,10 +321,8 @@ class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow {
|
||||||
LenheartNewUI_BaseWindow.Show(obj);
|
LenheartNewUI_BaseWindow.Show(obj);
|
||||||
if (DeBugMode) DeBug(obj);
|
if (DeBugMode) DeBug(obj);
|
||||||
|
|
||||||
|
|
||||||
DrawItemInfo();
|
|
||||||
//初始化绘制道具
|
//初始化绘制道具
|
||||||
ItemInfoDrawS = null;
|
// ItemInfoDrawS = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function TopShow(obj) {
|
function TopShow(obj) {
|
||||||
|
|
@ -458,13 +456,20 @@ function CheackMouseInOldWindows() {
|
||||||
local WindowAddress = L_sq_RA(0x1B474D4);
|
local WindowAddress = L_sq_RA(0x1B474D4);
|
||||||
if (WindowAddress) {
|
if (WindowAddress) {
|
||||||
local Flag = L_sq_RA(WindowAddress);
|
local Flag = L_sq_RA(WindowAddress);
|
||||||
// print(format("%02X", Flag));
|
|
||||||
foreach(value in OldBaseWindowArr) {
|
foreach(value in OldBaseWindowArr) {
|
||||||
if (Flag == value) {
|
if (Flag == value) {
|
||||||
// if ((L_sq_RA(WindowAddress + 0x14) == 0 && L_sq_RA(WindowAddress + 0x18) == 0) || Flag == 0x184D0C4) {
|
// if ((L_sq_RA(WindowAddress + 0x14) == 0 && L_sq_RA(WindowAddress + 0x18) == 0) || Flag == 0x184D0C4) {
|
||||||
// print(false);
|
// print(false);
|
||||||
return false;
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
//空地
|
||||||
|
if (Flag == 0x184D0C4 || Flag == 0x0184CF6C) {
|
||||||
|
//都为0的时候城镇背景 508是血槽那一块的逻辑 坐标Y是508
|
||||||
|
if ((L_sq_RA(WindowAddress + 0x14) == 0 && (L_sq_RA(WindowAddress + 0x18) == 0 || L_sq_RA(WindowAddress + 0x18) == 508))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -480,7 +485,7 @@ function RunMouseLogic(MousePos_X, MousePos_Y) {
|
||||||
//还原鼠标
|
//还原鼠标
|
||||||
R_Mouse.Restore();
|
R_Mouse.Restore();
|
||||||
}
|
}
|
||||||
//在任何老窗口上 并且渲染层未A层 也就是下层渲染
|
//在任何老窗口上 并且渲染层为A层 也就是下层渲染
|
||||||
else if (CheackMouseInOldWindows() && !getroottable().WindowsShowABFlag) {
|
else if (CheackMouseInOldWindows() && !getroottable().WindowsShowABFlag) {
|
||||||
//还原鼠标
|
//还原鼠标
|
||||||
R_Mouse.Restore();
|
R_Mouse.Restore();
|
||||||
|
|
@ -530,13 +535,17 @@ function L_MouseCallBack(MouseState, MouseFlag, MousePos_X, MousePos_Y) {
|
||||||
RunMouseLogic(MousePos_X, MousePos_Y);
|
RunMouseLogic(MousePos_X, MousePos_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断是否悬停活动图标
|
//判断是否悬停活动图标 没悬停在老窗口上 没在选图界面
|
||||||
if (getroottable().rawin("EventList_Obj")) EventList_Obj.CheckInEvent(MousePos_X, MousePos_Y);
|
if (getroottable().rawin("EventList_Obj") && !CheackMouseInOldWindows() && sq_GetCurrentModuleType() != 2) EventList_Obj.CheckInEvent(MousePos_X, MousePos_Y);
|
||||||
|
|
||||||
|
|
||||||
//如果渲染层级在下级 即A层 或者是 鼠标没有悬停在任何新窗口上时 执行判断 如果悬停在原生窗口 就解除鼠标锁定 如果点击 就改变渲染层级
|
//如果渲染层级在下级 即A层 或者是 鼠标没有悬停在任何新窗口上时 执行判断 如果悬停在原生窗口 就解除鼠标锁定 如果点击 就改变渲染层级
|
||||||
if (!getroottable().WindowsShowABFlag || !CheackMouseInNewWindows(MousePos_X, MousePos_Y)) {
|
if (!getroottable().WindowsShowABFlag || !CheackMouseInNewWindows(MousePos_X, MousePos_Y)) {
|
||||||
if (CheackMouseInOldWindows()) {
|
if (CheackMouseInOldWindows()) {
|
||||||
//如果点击了原生窗口 或者使用了滚轮 就把渲染队列改成下
|
//如果点击了原生窗口 或者使用了滚轮 就把渲染队列改成下
|
||||||
if (MouseState == 0x201 || MouseState == 0x20a) getroottable().WindowsShowABFlag <- false;
|
if (MouseState == 0x201 || MouseState == 0x20a) {
|
||||||
|
getroottable().WindowsShowABFlag <- false;
|
||||||
|
}
|
||||||
if (MouseState != 0x20a) return;
|
if (MouseState != 0x20a) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -558,8 +567,6 @@ function L_MouseCallBack(MouseState, MouseFlag, MousePos_X, MousePos_Y) {
|
||||||
case 0x201: {
|
case 0x201: {
|
||||||
//如果点击了新窗口就把渲染队列改成上
|
//如果点击了新窗口就把渲染队列改成上
|
||||||
getroottable().WindowsShowABFlag <- true;
|
getroottable().WindowsShowABFlag <- true;
|
||||||
//点击动画
|
|
||||||
if (getroottable().WindowsShowABFlag) L_sq_WA(0x1B46874, 1);
|
|
||||||
Window.OnMouseLbDown(MousePos_X, MousePos_Y);
|
Window.OnMouseLbDown(MousePos_X, MousePos_Y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -593,7 +600,7 @@ function L_MouseCallBack(MouseState, MouseFlag, MousePos_X, MousePos_Y) {
|
||||||
//打开原生窗口回调
|
//打开原生窗口回调
|
||||||
function L_OpenOldWindowCallBack(WindowIndex) {
|
function L_OpenOldWindowCallBack(WindowIndex) {
|
||||||
//将新窗口渲染队列改为下层 抵消窗口 Esc窗口 登录可能显示的任务窗口
|
//将新窗口渲染队列改为下层 抵消窗口 Esc窗口 登录可能显示的任务窗口
|
||||||
if (WindowIndex != 170 && WindowIndex != 176) {
|
if (WindowIndex != 170 && WindowIndex != 176 && WindowIndex != 276 && WindowIndex != 275 && WindowIndex != 278 && WindowIndex != 283 && WindowIndex != 36) {
|
||||||
getroottable().WindowsShowABFlag <- false;
|
getroottable().WindowsShowABFlag <- false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -604,10 +611,10 @@ function L_WindowsLogic(obj) {
|
||||||
local WindowExistence = false;
|
local WindowExistence = false;
|
||||||
//遍历窗口队列 如果可见则调用Show 只要有一个可见就写入Flag
|
//遍历窗口队列 如果可见则调用Show 只要有一个可见就写入Flag
|
||||||
foreach(Window in L_Windows_List) {
|
foreach(Window in L_Windows_List) {
|
||||||
Window.Proc(obj);
|
if (sq_GetCurrentModuleType() != 2) Window.Proc(obj);
|
||||||
if (Window.Visible) {
|
if (Window.Visible) {
|
||||||
Window.Show(obj);
|
if (sq_GetCurrentModuleType() != 2) Window.Show(obj);
|
||||||
Window.TopShow(obj);
|
if (sq_GetCurrentModuleType() != 2) Window.TopShow(obj);
|
||||||
if (!Window.rawin("NoWindow")) {
|
if (!Window.rawin("NoWindow")) {
|
||||||
WindowExistence = true;
|
WindowExistence = true;
|
||||||
}
|
}
|
||||||
|
|
@ -631,7 +638,8 @@ function L_WindowsLogic(obj) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//如果按下ESC键要将所有的窗口关闭
|
//如果按下ESC键要将所有的窗口关闭
|
||||||
if (KeyPressNB.isKeyPress(48, "AllLenheartWindows")) {
|
if (WindowExistence) {
|
||||||
|
if (KeyPressNB.isKeyPress(48, "AllLenheartWindows") || sq_GetCurrentModuleType() == 2) {
|
||||||
local Flag = false;
|
local Flag = false;
|
||||||
foreach(Window in L_Windows_List) {
|
foreach(Window in L_Windows_List) {
|
||||||
if (!Window.rawin("NoWindow")) {
|
if (!Window.rawin("NoWindow")) {
|
||||||
|
|
@ -640,13 +648,17 @@ function L_WindowsLogic(obj) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Flag) {
|
if (Flag) {
|
||||||
|
getroottable().WindowsShowABFlag <- false;
|
||||||
//还原鼠标
|
//还原鼠标
|
||||||
R_Mouse.Restore();
|
R_Mouse.Restore();
|
||||||
L_sq_MouseClick();
|
L_Sq_CallFunc(0x11A8B60, "void", FFI_MS_CDECL, []);
|
||||||
|
// L_sq_MouseClick();
|
||||||
Rindro_MouseClickFlag = 5;
|
Rindro_MouseClickFlag = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
//绘制下层回调
|
//绘制下层回调
|
||||||
function L_DrawWindow_A() {
|
function L_DrawWindow_A() {
|
||||||
local obj = sq_getMyCharacter();
|
local obj = sq_getMyCharacter();
|
||||||
|
|
@ -686,12 +698,16 @@ class LenheartNewUI_CommonUi extends LenheartNewUI_BaseWindow {
|
||||||
isInRect = false;
|
isInRect = false;
|
||||||
|
|
||||||
OnClick = null;
|
OnClick = null;
|
||||||
|
OnClickEx = null;
|
||||||
|
OnClickSound = null;
|
||||||
ObjectId = null;
|
ObjectId = null;
|
||||||
|
|
||||||
Visible = true;
|
Visible = true;
|
||||||
|
|
||||||
TopCallBackFunc = null;
|
TopCallBackFunc = null;
|
||||||
|
|
||||||
|
Data = null;
|
||||||
|
|
||||||
constructor(x, y, width, height) {
|
constructor(x, y, width, height) {
|
||||||
this.Localtion_X = x;
|
this.Localtion_X = x;
|
||||||
this.Localtion_Y = y;
|
this.Localtion_Y = y;
|
||||||
|
|
@ -714,14 +730,20 @@ class LenheartNewUI_CommonUi extends LenheartNewUI_BaseWindow {
|
||||||
}
|
}
|
||||||
//鼠标左键按下回调
|
//鼠标左键按下回调
|
||||||
function OnMouseLbDown(MousePos_X, MousePos_Y) {
|
function OnMouseLbDown(MousePos_X, MousePos_Y) {
|
||||||
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) isLBDown = true;
|
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) {
|
||||||
|
isLBDown = true;
|
||||||
|
if (!OnClickSound) {
|
||||||
|
R_Utils.PlaySound("CLICK_BUTTON1");
|
||||||
|
} else {
|
||||||
|
R_Utils.PlaySound(OnClickSound);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//鼠标左键弹起回调
|
//鼠标左键弹起回调
|
||||||
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
||||||
if (isLBDown && OnClick) {
|
if (isLBDown) {
|
||||||
local obj = sq_getMyCharacter();
|
if (OnClick) OnClick();
|
||||||
obj.sq_PlaySound("CLICK_BUTTON1");
|
if (OnClickEx) OnClickEx(this);
|
||||||
OnClick();
|
|
||||||
}
|
}
|
||||||
isLBDown = false;
|
isLBDown = false;
|
||||||
}
|
}
|
||||||
|
|
@ -922,12 +944,17 @@ class LenheartNewUI_BaseInput extends LenheartNewUI_CommonUi {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function SetStr(Value) {
|
||||||
|
L_sq_SetInputBoxStr(InputController, Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//复选框
|
//复选框
|
||||||
class LenheartNewUI_SwitchButton extends LenheartNewUI_CommonUi {
|
class LenheartNewUI_SwitchButton extends LenheartNewUI_CommonUi {
|
||||||
State = 0;
|
State = 0;
|
||||||
ImgIndex = null;
|
ImgIndex = null;
|
||||||
|
ImgPath = "interface/lenheartwindowcommon.img";
|
||||||
|
|
||||||
constructor(X, Y) {
|
constructor(X, Y) {
|
||||||
LenheartNewUI_CommonUi.constructor(X, Y, 14, 15);
|
LenheartNewUI_CommonUi.constructor(X, Y, 14, 15);
|
||||||
|
|
@ -936,25 +963,25 @@ class LenheartNewUI_SwitchButton extends LenheartNewUI_CommonUi {
|
||||||
function Show(obj) {
|
function Show(obj) {
|
||||||
//不可用
|
//不可用
|
||||||
if (State == 8) {
|
if (State == 8) {
|
||||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 3 : 141, X, Y + 1);
|
L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 3 : 141, X, Y + 1);
|
||||||
} else {
|
} else {
|
||||||
//悬停
|
//悬停
|
||||||
if (isLBDown) {
|
if (isLBDown) {
|
||||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 2 : 140, X, Y + 1);
|
L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 2 : 140, X, Y + 1);
|
||||||
}
|
}
|
||||||
//按下
|
//按下
|
||||||
else if (isInRect) {
|
else if (isInRect) {
|
||||||
if (State == 0)
|
if (State == 0)
|
||||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 1 : 139, X, Y);
|
L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 1 : 139, X, Y);
|
||||||
if (State == 1)
|
if (State == 1)
|
||||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 2 : 140, X, Y);
|
L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 2 : 140, X, Y);
|
||||||
}
|
}
|
||||||
//普通
|
//普通
|
||||||
else {
|
else {
|
||||||
if (State == 0)
|
if (State == 0)
|
||||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex : 138, X, Y);
|
L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex : 138, X, Y);
|
||||||
if (State == 1)
|
if (State == 1)
|
||||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 2 : 140, X, Y);
|
L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 2 : 140, X, Y);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,13 @@ class Json {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Decode(Str) {
|
function Decode(Str) {
|
||||||
Str = L_sq_DecondeJson(Str);
|
// Str = L_sq_DecondeJson(Str);
|
||||||
local Str = "local _M = " + Str + ";\n return _M;\n";
|
// local Str = "local _M = " + Str + ";\n return _M;\n";
|
||||||
local Func = compilestring(Str);
|
// local Func = compilestring(Str);
|
||||||
return Func();
|
// return Func();
|
||||||
|
|
||||||
|
local JsonObj = JSONParser();
|
||||||
|
return JsonObj.parse(Str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Key 键盘按键类
|
//Key 键盘按键类
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
文件名:Hacker_Class.nut
|
||||||
|
路径:Base/_Tool/Hacker_Class.nut
|
||||||
|
创建日期:2024-09-24 06:25
|
||||||
|
文件用途:
|
||||||
|
*/
|
||||||
|
class _Rindro_Hacker {
|
||||||
|
HookTable = null;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
HookTable = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
function UnLoadHook(AddressStr) {
|
||||||
|
Sq_DeHookFunc(HookTable[AddressStr]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function LoadHook(AddressStr, ArgumentArr, EnterFunc, LeaveFunc) {
|
||||||
|
//如果已经HOOK过 需要先卸载原来的HOOK
|
||||||
|
if (HookTable.rawin(AddressStr)) {
|
||||||
|
UnLoadHook(AddressStr);
|
||||||
|
print("地址: " + AddressStr + " 已经装载了Hook,本次操作将会卸载之前的Hook在执行。")
|
||||||
|
}
|
||||||
|
|
||||||
|
local Controler = Sq_HookFunc(AddressStr, ArgumentArr, EnterFunc, LeaveFunc);
|
||||||
|
HookTable.rawset(AddressStr, Controler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//初始化Hacker
|
||||||
|
if (!(getroottable().rawin("Rindro_Haker"))) Rindro_Haker <- _Rindro_Hacker();
|
||||||
|
|
||||||
|
|
||||||
|
//重选角色时触发的回调函数(进入赛利亚房间)
|
||||||
|
OnSetCharacter_Control <- {}
|
||||||
|
Rindro_Haker.LoadHook(0x674350, ["pointer", "int"],
|
||||||
|
function(args) {
|
||||||
|
foreach(Func in OnSetCharacter_Control) {
|
||||||
|
Func();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
function(args) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
文件名:Hacker_RegApi.nut
|
||||||
|
路径:Base/_Tool/Hacker_RegApi.nut
|
||||||
|
创建日期:2024-09-25 18:31
|
||||||
|
文件用途:注册API
|
||||||
|
*/
|
||||||
|
//工具类
|
||||||
|
class R_Utils {
|
||||||
|
|
||||||
|
//播放音效
|
||||||
|
function PlaySound(SoundName) {
|
||||||
|
L_Sq_CallFunc(0x75BD70, "void", FFI_MS_CDECL, ["pointer", "int", "int", "int"], Memory.allocUtf8String(SoundName).C_Object, -1, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//读取文件内容
|
||||||
|
function ReadScript(Path, Size, CodePage) {
|
||||||
|
local ReadPath = L_sq_P2I(Memory.allocUtf8String(Path).C_Object);
|
||||||
|
local Reader = Memory.alloc(Size);
|
||||||
|
local ReadBuffer = L_sq_P2I(Reader.C_Object);
|
||||||
|
L_Sq_CallFunc(0x11A2030, "int", FFI_FASTCALL, ["int", "int", "int", "int", "int", "int"], 0x1D17638, 0, ReadPath, ReadBuffer, 0x100000, 0x19DAF4);
|
||||||
|
|
||||||
|
|
||||||
|
if (CodePage == "utf8")
|
||||||
|
return Reader.readUtf8String();
|
||||||
|
if (CodePage == "unicode")
|
||||||
|
return Reader.readUnicodeString();
|
||||||
|
if (CodePage == "big5")
|
||||||
|
return Reader.readBig5String();
|
||||||
|
}
|
||||||
|
|
||||||
|
//读取配置表
|
||||||
|
function ReadScriptConfig(Path, Size, ...) {
|
||||||
|
local CodePage = "utf8";
|
||||||
|
if (vargc > 0) CodePage = vargv[0];
|
||||||
|
local Script = R_Utils.ReadScript(Path, Size, CodePage);
|
||||||
|
local Func = compilestring("return " + Script);
|
||||||
|
local Ret = Func();
|
||||||
|
return Ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取一个指定装备的角色Ani
|
||||||
|
function GetCharacByEqu(Job, GrowType, Equ) {
|
||||||
|
local Obj = sq_CreateCharacter(Job, GrowType);
|
||||||
|
local ObjAddress = L_Sq_GetObjectAddress(Obj);
|
||||||
|
foreach(value in Equ) {
|
||||||
|
local ItemObject = L_sq_GetItem(value);
|
||||||
|
L_Sq_CallFunc(0x825570, "void", FFI_THISCALL, ["int", "int"], ObjAddress, ItemObject);
|
||||||
|
}
|
||||||
|
return Obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,661 @@
|
||||||
|
/*
|
||||||
|
文件名:Json_Class.nut
|
||||||
|
路径:Base/_Tool/Json_Class.nut
|
||||||
|
创建日期:2024-09-27 23:54
|
||||||
|
文件用途:Json类
|
||||||
|
*/
|
||||||
|
|
||||||
|
class JSONParser {
|
||||||
|
|
||||||
|
|
||||||
|
static version = "1.0.1";
|
||||||
|
|
||||||
|
|
||||||
|
state = "";
|
||||||
|
stack = null;
|
||||||
|
container = null;
|
||||||
|
key = "";
|
||||||
|
value = "";
|
||||||
|
converter = null;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
stack = [];
|
||||||
|
container = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
function parse(str, ...) {
|
||||||
|
if (vargc > 0) converter = vargc[0];
|
||||||
|
|
||||||
|
|
||||||
|
// actions for string tokens
|
||||||
|
local string = {
|
||||||
|
go = function() {
|
||||||
|
state = "ok";
|
||||||
|
}.bindenv(this),
|
||||||
|
firstokey = function() {
|
||||||
|
key = value;
|
||||||
|
state = "colon";
|
||||||
|
}.bindenv(this),
|
||||||
|
okey = function() {
|
||||||
|
key = value;
|
||||||
|
state = "colon";
|
||||||
|
}.bindenv(this),
|
||||||
|
ovalue = function() {
|
||||||
|
value = this._convert(value, "string", converter);
|
||||||
|
state = "ocomma";
|
||||||
|
}.bindenv(this),
|
||||||
|
firstavalue = function() {
|
||||||
|
value = this._convert(value, "string", converter);
|
||||||
|
state = "acomma";
|
||||||
|
}.bindenv(this),
|
||||||
|
avalue = function() {
|
||||||
|
value = value;
|
||||||
|
this._convert(value, "string", converter);
|
||||||
|
state = "acomma";
|
||||||
|
}.bindenv(this)
|
||||||
|
};
|
||||||
|
|
||||||
|
// the actions for number tokens
|
||||||
|
local number = {
|
||||||
|
go = function() {
|
||||||
|
state = "ok";
|
||||||
|
}.bindenv(this),
|
||||||
|
ovalue = function() {
|
||||||
|
value = this._convert(value, "number", converter);
|
||||||
|
state = "ocomma";
|
||||||
|
}.bindenv(this),
|
||||||
|
firstavalue = function() {
|
||||||
|
value = this._convert(value, "number", converter);
|
||||||
|
state = "acomma";
|
||||||
|
}.bindenv(this),
|
||||||
|
avalue = function() {
|
||||||
|
value = this._convert(value, "number", converter);
|
||||||
|
state = "acomma";
|
||||||
|
}.bindenv(this)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// action table
|
||||||
|
// describes where the state machine will go from each given state
|
||||||
|
local action = {};
|
||||||
|
|
||||||
|
|
||||||
|
action["{"] <- {
|
||||||
|
go = function() {
|
||||||
|
stack.push({
|
||||||
|
state = "ok"
|
||||||
|
});
|
||||||
|
container = {};
|
||||||
|
state = "firstokey";
|
||||||
|
}.bindenv(this),
|
||||||
|
ovalue = function() {
|
||||||
|
stack.push({
|
||||||
|
container = container,
|
||||||
|
state = "ocomma",
|
||||||
|
key = key
|
||||||
|
});
|
||||||
|
container = {};
|
||||||
|
state = "firstokey";
|
||||||
|
}.bindenv(this),
|
||||||
|
firstavalue = function() {
|
||||||
|
stack.push({
|
||||||
|
container = container,
|
||||||
|
state = "acomma"
|
||||||
|
});
|
||||||
|
container = {};
|
||||||
|
state = "firstokey";
|
||||||
|
}.bindenv(this),
|
||||||
|
avalue = function() {
|
||||||
|
stack.push({
|
||||||
|
container = container,
|
||||||
|
state = "acomma"
|
||||||
|
});
|
||||||
|
container = {};
|
||||||
|
state = "firstokey";
|
||||||
|
}.bindenv(this)
|
||||||
|
},
|
||||||
|
|
||||||
|
action["}"] <- {
|
||||||
|
firstokey = function() {
|
||||||
|
local pop = stack.pop();
|
||||||
|
value = container;
|
||||||
|
container = ("container" in pop) ? pop.container : null;
|
||||||
|
key = ("key" in pop) ? pop.key : null;
|
||||||
|
state = pop.state;
|
||||||
|
}.bindenv(this),
|
||||||
|
ocomma = function() {
|
||||||
|
local pop = stack.pop();
|
||||||
|
container[key] <- value;
|
||||||
|
value = container;
|
||||||
|
container = ("container" in pop) ? pop.container : null;
|
||||||
|
key = ("key" in pop) ? pop.key : null;
|
||||||
|
state = pop.state;
|
||||||
|
}.bindenv(this)
|
||||||
|
},
|
||||||
|
|
||||||
|
action["["] <- {
|
||||||
|
go = function() {
|
||||||
|
stack.push({
|
||||||
|
state = "ok"
|
||||||
|
});
|
||||||
|
container = [];
|
||||||
|
state = "firstavalue";
|
||||||
|
}.bindenv(this),
|
||||||
|
ovalue = function() {
|
||||||
|
stack.push({
|
||||||
|
container = container,
|
||||||
|
state = "ocomma",
|
||||||
|
key = key
|
||||||
|
});
|
||||||
|
container = [];
|
||||||
|
state = "firstavalue";
|
||||||
|
}.bindenv(this),
|
||||||
|
firstavalue = function() {
|
||||||
|
stack.push({
|
||||||
|
container = container,
|
||||||
|
state = "acomma"
|
||||||
|
});
|
||||||
|
container = [];
|
||||||
|
state = "firstavalue";
|
||||||
|
}.bindenv(this),
|
||||||
|
avalue = function() {
|
||||||
|
stack.push({
|
||||||
|
container = container,
|
||||||
|
state = "acomma"
|
||||||
|
});
|
||||||
|
container = [];
|
||||||
|
state = "firstavalue";
|
||||||
|
}.bindenv(this)
|
||||||
|
},
|
||||||
|
|
||||||
|
action["]"] <- {
|
||||||
|
firstavalue = function() {
|
||||||
|
local pop = stack.pop();
|
||||||
|
value = container;
|
||||||
|
container = ("container" in pop) ? pop.container : null;
|
||||||
|
key = ("key" in pop) ? pop.key : null;
|
||||||
|
state = pop.state;
|
||||||
|
}.bindenv(this),
|
||||||
|
acomma = function() {
|
||||||
|
local pop = stack.pop();
|
||||||
|
container.push(value);
|
||||||
|
value = container;
|
||||||
|
container = ("container" in pop) ? pop.container : null;
|
||||||
|
key = ("key" in pop) ? pop.key : null;
|
||||||
|
state = pop.state;
|
||||||
|
}.bindenv(this)
|
||||||
|
},
|
||||||
|
|
||||||
|
action[":"] <- {
|
||||||
|
colon = function() {
|
||||||
|
// Check if the key already exists
|
||||||
|
// NOTE previous code used 'if (key in container)...'
|
||||||
|
// but this finds table ('container') member methods too
|
||||||
|
local err = false;
|
||||||
|
foreach(akey, avalue in container) {
|
||||||
|
if (akey == key) err = true;
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if (err) throw "Duplicate key \"" + key + "\"";
|
||||||
|
state = "ovalue";
|
||||||
|
}.bindenv(this)
|
||||||
|
},
|
||||||
|
|
||||||
|
action[","] <- {
|
||||||
|
ocomma = function() {
|
||||||
|
container[key] <- value;
|
||||||
|
state = "okey";
|
||||||
|
}.bindenv(this),
|
||||||
|
acomma = function() {
|
||||||
|
container.push(value);
|
||||||
|
state = "avalue";
|
||||||
|
}.bindenv(this)
|
||||||
|
},
|
||||||
|
|
||||||
|
action["true"] <- {
|
||||||
|
go = function() {
|
||||||
|
value = true;
|
||||||
|
state = "ok";
|
||||||
|
}.bindenv(this),
|
||||||
|
ovalue = function() {
|
||||||
|
value = true;
|
||||||
|
state = "ocomma";
|
||||||
|
}.bindenv(this),
|
||||||
|
firstavalue = function() {
|
||||||
|
value = true;
|
||||||
|
state = "acomma";
|
||||||
|
}.bindenv(this),
|
||||||
|
avalue = function() {
|
||||||
|
value = true;
|
||||||
|
state = "acomma";
|
||||||
|
}.bindenv(this)
|
||||||
|
},
|
||||||
|
|
||||||
|
action["false"] <- {
|
||||||
|
go = function() {
|
||||||
|
value = false;
|
||||||
|
state = "ok";
|
||||||
|
}.bindenv(this),
|
||||||
|
ovalue = function() {
|
||||||
|
value = false;
|
||||||
|
state = "ocomma";
|
||||||
|
}.bindenv(this),
|
||||||
|
firstavalue = function() {
|
||||||
|
value = false;
|
||||||
|
state = "acomma";
|
||||||
|
}.bindenv(this),
|
||||||
|
avalue = function() {
|
||||||
|
value = false;
|
||||||
|
state = "acomma";
|
||||||
|
}.bindenv(this)
|
||||||
|
},
|
||||||
|
|
||||||
|
action["null"] <- {
|
||||||
|
go = function() {
|
||||||
|
value = null;
|
||||||
|
state = "ok";
|
||||||
|
}.bindenv(this),
|
||||||
|
ovalue = function() {
|
||||||
|
value = null;
|
||||||
|
state = "ocomma";
|
||||||
|
}.bindenv(this),
|
||||||
|
firstavalue = function() {
|
||||||
|
value = null;
|
||||||
|
state = "acomma";
|
||||||
|
}.bindenv(this),
|
||||||
|
avalue = function() {
|
||||||
|
value = null;
|
||||||
|
state = "acomma";
|
||||||
|
}.bindenv(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
state = "go";
|
||||||
|
stack = [];
|
||||||
|
|
||||||
|
// current tokenizeing position
|
||||||
|
local start = 0;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
local result, token, tokenizer = _JSONTokenizer();
|
||||||
|
|
||||||
|
while (token = tokenizer.nextToken(str, start)) {
|
||||||
|
|
||||||
|
if ("ptfn" == token.type) {
|
||||||
|
// punctuation/true/false/null
|
||||||
|
action[token.value][state]();
|
||||||
|
} else if ("number" == token.type) {
|
||||||
|
// number
|
||||||
|
value = token.value;
|
||||||
|
number[state]();
|
||||||
|
} else if ("string" == token.type) {
|
||||||
|
// string
|
||||||
|
value = tokenizer.unescape(token.value);
|
||||||
|
string[state]();
|
||||||
|
}
|
||||||
|
|
||||||
|
start += token.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
state = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (state != "ok" || regexp("[^\\s]").capture(str, start)) {
|
||||||
|
local near = str.slice(start, GetMin(str.len(), start + 10));
|
||||||
|
throw "JSON Syntax Error near `" + near + "`";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetMin(a, b) {
|
||||||
|
return a< b ? a : b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _convert(value, type, converter) {
|
||||||
|
if ("function" == typeof converter) {
|
||||||
|
|
||||||
|
// # of params for converter function
|
||||||
|
|
||||||
|
local parametercCount = 2;
|
||||||
|
|
||||||
|
// .getinfos() is missing on ei platform
|
||||||
|
if ("getinfos" in converter) {
|
||||||
|
parametercCount = converter.getinfos().parameters.len() -
|
||||||
|
1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parametercCount == 1) {
|
||||||
|
return converter(value);
|
||||||
|
} else if (parametercCount == 2) {
|
||||||
|
return converter(value, type);
|
||||||
|
} else {
|
||||||
|
throw "Error: converter function must take 1 or 2 parameters"
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ("number" == type) {
|
||||||
|
local Ret = (value.find(".") == null && value.find("e") == null && value.find("E") == null) ? value.tointeger() : value.tofloat();
|
||||||
|
return Ret;
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class _JSONTokenizer {
|
||||||
|
|
||||||
|
_ptfnRegex = null;
|
||||||
|
_numberRegex = null;
|
||||||
|
_stringRegex = null;
|
||||||
|
_ltrimRegex = null;
|
||||||
|
_unescapeRegex = null;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
// punctuation/true/false/null
|
||||||
|
this._ptfnRegex = regexp("^(?:\\,|\\:|\\[|\\]|\\{|\\}|true|false|null)");
|
||||||
|
|
||||||
|
// numbers
|
||||||
|
this._numberRegex = regexp("^(?:\\-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)");
|
||||||
|
|
||||||
|
// strings
|
||||||
|
this._stringRegex = regexp("^(?:\\\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\\\")");
|
||||||
|
|
||||||
|
// ltrim pattern
|
||||||
|
this._ltrimRegex = regexp("^[\\s\\t\\n\\r]*");
|
||||||
|
|
||||||
|
// string unescaper tokenizer pattern
|
||||||
|
this._unescapeRegex = regexp("\\\\(?:(?:u\\d{4})|[\\\"\\\\/bfnrt])");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function nextToken(str, ...) {
|
||||||
|
local start = 0;
|
||||||
|
if (vargc > 0) start = vargv[0];
|
||||||
|
local
|
||||||
|
m,
|
||||||
|
type,
|
||||||
|
token,
|
||||||
|
value,
|
||||||
|
length,
|
||||||
|
whitespaces;
|
||||||
|
|
||||||
|
// count # of left-side whitespace chars
|
||||||
|
whitespaces = this._leadingWhitespaces(str, start);
|
||||||
|
start += whitespaces;
|
||||||
|
|
||||||
|
if (m = this._ptfnRegex.capture(str, start)) {
|
||||||
|
// punctuation/true/false/null
|
||||||
|
value = str.slice(m[0].begin, m[0].end);
|
||||||
|
type = "ptfn";
|
||||||
|
} else if (m = this._numberRegex.capture(str, start)) {
|
||||||
|
// number
|
||||||
|
value = str.slice(m[0].begin, m[0].end);
|
||||||
|
type = "number";
|
||||||
|
} else if (m = this._stringRegex.capture(str, start)) {
|
||||||
|
// string
|
||||||
|
value = str.slice(m[1].begin, m[1].end);
|
||||||
|
type = "string";
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
token = {
|
||||||
|
type = type,
|
||||||
|
value = value,
|
||||||
|
length = m[0].end - m[0].begin + whitespaces
|
||||||
|
};
|
||||||
|
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _leadingWhitespaces(str, start) {
|
||||||
|
local r = this._ltrimRegex.capture(str, start);
|
||||||
|
|
||||||
|
if (r) {
|
||||||
|
return r[0].end - r[0].begin;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// unesacape() replacements table
|
||||||
|
_unescapeReplacements = {
|
||||||
|
b = "\b",
|
||||||
|
f = "\f",
|
||||||
|
n = "\n",
|
||||||
|
r = "\r",
|
||||||
|
t = "\t"
|
||||||
|
};
|
||||||
|
|
||||||
|
function unescape(str) {
|
||||||
|
|
||||||
|
local start = 0;
|
||||||
|
local res = "";
|
||||||
|
|
||||||
|
while (start< str.len()) {
|
||||||
|
local m = this._unescapeRegex.capture(str, start);
|
||||||
|
|
||||||
|
if (m) {
|
||||||
|
local token = str.slice(m[0].begin, m[0].end);
|
||||||
|
|
||||||
|
// append chars before match
|
||||||
|
local pre = str.slice(start, m[0].begin);
|
||||||
|
res += pre;
|
||||||
|
|
||||||
|
if (token.len() == 6) {
|
||||||
|
res += token;
|
||||||
|
} else {
|
||||||
|
local char = token.slice(1);
|
||||||
|
|
||||||
|
if (char in this._unescapeReplacements) {
|
||||||
|
res += this._unescapeReplacements[char];
|
||||||
|
} else {
|
||||||
|
res += char;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
res += str.slice(start);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
start = m[0].end;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class JSONEncoder {
|
||||||
|
|
||||||
|
static VERSION = "2.0.0";
|
||||||
|
|
||||||
|
// max structure depth
|
||||||
|
// anything above probably has a cyclic ref
|
||||||
|
static _maxDepth = 32;
|
||||||
|
|
||||||
|
|
||||||
|
function encode(value) {
|
||||||
|
return this._encode(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _encode(val, ...) {
|
||||||
|
local depth = 0;
|
||||||
|
if (vargc > 0) depth = vargv[0];
|
||||||
|
// detect cyclic reference
|
||||||
|
if (depth > this._maxDepth) {
|
||||||
|
throw "Possible cyclic reference";
|
||||||
|
}
|
||||||
|
|
||||||
|
local
|
||||||
|
r = "",
|
||||||
|
s = "",
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
switch (typeof val) {
|
||||||
|
|
||||||
|
case "table":
|
||||||
|
case "class":
|
||||||
|
s = "";
|
||||||
|
|
||||||
|
// serialize properties, but not functions
|
||||||
|
foreach(k, v in val) {
|
||||||
|
if (typeof v != "function") {
|
||||||
|
s += ",\"" + k + "\":" + this._encode(v, depth + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
s = s.len() > 0 ? s.slice(1) : s;
|
||||||
|
r += "{" + s + "}";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "array":
|
||||||
|
s = "";
|
||||||
|
|
||||||
|
for (i = 0; i< val.len(); i++) {
|
||||||
|
s += "," + this._encode(val[i], depth + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
s = (i > 0) ? s.slice(1) : s;
|
||||||
|
r += "[" + s + "]";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "integer":
|
||||||
|
case "float":
|
||||||
|
case "bool":
|
||||||
|
r += val;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "null":
|
||||||
|
r += "null";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "instance":
|
||||||
|
|
||||||
|
if ("_serializeRaw" in val && typeof val._serializeRaw == "function") {
|
||||||
|
|
||||||
|
// include value produced by _serializeRaw()
|
||||||
|
r += val._serializeRaw().tostring();
|
||||||
|
|
||||||
|
} else if ("_serialize" in val && typeof val._serialize == "function") {
|
||||||
|
|
||||||
|
// serialize instances by calling _serialize method
|
||||||
|
r += this._encode(val._serialize(), depth + 1);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
s = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
// iterate through instances which implement _nexti meta-method
|
||||||
|
foreach(k, v in val) {
|
||||||
|
s += ",\"" + k + "\":" + this._encode(v, depth + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
// iterate through instances w/o _nexti
|
||||||
|
// serialize properties, but not functions
|
||||||
|
foreach(k, v in val.getclass()) {
|
||||||
|
if (typeof v != "function") {
|
||||||
|
s += ",\"" + k + "\":" + this._encode(val[k], depth + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
s = s.len() > 0 ? s.slice(1) : s;
|
||||||
|
r += "{" + s + "}";
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "blob":
|
||||||
|
// This is a workaround for a known bug:
|
||||||
|
// on device side Blob.tostring() returns null
|
||||||
|
// (instaead of an empty string)
|
||||||
|
r += "\"" + (val.len() ? this._escape(val.tostring()) : "") + "\"";
|
||||||
|
break;
|
||||||
|
|
||||||
|
// strings and all other
|
||||||
|
default:
|
||||||
|
r += "\"" + this._escape(val.tostring()) + "\"";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _escape(str) {
|
||||||
|
local res = "";
|
||||||
|
|
||||||
|
for (local i = 0; i< str.len(); i++) {
|
||||||
|
|
||||||
|
local ch1 = (str[i] & 0xFF);
|
||||||
|
|
||||||
|
if ((ch1 & 0x80) == 0x00) {
|
||||||
|
// 7-bit Ascii
|
||||||
|
|
||||||
|
ch1 = format("%c", ch1);
|
||||||
|
|
||||||
|
if (ch1 == "\"") {
|
||||||
|
res += "\\\"";
|
||||||
|
} else if (ch1 == "\\") {
|
||||||
|
res += "\\\\";
|
||||||
|
} else if (ch1 == "/") {
|
||||||
|
res += "\\/";
|
||||||
|
} else if (ch1 == "\b") {
|
||||||
|
res += "\\b";
|
||||||
|
} else if (ch1 == "\f") {
|
||||||
|
res += "\\f";
|
||||||
|
} else if (ch1 == "\n") {
|
||||||
|
res += "\\n";
|
||||||
|
} else if (ch1 == "\r") {
|
||||||
|
res += "\\r";
|
||||||
|
} else if (ch1 == "\t") {
|
||||||
|
res += "\\t";
|
||||||
|
} else if (ch1 == "\0") {
|
||||||
|
res += "\\u0000";
|
||||||
|
} else {
|
||||||
|
res += ch1;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if ((ch1 & 0xE0) == 0xC0) {
|
||||||
|
// 110xxxxx = 2-byte unicode
|
||||||
|
local ch2 = (str[++i] & 0xFF);
|
||||||
|
res += format("%c%c", ch1, ch2);
|
||||||
|
} else if ((ch1 & 0xF0) == 0xE0) {
|
||||||
|
// 1110xxxx = 3-byte unicode
|
||||||
|
local ch2 = (str[++i] & 0xFF);
|
||||||
|
local ch3 = (str[++i] & 0xFF);
|
||||||
|
res += format("%c%c%c", ch1, ch2, ch3);
|
||||||
|
} else if ((ch1 & 0xF8) == 0xF0) {
|
||||||
|
// 11110xxx = 4 byte unicode
|
||||||
|
local ch2 = (str[++i] & 0xFF);
|
||||||
|
local ch3 = (str[++i] & 0xFF);
|
||||||
|
local ch4 = (str[++i] & 0xFF);
|
||||||
|
res += format("%c%c%c%c", ch1, ch2, ch3, ch4);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,204 @@
|
||||||
|
/*
|
||||||
|
文件名:MemoryClass.nut
|
||||||
|
路径:Base/_Tool/MemoryClass.nut
|
||||||
|
创建日期:2024-09-24 08:22
|
||||||
|
文件用途:
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Memory {
|
||||||
|
|
||||||
|
function alloc(Size) {
|
||||||
|
return NativePointer(Size);
|
||||||
|
}
|
||||||
|
|
||||||
|
function allocUtf8String(Str) {
|
||||||
|
return NativePointer(Str_Ptr(Str));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class NativePointer {
|
||||||
|
|
||||||
|
C_Object = null;
|
||||||
|
|
||||||
|
constructor(T) {
|
||||||
|
if (type(T) == "integer") {
|
||||||
|
C_Object = Sq_New_Point(T);
|
||||||
|
//注册销毁伪析构
|
||||||
|
Register_Destruction(C_Object, this);
|
||||||
|
} else if (type(T) == "userdata") {
|
||||||
|
C_Object = T;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function add(intoffset) {
|
||||||
|
this.C_Object = L_sq_I2P(L_sq_P2I(this.C_Object) + intoffset);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
function sub(intoffset) {
|
||||||
|
this.C_Object = L_sq_I2P(L_sq_P2I(this.C_Object) - intoffset);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeByteArray(arr) {
|
||||||
|
Sq_Memory_WriteByteArr(this.C_Object, arr);
|
||||||
|
}
|
||||||
|
|
||||||
|
function readByteArray(size) {
|
||||||
|
local PointB = Sq_Point2Blob(this.C_Object, size);
|
||||||
|
local arr = [];
|
||||||
|
foreach(value in PointB) {
|
||||||
|
arr.append(value);
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function write(value, type) {
|
||||||
|
local Buf = blob(0);
|
||||||
|
Buf.writen(value, type);
|
||||||
|
local arr = [];
|
||||||
|
foreach(value in Buf) {
|
||||||
|
arr.append(value);
|
||||||
|
}
|
||||||
|
writeByteArray(arr);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeS8(value) {
|
||||||
|
write(value, 'c');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeU8(value) {
|
||||||
|
write(value, 'b');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeS16(value) {
|
||||||
|
write(value, 's');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeU16(value) {
|
||||||
|
write(value, 'w');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeS32(value) {
|
||||||
|
write(value, 'i');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeU32(value) {
|
||||||
|
write(value, 'i');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeShort(value) {
|
||||||
|
write(value, 's');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeUShort(value) {
|
||||||
|
write(value, 'w');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeInt(value) {
|
||||||
|
write(value, 'i');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeUInt(value) {
|
||||||
|
write(value, 'i');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeFloat(value) {
|
||||||
|
write(value, 'f');
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeDouble(value) {
|
||||||
|
write(value, 'd');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function read(type) {
|
||||||
|
local Buf = Sq_Point2Blob(L_sq_P2I(this.C_Object), 4);
|
||||||
|
foreach(value in Buf) {
|
||||||
|
print(value);
|
||||||
|
}
|
||||||
|
return Buf.readn(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
function readS8() {
|
||||||
|
return read('c');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readU8() {
|
||||||
|
return read('b');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readS16() {
|
||||||
|
return read('s');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readU16() {
|
||||||
|
return read('w');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readS32() {
|
||||||
|
return read('i');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readU32() {
|
||||||
|
return read('i');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readShort() {
|
||||||
|
return read('s');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readUShort() {
|
||||||
|
return read('w');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readInt() {
|
||||||
|
return read('i');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readUInt() {
|
||||||
|
return read('i');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readFloat() {
|
||||||
|
return read('f');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readDouble() {
|
||||||
|
return read('d');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function readUnicodeString(...) {
|
||||||
|
if (vargc > 0) {
|
||||||
|
return Sq_Memory_ReadString(this.C_Object, vargv[0]);
|
||||||
|
} else {
|
||||||
|
return Sq_Memory_ReadString(this.C_Object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function readUtf8String(...) {
|
||||||
|
if (vargc > 0) {
|
||||||
|
return Sq_Memory_ReadStringByUtf8(this.C_Object, vargv[0]);
|
||||||
|
} else {
|
||||||
|
return Sq_Memory_ReadStringByUtf8(this.C_Object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function readBig5String(...) {
|
||||||
|
if (vargc > 0) {
|
||||||
|
return Sq_Memory_ReadStringByBig5(this.C_Object, vargv[0]);
|
||||||
|
} else {
|
||||||
|
return Sq_Memory_ReadStringByBig5(this.C_Object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function readPointer() {
|
||||||
|
return Sq_ReadPoint(this.C_Object);
|
||||||
|
}
|
||||||
|
|
||||||
|
function tostring() {
|
||||||
|
return this.C_Object.tostring();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,56 +6,54 @@
|
||||||
*/
|
*/
|
||||||
if (!getroottable().rawin("Rindro_ItemInfoObject")) Rindro_ItemInfoObject <- {};
|
if (!getroottable().rawin("Rindro_ItemInfoObject")) Rindro_ItemInfoObject <- {};
|
||||||
if (!getroottable().rawin("Rindro_ItemInfoBuf")) Rindro_ItemInfoBuf <- "";
|
if (!getroottable().rawin("Rindro_ItemInfoBuf")) Rindro_ItemInfoBuf <- "";
|
||||||
if (!getroottable().rawin("RINDRO_INIT_FLAG")) RINDRO_INIT_FLAG <- false;
|
if (!getroottable().rawin("RINDRO_INIT_FLAG")) RINDRO_INIT_FLAG <- true;
|
||||||
|
|
||||||
//获取本地配置
|
//获取本地配置
|
||||||
function Rindro_GetLocalConfig() {
|
function Rindro_GetLocalConfig() {
|
||||||
local Buf = L_sq_GetLocalConfig();
|
// local Buf = L_sq_GetLocalConfig();
|
||||||
if (!Buf) {
|
// if (!Buf) {
|
||||||
return {
|
// return {
|
||||||
md5 = -1
|
// md5 = -1
|
||||||
};
|
// };
|
||||||
} else return Json.Decode(Buf);
|
// } else return dofile("Rindro_Config.cfg");
|
||||||
}
|
}
|
||||||
// if (!getroottable().rawin("RINDRO_CONFIG"))
|
|
||||||
RINDRO_CONFIG <- Rindro_GetLocalConfig();
|
|
||||||
|
|
||||||
//获取本地信息版本
|
//获取本地信息版本
|
||||||
function Rindro_GetMd5() {
|
function Rindro_GetMd5() {
|
||||||
return RINDRO_CONFIG.md5;
|
// return RINDRO_CONFIG.md5;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化各种信息
|
//初始化各种信息
|
||||||
function Rindro_Init() {
|
function Rindro_Init() {
|
||||||
//道具信息
|
// //道具信息
|
||||||
local ItemArray = getroottable().RINDRO_CONFIG.itemInfo;
|
// local ItemArray = getroottable().RINDRO_CONFIG.itemInfo;
|
||||||
Rindro_ItemInfoBuf = "";
|
// Rindro_ItemInfoBuf = "";
|
||||||
foreach(Value in ItemArray) {
|
// foreach(Value in ItemArray) {
|
||||||
if (Value.Name2.len() == 0)
|
// if (Value.Name2.len() == 0)
|
||||||
Value.Name2 = "Rindro-Team";
|
// Value.Name2 = "Rindro-Team";
|
||||||
getroottable().Rindro_ItemInfoObject[Value.Id] <- Value;
|
// getroottable().Rindro_ItemInfoObject[Value.Id] <- Value;
|
||||||
}
|
// }
|
||||||
RINDRO_INIT_FLAG = true;
|
// RINDRO_INIT_FLAG = true;
|
||||||
}
|
}
|
||||||
//更新本地配置
|
//更新本地配置
|
||||||
function Rindro_ItemInfoCallBack(Chunk) {
|
function Rindro_ItemInfoCallBack(Chunk) {
|
||||||
local Jso = Json.Decode(Chunk);
|
// local Jso = Json.Decode(Chunk);
|
||||||
if ("ZipSEnd" in Jso) {
|
// if ("ZipSEnd" in Jso) {
|
||||||
getroottable().Rindro_ItemInfoObject <- {};
|
// getroottable().Rindro_ItemInfoObject <- {};
|
||||||
Rindro_ItemInfoBuf += Jso.ZipS;
|
// Rindro_ItemInfoBuf += Jso.ZipS;
|
||||||
local ZlibStrBuf = L_sq_Dezlib(Rindro_ItemInfoBuf);
|
// local ZlibStrBuf = L_sq_Dezlib(Rindro_ItemInfoBuf);
|
||||||
if (ZlibStrBuf == "null") {
|
// if (ZlibStrBuf == "null") {
|
||||||
Rindro_ItemInfoBuf = "";
|
// Rindro_ItemInfoBuf = "";
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
L_sq_SetLocalConfig(ZlibStrBuf);
|
// ZlibStrBuf = L_sq_DecondeJson(ZlibStrBuf);
|
||||||
|
// L_sq_SetLocalConfig("return " + ZlibStrBuf);
|
||||||
getroottable().RINDRO_CONFIG <- Json.Decode(ZlibStrBuf);
|
// getroottable().RINDRO_CONFIG <- dofile("Rindro_Config.cfg");
|
||||||
|
// Rindro_Init();
|
||||||
Rindro_Init();
|
// } else {
|
||||||
} else {
|
// Rindro_ItemInfoBuf += Jso.ZipS;
|
||||||
Rindro_ItemInfoBuf += Jso.ZipS;
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Pack_Control.rawset(20240422, Rindro_ItemInfoCallBack);
|
Pack_Control.rawset(20240422, Rindro_ItemInfoCallBack);
|
||||||
//无需更新本地配置
|
//无需更新本地配置
|
||||||
|
|
@ -300,3 +298,161 @@ class ItemInfoClass {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print(L_sq_P2I(Memory.allocUtf8String("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img").C_Object));
|
||||||
|
// local Npk = L_Sq_CallFunc(0x11C0410, "int", FFI_THISCALL, ["int", "int", "int"], L_sq_RA(0x1B4684C), 0, L_sq_P2I(Memory.allocUtf8String("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img").C_Object));
|
||||||
|
// print(Npk);
|
||||||
|
// local Img = L_Sq_CallFunc(0x11AA190, "int", FFI_THISCALL, ["int", "int"], Npk, 0);
|
||||||
|
// print(format("%02x", Img));
|
||||||
|
// print("width: " + NativePointer(Img).add(0x1C).readShort());
|
||||||
|
// print("height: " + NativePointer(Img).add(0x20).readShort());
|
||||||
|
|
||||||
|
// local ReadPath = L_sq_P2I(Memory.allocUtf8String("etc/rindro/horseguessing/horseguessing.dat").C_Object);
|
||||||
|
// print(format("%02x", ReadPath));
|
||||||
|
// local Reader = Memory.alloc(1024);
|
||||||
|
// local ReadBuffer = L_sq_P2I(Reader.C_Object);
|
||||||
|
// print(format("%02x", ReadBuffer));
|
||||||
|
// L_Sq_CallFunc(0x11A2030, "int", FFI_FASTCALL, ["int", "int", "int", "int", "int", "int"], 0x1D17638, 0, ReadPath, ReadBuffer, 0x100000, 0x19DAF4);
|
||||||
|
// // print(Reader.readUtf8String());
|
||||||
|
// local Func = compilestring(Reader.readUtf8String());
|
||||||
|
// local Ret = Func();
|
||||||
|
// print(Ret);
|
||||||
|
|
||||||
|
// local Tabs = dofile("aw.nut");
|
||||||
|
// print(Tabs.itemInfo.len());
|
||||||
|
// local Address = L_Sq_GetExportByName("fopen");
|
||||||
|
// print(Address);
|
||||||
|
// L_Sq_CallFunc(0xE6E070, "void", 4, ["int", "int", "int", "int", "char"], L_sq_RA(0x1A5FB20), 0, 33, "", 0x65535);
|
||||||
|
|
||||||
|
// Rindro_Haker.LoadHook(0x4C9FA0, ["pointer", "int", "void"],
|
||||||
|
// function(args) {
|
||||||
|
// // print(555);
|
||||||
|
// return null;
|
||||||
|
// },
|
||||||
|
// function(args) {
|
||||||
|
// // print(666);
|
||||||
|
// return null;
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
// print(L_sq_StringBinById(435110));
|
||||||
|
|
||||||
|
// Rindro_Haker.LoadHook(0x4017F0, ["int", "int", "int", "int"],
|
||||||
|
// function(args) {
|
||||||
|
// print(args[0]);
|
||||||
|
// print(args[1]);
|
||||||
|
// print(args[2]);
|
||||||
|
// return null;
|
||||||
|
// },
|
||||||
|
// function(args) {
|
||||||
|
|
||||||
|
// return null;
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
// 0x121a1e2
|
||||||
|
//this 0x1D17638
|
||||||
|
// local Read = Memory.alloc(10000);
|
||||||
|
// print(Read);
|
||||||
|
// L_Sq_CallFunc(0x11A2030, "int", FFI_THISCALL, ["int", "int", "int", "int", "int"], 0x1D17638, Memory.allocUtf8String("sqr/a.nut").C_Object, Read.C_Object, 0x100000,0x19DAF4);
|
||||||
|
// local Str = Read.readUtf8String();
|
||||||
|
// print(Str);
|
||||||
|
|
||||||
|
// local A = IRDSQRCharacter.pushScriptFiles("a.nut");
|
||||||
|
// local Read = Memory.alloc(10000);
|
||||||
|
// print(Read);
|
||||||
|
// L_Sq_CallFunc(0x121A100, "char", FFI_MS_CDECL, ["int", "int", "int", "int", "int"], Memory.allocUtf8String("").C_Object, Memory.allocUtf8String("sqr/a.nut").C_Object, Read.C_Object, 0x100000,0x19DAF4);
|
||||||
|
// local Str = Read.readUtf8String();
|
||||||
|
// print(Str);
|
||||||
|
|
||||||
|
// L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], L_sq_RA(0x1A5FB20), 79, 0, 0);
|
||||||
|
|
||||||
|
// local Old = L_sq_RA(0x1AB7CDC);
|
||||||
|
// Old = L_sq_RA(Old + 0x3038);
|
||||||
|
// local ItemObject = L_sq_GetItem(27582);
|
||||||
|
// //移除
|
||||||
|
// L_Sq_CallFunc(0x825AD0, "void", FFI_THISCALL, ["int","int"], L_sq_RA(0x1AB7CDC),Old);
|
||||||
|
// //移除Ani
|
||||||
|
// L_Sq_CallFunc(0x84CD10, "void", FFI_THISCALL, ["int","int"], L_sq_RA(0x1AB7CDC),Old);
|
||||||
|
// //穿戴
|
||||||
|
// L_Sq_CallFunc(0x825570, "void", FFI_THISCALL, ["int","int"], L_sq_RA(0x1AB7CDC),ItemObject);
|
||||||
|
|
||||||
|
// local ItemObject = L_sq_GetItem(101020037);
|
||||||
|
// // print(ItemObject);
|
||||||
|
// // L_Sq_CallFunc(0x4B0F10, "int", FFI_THISCALL, ["int"], L_sq_RA(0x1AE45B4));
|
||||||
|
// local Hs = L_Sq_CallFunc(0x779EB0, "pointer", FFI_THISCALL, ["int"], L_sq_RA(0x1AE45B4));
|
||||||
|
// print(Hs);
|
||||||
|
// Hs = L_sq_P2I(Hs);
|
||||||
|
// print(format("%02x", Hs));
|
||||||
|
// L_Sq_CallFunc(0x825AD0, "void", FFI_THISCALL, ["int","int"], Hs, ItemObject);
|
||||||
|
// L_Sq_CallFunc(0x84CD10, "void", FFI_THISCALL, ["int","int"], L_sq_RA(0x1AB7CDC), ItemObject);
|
||||||
|
// local PP = L_Sq_CallFunc(0x65DE50, "pointer", FFI_THISCALL, ["pointer"], 0xE8675E97, 0);
|
||||||
|
// print("PP: " + PP);
|
||||||
|
|
||||||
|
// local WuseAdd = L_Sq_CallFunc(0x972220, "int", FFI_MS_CDECL, ["int", "int", "int"], 27582, 0x19E990, 0);
|
||||||
|
// print("MY: " + WuseAdd);
|
||||||
|
// print(L_sq_Test());
|
||||||
|
// local Address = L_sq_Test(26058);
|
||||||
|
// print(Address);
|
||||||
|
// local Ret = L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], L_sq_RA(0x1A5FB20), 275, Address, 41);
|
||||||
|
// print(Ret);
|
||||||
|
// L_Sq_CallFunc(0xF3B3B0, "int", FFI_THISCALL, ["int", "int", "int", "int", "int"], Ret, 600, 200, 28, 28);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Rindro_Haker.LoadHook(0x11BD160, ["int", "int", "bool"],
|
||||||
|
// function(args) {
|
||||||
|
// args[0] = -1;
|
||||||
|
// // print(args[0]);
|
||||||
|
// return args;
|
||||||
|
// },
|
||||||
|
// function(args) {
|
||||||
|
// // print(args.pop());
|
||||||
|
// // print(">>>>>>");
|
||||||
|
// return null;
|
||||||
|
// });
|
||||||
|
|
||||||
|
// local Str = "{\"stringValue\":\"thisiszifuchuan\",\"numberValue\":123.45,\"integerValue\":42,\"booleanValue\":true,\"arrayValue\":[1,\"two\",true,{\"key\":\"value\"}],\"objectValue\":{\"name\":\"John Doe\",\"age\":30,\"address\":{\"street\":\"123 Main St\",\"city\":\"Anytown\",\"state\":\"CA\",\"zip\":\"12345\"}}}";
|
||||||
|
// print("***********************");
|
||||||
|
// print(Str);
|
||||||
|
// print(Str.len());
|
||||||
|
// local JsonObj = JSONParser();
|
||||||
|
// local T = JsonObj.parse(Str);
|
||||||
|
// print(">>>>>>>>>>>>>>");
|
||||||
|
// print(T);
|
||||||
|
// print(">>>>>>>>>>>>>>");
|
||||||
|
// local Str2 = Json.Encode(T);
|
||||||
|
// print("***********************");
|
||||||
|
// print(Str2);
|
||||||
|
// print(Str2.len());
|
||||||
|
|
||||||
|
function getScrollBasisPos_Swordman(obj) {
|
||||||
|
print(111);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function drawAppend_VirtualCharacter(ChrJob, GrowJob, Sc_Xpos, Sc_Ypos, Front_After_Flag, f) {
|
||||||
|
// local obj = sq_GetMyMasterCharacter();
|
||||||
|
// print(Clock());
|
||||||
|
// Sout("a: %L",a);
|
||||||
|
// Sout("b: %L",b);
|
||||||
|
// Sout("c: %L",c);
|
||||||
|
// Sout("d: %L",d);
|
||||||
|
// Sout("e: %L",e);
|
||||||
|
// Sout("f: %L",f);
|
||||||
|
// print(a);
|
||||||
|
// print(b);
|
||||||
|
// print(c);
|
||||||
|
// print(d);
|
||||||
|
// print(e);
|
||||||
|
// print(f);
|
||||||
|
|
||||||
|
// if (!e) {
|
||||||
|
// BasicsDrawTool.T_DrawDynamicAni(obj, "Character/Common/Animation/Aura/chn_2021_chivarly_system3/Chivalry_S3_Bottom_00.ani", c, d, "Server_AuctionSystemTimeP22");
|
||||||
|
// BasicsDrawTool.T_DrawDynamicAni(obj, "Character/Common/Animation/Aura/chn_2021_chivarly_system3_2/Chivalry_S3_Text.ani", c, d, "Server_AuctionSystemTimeP");
|
||||||
|
// BasicsDrawTool.T_DrawDynamicAni(obj, "Character/Common/Animation/Aura/chn_2021_chivarly_system3/Chivalry_S3_Text.ani", c, d - 50, "Server_AuctionSystemTimeP2");
|
||||||
|
// BasicsDrawTool.T_DrawDynamicAni(obj, "Character/Common/Animation/Aura/chn_2021_chivarly_system3_3/Chivalry_S3_Text.ani", c, d - 100, "Server_AuctionSystemTimeP3");
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,11 @@ dofile("sqr/Base/_ENUM/_ENUM_KEY.nut"); //按键枚举类
|
||||||
//枚举类
|
//枚举类
|
||||||
|
|
||||||
//基础工具类
|
//基础工具类
|
||||||
|
dofile("sqr/Base/_Tool/Json_Class.nut"); //Json类
|
||||||
dofile("sqr/Base/_Tool/BaseTool_Class.nut"); //基础工具类
|
dofile("sqr/Base/_Tool/BaseTool_Class.nut"); //基础工具类
|
||||||
|
dofile("sqr/Base/_Tool/MemoryClass.nut"); //内存类
|
||||||
|
dofile("sqr/Base/_Tool/Hacker_Class.nut"); //黑客工具类
|
||||||
|
dofile("sqr/Base/_Tool/Hacker_RegApi.nut"); //黑客注册工具类
|
||||||
//基础工具类
|
//基础工具类
|
||||||
|
|
||||||
//回调注册类
|
//回调注册类
|
||||||
|
|
@ -12,6 +16,7 @@ dofile("sqr/Base/CallBack/DrawMain.nut"); //绘制入口
|
||||||
dofile("sqr/Base/CallBack/DrawHudMain.nut"); //hud绘制入口
|
dofile("sqr/Base/CallBack/DrawHudMain.nut"); //hud绘制入口
|
||||||
dofile("sqr/Base/CallBack/Window_Get.nut"); //原始窗口HOOK
|
dofile("sqr/Base/CallBack/Window_Get.nut"); //原始窗口HOOK
|
||||||
dofile("sqr/Base/CallBack/PushDamage.nut"); //Push伤害
|
dofile("sqr/Base/CallBack/PushDamage.nut"); //Push伤害
|
||||||
|
dofile("sqr/Base/CallBack/GetDamageRate.nut"); //获取伤害
|
||||||
// dofile("sqr/Base/CallBack/Window_Get.nut"); //原始窗口HOOK
|
// dofile("sqr/Base/CallBack/Window_Get.nut"); //原始窗口HOOK
|
||||||
|
|
||||||
//数据类
|
//数据类
|
||||||
|
|
@ -20,9 +25,11 @@ dofile("sqr/Base/_Z_Data/CharacterInfoData.nut"); //角色信息数据
|
||||||
//数据类
|
//数据类
|
||||||
|
|
||||||
//UI框架类
|
//UI框架类
|
||||||
|
dofile("sqr/Base/UI/Lenheart_Cursor_Class.nut"); //鼠标类
|
||||||
dofile("sqr/Base/UI/OldWindowsMap.nut"); //窗口Map
|
dofile("sqr/Base/UI/OldWindowsMap.nut"); //窗口Map
|
||||||
dofile("sqr/Base/UI/Lenheart_UI_Class.nut"); //UI
|
dofile("sqr/Base/UI/Lenheart_UI_Class.nut"); //UI
|
||||||
dofile("sqr/Base/UI/Lenheart_Ani_Class.nut"); //Ani
|
dofile("sqr/Base/UI/Lenheart_Ani_Class.nut"); //Ani
|
||||||
|
dofile("sqr/Base/UI/Lenheart_Each_Class.nut"); //交互图标类
|
||||||
dofile("sqr/Base/UI/Lenheart_Event_Class.nut"); //活动图标
|
dofile("sqr/Base/UI/Lenheart_Event_Class.nut"); //活动图标
|
||||||
dofile("sqr/Base/UI/Lenheart_Character_Info_Class.nut"); //个人信息属性面板
|
dofile("sqr/Base/UI/Lenheart_Character_Info_Class.nut"); //个人信息属性面板
|
||||||
//-----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------
|
||||||
|
|
@ -47,3 +54,6 @@ dofile("sqr/Project/Shapeshifting/Shapeshifting.nut"); //时装变身
|
||||||
dofile("sqr/Project/HudUi/HudUi.nut"); //百级UI
|
dofile("sqr/Project/HudUi/HudUi.nut"); //百级UI
|
||||||
dofile("sqr/Project/DamagePerSecond/DamagePerSecond.nut"); //秒伤统计
|
dofile("sqr/Project/DamagePerSecond/DamagePerSecond.nut"); //秒伤统计
|
||||||
dofile("sqr/Project/CollectionBox/CollectionBox.nut"); //收集箱
|
dofile("sqr/Project/CollectionBox/CollectionBox.nut"); //收集箱
|
||||||
|
dofile("sqr/Project/HorseGuessing/HorseGuessing.nut"); //骑士马战
|
||||||
|
dofile("sqr/Project/SkinHub/SkinHub.nut"); //皮肤仓库
|
||||||
|
dofile("sqr/Project/MarrySystem/MarrySystem.nut"); //结婚系统
|
||||||
|
|
@ -357,41 +357,43 @@ class RinDro_Anton extends Rindro_BaseToolClass {
|
||||||
//绘制通关副本动画
|
//绘制通关副本动画
|
||||||
function DrawPlayAni(obj) {
|
function DrawPlayAni(obj) {
|
||||||
if (!DrawPlayAniMark || !DrawPlayAniT) return;
|
if (!DrawPlayAniMark || !DrawPlayAniT) return;
|
||||||
|
local Offset = 0;
|
||||||
|
if (getroottable().Rindro_Scr_Width > 800) Offset = ((getroottable().Rindro_Scr_Width - 800) / 2);
|
||||||
local Ct = Clock() - DrawPlayAniT;
|
local Ct = Clock() - DrawPlayAniT;
|
||||||
switch (DrawPlayAniMark) {
|
switch (DrawPlayAniMark) {
|
||||||
case 1: //通关擎天A
|
case 1: //通关擎天A
|
||||||
case 2: //通关擎天B
|
case 2: //通关擎天B
|
||||||
case 13: //通关擎天B
|
case 13: //通关擎天B
|
||||||
local Ani = T_DrawDynamicAni(obj, "common/anton/title/04_clear_back.ani", 0, 180, "安图恩通关擎天A" + DrawPlayAniT);
|
local Ani = T_DrawDynamicAni(obj, "common/anton/title/04_clear_back.ani", 0 + Offset, 180, "安图恩通关擎天A" + DrawPlayAniT);
|
||||||
local str = "擎天之柱A";
|
local str = "擎天之柱A";
|
||||||
if (DrawPlayAniMark == 2) str = "擎天之柱B"
|
if (DrawPlayAniMark == 2) str = "擎天之柱B"
|
||||||
if (DrawPlayAniMark == 13) str = "黑色火山"
|
if (DrawPlayAniMark == 13) str = "黑色火山"
|
||||||
if (Ct >= 350 && Ct <= 1400) L_sq_DrawCode(str, 236 + 158 - LenheartTextClass.GetStringLength(str) / 2, 244, sq_RGBA(255, 146, 0, 250), 0, 1);
|
if (Ct >= 350 && Ct <= 1400) L_sq_DrawCode(str, 236 + Offset + 158 - LenheartTextClass.GetStringLength(str) / 2, 244, sq_RGBA(255, 146, 0, 250), 0, 1);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
T_DrawDynamicAni(obj, "common/anton/title/00_start_back.ani", 430, 210 + 26, "安图恩阻截开始" + DrawPlayAniT);
|
T_DrawDynamicAni(obj, "common/anton/title/00_start_back.ani", 430 + Offset, 210 + 26, "安图恩阻截开始" + DrawPlayAniT);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
T_DrawDynamicAni(obj, "common/anton/title/02_success_back.ani", 430, 210 + 26, "安图恩阻截成功" + DrawPlayAniT);
|
T_DrawDynamicAni(obj, "common/anton/title/02_success_back.ani", 430 + Offset, 210 + 26, "安图恩阻截成功" + DrawPlayAniT);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
T_DrawDynamicAni(obj, "common/anton/title/01_fail_back.ani", 430, 210 + 26, "安图恩阻截失败" + DrawPlayAniT);
|
T_DrawDynamicAni(obj, "common/anton/title/01_fail_back.ani", 430 + Offset, 210 + 26, "安图恩阻截失败" + DrawPlayAniT);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
T_DrawDynamicAni(obj, "common/anton/title/00_start_back_1.ani", 430, 210 + 26, "安图恩灭杀开始" + DrawPlayAniT);
|
T_DrawDynamicAni(obj, "common/anton/title/00_start_back_1.ani", 430 + Offset, 210 + 26, "安图恩灭杀开始" + DrawPlayAniT);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
T_DrawDynamicAni(obj, "common/anton/title/02_success_back_1.ani", 430, 210 + 26, "安图恩灭杀成功" + DrawPlayAniT);
|
T_DrawDynamicAni(obj, "common/anton/title/02_success_back_1.ani", 430 + Offset, 210 + 26, "安图恩灭杀成功" + DrawPlayAniT);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
T_DrawDynamicAni(obj, "common/anton/title/01_fail_back_1.ani", 430, 210 + 26, "安图恩灭杀失败" + DrawPlayAniT);
|
T_DrawDynamicAni(obj, "common/anton/title/01_fail_back_1.ani", 430 + Offset, 210 + 26, "安图恩灭杀失败" + DrawPlayAniT);
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
T_DrawDynamicAni(obj, "common/anton/title/03_warning_back.ani", 0, 210 + 26, "安图恩火山警告" + DrawPlayAniT);
|
T_DrawDynamicAni(obj, "common/anton/title/03_warning_back.ani", 0 + Offset, 210 + 26, "安图恩火山警告" + DrawPlayAniT);
|
||||||
local str = "火山能量即将过载,请立即前往压制!!!";
|
local str = "火山能量即将过载,请立即前往压制!!!";
|
||||||
if (DrawPlayAniMark == 12) str = "震颤的大地已经复活,请立即前往压制!!!"
|
if (DrawPlayAniMark == 12) str = "震颤的大地已经复活,请立即前往压制!!!"
|
||||||
if (Ct >= 350 && Ct <= 1600) L_sq_DrawCode(str, 236 + 158 - LenheartTextClass.GetStringLength(str) / 2, 320, sq_RGBA(255, 50, 50, 250), 0, 1);
|
if (Ct >= 350 && Ct <= 1600) L_sq_DrawCode(str, 236 + Offset + 158 - LenheartTextClass.GetStringLength(str) / 2, 320, sq_RGBA(255, 50, 50, 250), 0, 1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -800,7 +800,7 @@ class Rindro_AntonFightSituationC extends LenheartNewUI_Windows {
|
||||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
MapEventTest(obj);
|
MapEventTest(obj);
|
||||||
if (SelectDgnMarkFlag) {
|
if (SelectDgnMarkFlag) {
|
||||||
L_sq_WA(0x1b46898, 47);
|
R_Mouse.SetType(151);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -810,7 +810,7 @@ class Rindro_AntonFightSituationC extends LenheartNewUI_Windows {
|
||||||
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
||||||
if (SelectDgnMarkFlag != 0) {
|
if (SelectDgnMarkFlag != 0) {
|
||||||
SelectDgnMarkFlag = 0;
|
SelectDgnMarkFlag = 0;
|
||||||
L_sq_WA(0x1b46898, 0);
|
R_Mouse.SetType(0);
|
||||||
foreach(d_obj in DgnList) {
|
foreach(d_obj in DgnList) {
|
||||||
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X + d_obj.X, Y + d_obj.Y, 71, 71)) {
|
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X + d_obj.X, Y + d_obj.Y, 71, 71)) {
|
||||||
local T = {
|
local T = {
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ class Rindro_AntonPartyFormation extends LenheartNewUI_Windows {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PartyMarkFlag != -1) {
|
if (PartyMarkFlag != -1) {
|
||||||
L_sq_WA(0x1b46898, 47);
|
R_Mouse.SetType(151);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,7 +114,7 @@ class Rindro_AntonPartyFormation extends LenheartNewUI_Windows {
|
||||||
//还原编队的鼠标指针
|
//还原编队的鼠标指针
|
||||||
if (this.PartyMarkFlag != -1) {
|
if (this.PartyMarkFlag != -1) {
|
||||||
this.PartyMarkFlag = -1;
|
this.PartyMarkFlag = -1;
|
||||||
L_sq_WA(0x1b46898, 0);
|
R_Mouse.SetType(0);
|
||||||
}
|
}
|
||||||
LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y);
|
LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,14 +86,14 @@ class Rindro_AntonPartyInfoMemberC extends LenheartNewUI_CommonUi {
|
||||||
}
|
}
|
||||||
SendPackEx(T);
|
SendPackEx(T);
|
||||||
win.PartyMarkFlag = -1;
|
win.PartyMarkFlag = -1;
|
||||||
L_sq_WA(0x1b46898, 0);
|
R_Mouse.SetType(0);
|
||||||
win.ResetFocus();
|
win.ResetFocus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//点了其他队伍成员要还原编队状态
|
//点了其他队伍成员要还原编队状态
|
||||||
else {
|
else {
|
||||||
win.PartyMarkFlag = -1;
|
win.PartyMarkFlag = -1;
|
||||||
L_sq_WA(0x1b46898, 0);
|
R_Mouse.SetType(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -363,8 +363,10 @@ class Rindro_Anton_RewardC extends LenheartNewUI_Windows {
|
||||||
}
|
}
|
||||||
//绘制物品边框
|
//绘制物品边框
|
||||||
if (OpenRealXrate >= 0.6) {
|
if (OpenRealXrate >= 0.6) {
|
||||||
local Rarity = AllItemInfoObject[CardInfo.item].Rarity;
|
GetItemInfo(CardInfo.item);
|
||||||
local Name = AllItemInfoObject[CardInfo.item].Name;
|
local Rarity = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0xF4);
|
||||||
|
local NamePointer = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0x20);
|
||||||
|
local Name = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString();
|
||||||
L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 5 + Rarity, X + 156 + (160 * i), Y + 378, 1, sq_RGBA(255, 255, 255, CradAlphaOffset), OpenRealXrate, 1.0);
|
L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 5 + Rarity, X + 156 + (160 * i), Y + 378, 1, sq_RGBA(255, 255, 255, CradAlphaOffset), OpenRealXrate, 1.0);
|
||||||
|
|
||||||
//绘制物品
|
//绘制物品
|
||||||
|
|
@ -459,7 +461,8 @@ class Rindro_Anton_RewardC extends LenheartNewUI_Windows {
|
||||||
//奖励对象
|
//奖励对象
|
||||||
local CardInfo = TeamReward[i];
|
local CardInfo = TeamReward[i];
|
||||||
if (CardInfo.Flag && CardInfo.item != -1) {
|
if (CardInfo.Flag && CardInfo.item != -1) {
|
||||||
local Rarity = AllItemInfoObject[CardInfo.item].Rarity;
|
GetItemInfo(CardInfo.item);
|
||||||
|
local Rarity = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0xF4);
|
||||||
//物品出现光
|
//物品出现光
|
||||||
if (!CardInfo.grade) {
|
if (!CardInfo.grade) {
|
||||||
if (Rarity <= 2) { //低于紫色闪紫光
|
if (Rarity <= 2) { //低于紫色闪紫光
|
||||||
|
|
|
||||||
|
|
@ -380,6 +380,23 @@ class AradPass_QuestC extends LenheartNewUI_Windows {
|
||||||
DrawTop(obj);
|
DrawTop(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//override
|
||||||
|
//鼠标滚轮事件回调
|
||||||
|
function OnMouseWheel(Flag, MousePos_X, MousePos_Y) {
|
||||||
|
|
||||||
|
|
||||||
|
if (Flag) {
|
||||||
|
if (QuestWheelNow > 0) QuestWheelNow--;
|
||||||
|
}
|
||||||
|
if (!Flag) {
|
||||||
|
if (QuestWheelNow< QuestWheelMax - 6) QuestWheelNow++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//调用原生方法
|
||||||
|
LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
|
||||||
|
}
|
||||||
|
|
||||||
//逻辑入口
|
//逻辑入口
|
||||||
function Proc(obj) {
|
function Proc(obj) {
|
||||||
LenheartNewUI_Windows.SyncPos(X, Y - 210);
|
LenheartNewUI_Windows.SyncPos(X, Y - 210);
|
||||||
|
|
@ -392,12 +409,6 @@ class AradPass_QuestC extends LenheartNewUI_Windows {
|
||||||
Visible = false;
|
Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IMouse.IsWheelUp()) {
|
|
||||||
if (QuestWheelNow > 0) QuestWheelNow--;
|
|
||||||
}
|
|
||||||
if (IMouse.IsWheelDown()) {
|
|
||||||
if (QuestWheelNow< QuestWheelMax - 6) QuestWheelNow++;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach(Pos, winobj in QuestItemList[Page]) {
|
foreach(Pos, winobj in QuestItemList[Page]) {
|
||||||
if (Pos >= QuestWheelNow && Pos <= QuestWheelNow + 5) {
|
if (Pos >= QuestWheelNow && Pos <= QuestWheelNow + 5) {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ class LenheartNewUI_CollectionBox_BaseButton extends LenheartNewUI_CommonUi {
|
||||||
Path = null;
|
Path = null;
|
||||||
Idx = null;
|
Idx = null;
|
||||||
SetFlag = null;
|
SetFlag = null;
|
||||||
|
SetIndex = null;
|
||||||
|
|
||||||
|
|
||||||
constructor(X, Y, W, H, Path, Idx) {
|
constructor(X, Y, W, H, Path, Idx) {
|
||||||
|
|
@ -65,7 +66,7 @@ class CollectionBoxC extends LenheartNewUI_Windows {
|
||||||
// NoWindow = true;
|
// NoWindow = true;
|
||||||
|
|
||||||
//是否可见
|
//是否可见
|
||||||
// Visible = false;
|
Visible = false;
|
||||||
|
|
||||||
//盒子按钮集合
|
//盒子按钮集合
|
||||||
BoxButton = null;
|
BoxButton = null;
|
||||||
|
|
@ -76,16 +77,45 @@ class CollectionBoxC extends LenheartNewUI_Windows {
|
||||||
//当前页面
|
//当前页面
|
||||||
Page = null;
|
Page = null;
|
||||||
|
|
||||||
//
|
//滚轮偏移
|
||||||
|
ScrollPos = 0;
|
||||||
|
|
||||||
|
//页面滚轮偏移
|
||||||
|
PageScrollPos = 0;
|
||||||
|
|
||||||
|
//悬停的宝珠
|
||||||
|
HoverItem = null;
|
||||||
|
|
||||||
|
//镶嵌成功音效包
|
||||||
|
function AudioCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
local Type = Jso.Type;
|
||||||
|
local obj = sq_getMyCharacter();
|
||||||
|
|
||||||
|
switch (Type) {
|
||||||
|
case 1:
|
||||||
|
obj.sq_PlaySound("TRADE_OK");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
obj.sq_PlaySound("ICON_DROP_TO_QUICKSLOT");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
obj.sq_PlaySound("GAMBLE_RESULT_GOOD");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//基础配置包
|
//基础配置包
|
||||||
function GetInfoCallBack(Chunk) {
|
function GetInfoCallBack(Chunk) {
|
||||||
Info = Json.Decode(Chunk).info;
|
local Jso = Json.Decode(Chunk);
|
||||||
|
local ZlibStrBuf = Json.Decode(L_sq_Dezlib(Jso.ZipS));
|
||||||
|
Info = ZlibStrBuf.info;
|
||||||
foreach(Key, Aobj in Info) {
|
foreach(Key, Aobj in Info) {
|
||||||
if (!Page) Page = Key;
|
if (!Page) Page = Key;
|
||||||
local StrBuf1 = L_sq_GetStringDrawArray(Aobj.attribute.Atts, 300);
|
local StrBuf1 = L_sq_GetStringDrawArray(Aobj.attS, 300);
|
||||||
Aobj.attribute.AttsS <- StrBuf1[0] + "...";
|
Aobj.AttsS <- StrBuf1[0] + "...";
|
||||||
Aobj.attribute.Atts <- StrBuf1;
|
Aobj.attS <- StrBuf1;
|
||||||
}
|
}
|
||||||
|
|
||||||
InitBoxButton();
|
InitBoxButton();
|
||||||
|
|
@ -98,11 +128,6 @@ class CollectionBoxC extends LenheartNewUI_Windows {
|
||||||
};
|
};
|
||||||
SendPackEx(T);
|
SendPackEx(T);
|
||||||
}
|
}
|
||||||
//收集箱收集信息
|
|
||||||
function GetCollectInfoCallBack(Chunk) {
|
|
||||||
|
|
||||||
// Info = Json.Decode(Chunk).info;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
Childrens = [];
|
Childrens = [];
|
||||||
|
|
@ -113,9 +138,10 @@ class CollectionBoxC extends LenheartNewUI_Windows {
|
||||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
Pack_Control.rawset(20077028, GetInfoCallBack.bindenv(this));
|
Pack_Control.rawset(20077028, GetInfoCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(20077010, AudioCallBack.bindenv(this));
|
||||||
|
|
||||||
Pack_Control.rawset(20077004, GetCollectInfoCallBack.bindenv(this));
|
|
||||||
GetCollectInfo();
|
GetCollectInfo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化按钮
|
//初始化按钮
|
||||||
|
|
@ -135,12 +161,15 @@ class CollectionBoxC extends LenheartNewUI_Windows {
|
||||||
//关闭按钮
|
//关闭按钮
|
||||||
local ButtonBuf = LenheartNewUI_CollectionBox_BaseButton(8, 95 + (RealPos * 72), 102, 70, InfoObj.img, 1);
|
local ButtonBuf = LenheartNewUI_CollectionBox_BaseButton(8, 95 + (RealPos * 72), 102, 70, InfoObj.img, 1);
|
||||||
ButtonBuf.SetFlag = Pos;
|
ButtonBuf.SetFlag = Pos;
|
||||||
|
ButtonBuf.SetIndex = RealPos;
|
||||||
ButtonBuf.OnClick = function(ButtonObj) {
|
ButtonBuf.OnClick = function(ButtonObj) {
|
||||||
Page = ButtonObj.SetFlag;
|
Page = ButtonObj.SetFlag;
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
ButtonBuf.SetCallBackFunc(function(ButtonObj) {
|
ButtonBuf.SetCallBackFunc(function(ButtonObj) {
|
||||||
|
ButtonObj.Localtion_Y = 95 + ((ButtonObj.SetIndex - ScrollPos) * 72);
|
||||||
});
|
if (ButtonObj.Localtion_Y< 95 || ButtonObj.Localtion_Y > 311) ButtonObj.Localtion_X = -9000;
|
||||||
|
else ButtonObj.Localtion_X = 8;
|
||||||
|
}.bindenv(this));
|
||||||
Childrens.append(ButtonBuf);
|
Childrens.append(ButtonBuf);
|
||||||
RealPos++;
|
RealPos++;
|
||||||
}
|
}
|
||||||
|
|
@ -164,17 +193,43 @@ class CollectionBoxC extends LenheartNewUI_Windows {
|
||||||
L_sq_DrawImg("interface2/collectbox/collectboxbtn.img", 0, X, Y);
|
L_sq_DrawImg("interface2/collectbox/collectboxbtn.img", 0, X, Y);
|
||||||
//背景
|
//背景
|
||||||
L_sq_DrawImg(Info[Page].img, 0, X + 7, Y + 26);
|
L_sq_DrawImg(Info[Page].img, 0, X + 7, Y + 26);
|
||||||
|
//绘制窗口名称
|
||||||
|
L_sq_DrawCode("我的收集箱", X + 160, Y + 8, sq_RGBA(255, 177, 0, 250), 0, 1);
|
||||||
//绘制收集箱名称
|
//绘制收集箱名称
|
||||||
L_sq_DrawCode(Info[Page].name, X + 208 - LenheartTextClass.GetStringLength(Info[Page].name) / 2, Y + 40, sq_RGBA(255, 177, 0, 250), 0, 1);
|
L_sq_DrawCode(Info[Page].name, X + 208 - LenheartTextClass.GetStringLength(Info[Page].name) / 2, Y + 40, sq_RGBA(255, 177, 0, 250), 0, 1);
|
||||||
//绘制收集箱信息缩略
|
//绘制收集箱信息缩略
|
||||||
L_sq_DrawCode(Info[Page].attribute.AttsS, X + 228 - LenheartTextClass.GetStringLength(Info[Page].attribute.AttsS) / 2, Y + 40 + 20, sq_RGBA(255, 242, 0, 250), 0, 1);
|
L_sq_DrawCode(Info[Page].AttsS, X + 228 - LenheartTextClass.GetStringLength(Info[Page].AttsS) / 2, Y + 40 + 20, sq_RGBA(255, 242, 0, 250), 0, 1);
|
||||||
|
|
||||||
|
|
||||||
|
HoverItem = null;
|
||||||
|
setClip(X + 95, Y + 95, X + 348, Y + 375); //开始裁切
|
||||||
|
//绘制宝珠
|
||||||
|
foreach(pos, value in Info[Page].itemIds) {
|
||||||
|
//绘制格子
|
||||||
|
L_sq_DrawImg(Info[Page].img, 5, X + value.x, Y + value.y + PageScrollPos);
|
||||||
|
//绘制宝珠
|
||||||
|
DrawItemEx(X + value.x + Info[Page].Xp, Y + value.y + Info[Page].Yp + PageScrollPos, value.id, 1);
|
||||||
|
//判断是否拥有
|
||||||
|
if (!value.isTure) {
|
||||||
|
//遮挡
|
||||||
|
L_sq_DrawImg("interface/windowcommon.img", 157, X + value.x + Info[Page].Xp, Y + value.y + Info[Page].Yp + PageScrollPos);
|
||||||
|
L_sq_DrawImg("interface/windowcommon.img", 157, X + value.x + Info[Page].Xp, Y + value.y + Info[Page].Yp + PageScrollPos);
|
||||||
|
L_sq_DrawImg("interface/windowcommon.img", 157, X + value.x + Info[Page].Xp, Y + value.y + Info[Page].Yp + PageScrollPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X + value.x + Info[Page].Xp, Y + value.y + Info[Page].Yp + PageScrollPos, 29, 29)) {
|
||||||
|
HoverItem = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
releaseClip(); //裁切结束
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function TopShow(obj) {
|
function TopShow(obj) {
|
||||||
|
if (!Info) return;
|
||||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X + 86, Y + 53, 272, 15)) {
|
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X + 86, Y + 53, 272, 15)) {
|
||||||
local StrArr = Info[Page].attribute.Atts;
|
local StrArr = Info[Page].attS;
|
||||||
local Str = Info[Page].attribute.AttsS;
|
local Str = Info[Page].AttsS;
|
||||||
L_sq_DrawWindow(IMouse.GetXPos() - 140 + LenheartTextClass.GetStringLength(Str) / 2, IMouse.GetYPos() - 36, 0 + LenheartTextClass.GetStringLength(Str), 0 + (14 * StrArr.len()), "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
L_sq_DrawWindow(IMouse.GetXPos() - 140 + LenheartTextClass.GetStringLength(Str) / 2, IMouse.GetYPos() - 36, 0 + LenheartTextClass.GetStringLength(Str), 0 + (14 * StrArr.len()), "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||||
|
|
||||||
local Xpos = LenheartTextClass.GetStringLength(Str) / 2;
|
local Xpos = LenheartTextClass.GetStringLength(Str) / 2;
|
||||||
|
|
@ -184,6 +239,23 @@ class CollectionBoxC extends LenheartNewUI_Windows {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//override
|
||||||
|
function DrawItemInfo() {
|
||||||
|
if (MousePosFlag != 2) return;
|
||||||
|
if (ItemInfoDrawS) {
|
||||||
|
if (!ItemObject) {
|
||||||
|
local ItemId = ItemInfoDrawS.ItemId;
|
||||||
|
if (Rindro_ItemInfoObject.rawin(ItemId)) {
|
||||||
|
ItemObject = ItemInfoClass(Rindro_ItemInfoObject[ItemId]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ItemObject.Show(ItemInfoDrawS.X, ItemInfoDrawS.Y - ItemObject.PageLength);
|
||||||
|
} else {
|
||||||
|
ItemObject = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function Show(obj) {
|
function Show(obj) {
|
||||||
DrawMain(obj);
|
DrawMain(obj);
|
||||||
LenheartNewUI_Windows.Show(obj);
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
@ -192,6 +264,83 @@ class CollectionBoxC extends LenheartNewUI_Windows {
|
||||||
//逻辑入口
|
//逻辑入口
|
||||||
function Proc(obj) {
|
function Proc(obj) {
|
||||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//鼠标位置Flag
|
||||||
|
MousePosFlag = 0;
|
||||||
|
|
||||||
|
//override
|
||||||
|
function OnMouseProc(Flag, MousePos_X, MousePos_Y) {
|
||||||
|
//调用原生方法
|
||||||
|
LenheartNewUI_Windows.OnMouseProc(Flag, MousePos_X, MousePos_Y);
|
||||||
|
|
||||||
|
MousePos_X -= X;
|
||||||
|
MousePos_Y -= Y;
|
||||||
|
//鼠标在栏目窗口内
|
||||||
|
if (MousePos_X >= 8 && MousePos_Y >= 95 && MousePos_X <= 110 && MousePos_Y <= 375) {
|
||||||
|
MousePosFlag = 1;
|
||||||
|
}
|
||||||
|
//鼠标在宝珠窗口内
|
||||||
|
else if (MousePos_X > 95 && MousePos_Y >= 95 && MousePos_X <= 348 && MousePos_Y <= 375) {
|
||||||
|
MousePosFlag = 2;
|
||||||
|
} else MousePosFlag = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//override
|
||||||
|
//鼠标滚轮事件回调
|
||||||
|
function OnMouseWheel(Flag, MousePos_X, MousePos_Y) {
|
||||||
|
MousePos_X -= X;
|
||||||
|
MousePos_Y -= Y;
|
||||||
|
|
||||||
|
//左侧栏目的滚动逻辑
|
||||||
|
if (MousePosFlag == 1) {
|
||||||
|
if (Flag) {
|
||||||
|
if (ScrollPos > 0) ScrollPos -= 1;
|
||||||
|
}
|
||||||
|
if (!Flag) {
|
||||||
|
if (ScrollPos<(Info.len() - 4)) ScrollPos += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//左侧栏目的滚动逻辑
|
||||||
|
if (MousePosFlag == 2) {
|
||||||
|
if (Flag) {
|
||||||
|
if (PageScrollPos< 0) PageScrollPos += 47;
|
||||||
|
}
|
||||||
|
if (!Flag) {
|
||||||
|
if (PageScrollPos > (0 - Info[Page].gl)) PageScrollPos -= 47;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//调用原生方法
|
||||||
|
LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//override
|
||||||
|
//鼠标左键弹起回调
|
||||||
|
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
||||||
|
//调用原生方法
|
||||||
|
LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y);
|
||||||
|
|
||||||
|
if (HoverItem) {
|
||||||
|
local RealOp = 20077005;
|
||||||
|
if (HoverItem.isTure) RealOp = 20077009;
|
||||||
|
local T = {
|
||||||
|
op = RealOp,
|
||||||
|
boxId = Info[Page].id,
|
||||||
|
itemId = HoverItem.id
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function OpenCallBack() {
|
||||||
|
GetCollectInfo();
|
||||||
|
this.Visible = true;
|
||||||
|
ResetFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -201,7 +350,9 @@ function Lenheart_CollectionBox_Fun(obj) {
|
||||||
local RootTab = getroottable();
|
local RootTab = getroottable();
|
||||||
if (!RootTab.rawin("CollectionBox_Obj")) {
|
if (!RootTab.rawin("CollectionBox_Obj")) {
|
||||||
RootTab.rawset("CollectionBox_Obj", true);
|
RootTab.rawset("CollectionBox_Obj", true);
|
||||||
LenheartNewUI_CreateWindow(CollectionBoxC, "收集箱", ((getroottable().Rindro_Scr_Width - 376) / 2).tointeger(), 64, 376, 384, 28);
|
local Winobj = LenheartNewUI_CreateWindow(CollectionBoxC, "收集箱窗口", ((getroottable().Rindro_Scr_Width - 376) / 2).tointeger(), 64, 376, 384, 28);
|
||||||
|
|
||||||
|
EventList_Obj.AddEvent("收集箱", 73, Winobj, "interface2/hud/information_button/information_button_cn.img");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ class longlong {
|
||||||
|
|
||||||
function GetFormat(FType) {
|
function GetFormat(FType) {
|
||||||
local Buf = L_sq_LongLongOperation(this.Value, FType, "format");
|
local Buf = L_sq_LongLongOperation(this.Value, FType, "format");
|
||||||
|
if (Buf.len()< 2) return Buf + ".0";
|
||||||
local Value = Buf.slice(0, -1);
|
local Value = Buf.slice(0, -1);
|
||||||
local Unit = Buf.slice(-1);
|
local Unit = Buf.slice(-1);
|
||||||
local RetStr = format(FType + Unit, Value.tofloat());
|
local RetStr = format(FType + Unit, Value.tofloat());
|
||||||
|
|
@ -118,7 +119,6 @@ class DamagePerSecondC extends LenheartNewUI_Windows {
|
||||||
|
|
||||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
PushDamageFontFuncTab.rawset("DamagePerSecondCFunc", Sq_PushDamageData.bindenv(this));
|
PushDamageFontFuncTab.rawset("DamagePerSecondCFunc", Sq_PushDamageData.bindenv(this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function RegisterWidget() {
|
function RegisterWidget() {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,622 @@
|
||||||
|
/*
|
||||||
|
文件名:HorseGuessing.nut
|
||||||
|
路径:Project/HorseGuessing/HorseGuessing.nut
|
||||||
|
创建日期:2024-09-25 20:30
|
||||||
|
文件用途:骑士马战
|
||||||
|
*/
|
||||||
|
dofile("sqr/Project/HorseGuessing/HorseGuessing_Guide.nut"); //骑士马战指引
|
||||||
|
dofile("sqr/Project/HorseGuessing/HorseGuessing_KnightInfo.nut"); //骑士马战资料
|
||||||
|
dofile("sqr/Project/HorseGuessing/HorseGuessing_PastRecord.nut"); //骑士马战过往战绩
|
||||||
|
|
||||||
|
class HorseGuessingBaseButton extends LenheartNewUI_BaseButton {
|
||||||
|
//是否翻转
|
||||||
|
IsFlip = false;
|
||||||
|
|
||||||
|
//ovverride
|
||||||
|
//鼠标事件回调
|
||||||
|
function OnMouseProc(Flag, MousePos_X, MousePos_Y) {
|
||||||
|
if (!IsFlip) {
|
||||||
|
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) isInRect = true;
|
||||||
|
else isInRect = false;
|
||||||
|
} else {
|
||||||
|
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X - Width, Y, Width, Height)) isInRect = true;
|
||||||
|
else isInRect = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//ovverride
|
||||||
|
//鼠标左键按下回调
|
||||||
|
function OnMouseLbDown(MousePos_X, MousePos_Y) {
|
||||||
|
if (!IsFlip) {
|
||||||
|
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) {
|
||||||
|
isLBDown = true;
|
||||||
|
if (!OnClickSound) {
|
||||||
|
R_Utils.PlaySound("CLICK_BUTTON1");
|
||||||
|
} else {
|
||||||
|
R_Utils.PlaySound(OnClickSound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X - Width, Y, Width, Height)) {
|
||||||
|
isLBDown = true;
|
||||||
|
if (!OnClickSound) {
|
||||||
|
R_Utils.PlaySound("CLICK_BUTTON1");
|
||||||
|
} else {
|
||||||
|
R_Utils.PlaySound(OnClickSound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//ovverride
|
||||||
|
function Show(obj) {
|
||||||
|
|
||||||
|
local XRate = 1.0;
|
||||||
|
if (IsFlip) XRate = -1.0;
|
||||||
|
//不可用
|
||||||
|
if (State == 8) {
|
||||||
|
L_sq_DrawImg(Path, Idx + 3, X, Y + 1, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||||
|
} else {
|
||||||
|
//按下
|
||||||
|
if (isLBDown) {
|
||||||
|
L_sq_DrawImg(Path, Idx + 2, X, Y + 1, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||||
|
}
|
||||||
|
//悬停
|
||||||
|
else if (isInRect) {
|
||||||
|
L_sq_DrawImg(Path, Idx + 1, X, Y, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||||
|
}
|
||||||
|
//普通
|
||||||
|
else {
|
||||||
|
L_sq_DrawImg(Path, Idx, X, Y, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class HorseGuessingC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
//DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
Visible = false;
|
||||||
|
|
||||||
|
//标题栏
|
||||||
|
Title = null;
|
||||||
|
//当前页面
|
||||||
|
Page = 0;
|
||||||
|
|
||||||
|
//页面选择器
|
||||||
|
PageSelectM = 0;
|
||||||
|
//指引页面
|
||||||
|
GuidePage = null;
|
||||||
|
//骑士资料页面
|
||||||
|
KnightInfoPage = null;
|
||||||
|
//过往战绩页面
|
||||||
|
PastRecordPage = null;
|
||||||
|
|
||||||
|
|
||||||
|
//骑手名称
|
||||||
|
RiderName = null;
|
||||||
|
|
||||||
|
//当前选择骑手
|
||||||
|
NowSelectRider = 0;
|
||||||
|
|
||||||
|
//下注
|
||||||
|
BetItem = 0;
|
||||||
|
|
||||||
|
//剩余可下注数量
|
||||||
|
ResidueCoin = 10000;
|
||||||
|
|
||||||
|
//骑手信息
|
||||||
|
RiderInfo = null;
|
||||||
|
|
||||||
|
//往期战绩
|
||||||
|
InfoContestLog = null;
|
||||||
|
|
||||||
|
//状态
|
||||||
|
MyState = 0;
|
||||||
|
|
||||||
|
//初始化名字包
|
||||||
|
function InitRiderNameCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
RiderName = Jso.name;
|
||||||
|
ResidueCoin = Jso.Max;
|
||||||
|
BetItem = Jso.itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取基础配置信息
|
||||||
|
function GetBaseConfig() {
|
||||||
|
local T = {
|
||||||
|
op = 20055001,
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
}
|
||||||
|
//获取基础配置信息回调
|
||||||
|
function GetBaseConfigCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
if (!("Top8" in Jso.Rank)) return;
|
||||||
|
|
||||||
|
//同步状态
|
||||||
|
MyState = Jso.state;
|
||||||
|
|
||||||
|
//初始化骑手信息
|
||||||
|
RiderInfo = [];
|
||||||
|
RiderInfo = Jso.Rank.Top8;
|
||||||
|
|
||||||
|
//写入骑手下注信息
|
||||||
|
for (local i = 0; i< RiderInfo.len(); i++) {
|
||||||
|
RiderInfo[i].codeItem <- Jso.codeItem[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
//重置骑手按钮
|
||||||
|
|
||||||
|
//构造骑手按钮
|
||||||
|
InitKnightButton();
|
||||||
|
|
||||||
|
//刷新剩余可下注数量
|
||||||
|
ResidueCoin = Jso.ResidueCoin;
|
||||||
|
|
||||||
|
|
||||||
|
//请求骑士个人信息
|
||||||
|
this.GetRiderInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取过往战绩
|
||||||
|
function GetPastRecord() {
|
||||||
|
local T = {
|
||||||
|
op = 20055009,
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
}
|
||||||
|
//获取过往战绩回调
|
||||||
|
function GetPastRecordCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
InfoContestLog = Jso.knights;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获取选手具体信息
|
||||||
|
function GetRiderInfo() {
|
||||||
|
local T = {
|
||||||
|
op = 20055003,
|
||||||
|
code = NowSelectRider,
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取选手具体信息回调包
|
||||||
|
function GetRiderInfoCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
RiderInfo[NowSelectRider].outcome <- Jso.outcome;
|
||||||
|
}
|
||||||
|
|
||||||
|
//通知刷新信息包
|
||||||
|
function NotifyRefreshInfoCallBack(Chunk) {
|
||||||
|
GetBaseConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
//动画脚本状态
|
||||||
|
AnimationAct = 0;
|
||||||
|
//绘制动画包
|
||||||
|
function DrawAniInfoCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
AnimationAct = Jso.state;
|
||||||
|
|
||||||
|
if (AnimationAct == 2) {
|
||||||
|
if (CompetitionStartAnimotion) sq_Rewind(CompetitionStartAnimotion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//战斗信息
|
||||||
|
FightInfo = null;
|
||||||
|
WinnerEffectTimer = null;
|
||||||
|
//战斗信息包
|
||||||
|
function FightInfoCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
MyState = Jso.state;
|
||||||
|
|
||||||
|
FightInfo = Jso;
|
||||||
|
if (MyState >= 30) {
|
||||||
|
WinnerEffectTimer = Clock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获胜者动画
|
||||||
|
NotiState = false; //公告状态
|
||||||
|
NotiStr = null; //公告内容
|
||||||
|
NotiTime = null; //公告时间
|
||||||
|
|
||||||
|
function WinnerAniCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
NotiState = true; //公告状态
|
||||||
|
NotiStr = Jso.Str; //公告内容
|
||||||
|
NotiTime = Clock();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
Title = [];
|
||||||
|
RiderInfo = [];
|
||||||
|
RiderName = [
|
||||||
|
"伊撒尔",
|
||||||
|
"理查德",
|
||||||
|
"席恩",
|
||||||
|
"吉尔特",
|
||||||
|
"爱德华",
|
||||||
|
"罗兰",
|
||||||
|
"莱奥",
|
||||||
|
"贝奥武夫",
|
||||||
|
];
|
||||||
|
|
||||||
|
// //读取配置文件
|
||||||
|
// local Config = R_Utils.ReadScriptConfig("etc/rindro/horseguessing/horseguessing.dat", 1024, "utf8");
|
||||||
|
|
||||||
|
// RiderName = Config.RiderInfo;
|
||||||
|
// BetItem = Config.ItemId;
|
||||||
|
// //把big的名字 转成 utf8
|
||||||
|
// for (local i = 0; i< RiderName.len(); i++) {
|
||||||
|
// RiderName[i] = Sq_ConvertWideChar(RiderName[i], "big5");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
Pack_Control.rawset(20055058, InitRiderNameCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(20055002, GetBaseConfigCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(20055010, GetPastRecordCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(20055004, GetRiderInfoCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(20055018, NotifyRefreshInfoCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(20055020, DrawAniInfoCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(20055012, FightInfoCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(20055078, WinnerAniCallBack.bindenv(this));
|
||||||
|
|
||||||
|
//获取基础配置
|
||||||
|
GetBaseConfig();
|
||||||
|
//获取历史战绩
|
||||||
|
GetPastRecord();
|
||||||
|
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
|
|
||||||
|
GuidePage = HorseGuessing_GuideC("骑士马战_指引窗口", X + 7, Y + 50, 214, 480, 0);
|
||||||
|
KnightInfoPage = HorseGuessing_KnightInfoC("骑士马战_资料窗口", X + 7, Y + 50, 214, 480, 0);
|
||||||
|
PastRecordPage = HorseGuessing_PastRecordC("骑士马战_战绩窗口", X + 7, Y + 50, 214, 480, 0);
|
||||||
|
|
||||||
|
//默认构造时切换到0页
|
||||||
|
ChangePage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ChangePage(ToPage) {
|
||||||
|
|
||||||
|
foreach(ButtonObj in Title) {
|
||||||
|
ButtonObj.State = 0;
|
||||||
|
}
|
||||||
|
Page = ToPage;
|
||||||
|
Title[ToPage].State = 1;
|
||||||
|
|
||||||
|
RemoveChild("骑士马战_指引窗口");
|
||||||
|
RemoveChild("骑士马战_资料窗口");
|
||||||
|
RemoveChild("骑士马战_战绩窗口");
|
||||||
|
|
||||||
|
PageSelectM = ToPage;
|
||||||
|
switch (ToPage) {
|
||||||
|
case 0: {
|
||||||
|
AddChild(GuidePage);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1: {
|
||||||
|
AddChild(KnightInfoPage);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
AddChild(PastRecordPage);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化骑士按钮
|
||||||
|
function InitKnightButton() {
|
||||||
|
foreach(pos, v in RiderInfo) {
|
||||||
|
local KnightButton = HorseGuessingBaseButton(269 + ((pos / 2) * 121) + ((pos % 2) * 59), 398, 36, 42, "interface2/event/chn_event_2016/160927_joustmatches/joustmatches_cha_btn.img", pos * 4);
|
||||||
|
//如果是偶数需要翻转骑士
|
||||||
|
if (pos % 2 == 1) {
|
||||||
|
KnightButton.IsFlip = true;
|
||||||
|
KnightButton.Localtion_X += 36;
|
||||||
|
}
|
||||||
|
KnightButton.Data = v;
|
||||||
|
KnightButton.OnClickEx = function(Button) {
|
||||||
|
this.NowSelectRider = Button.Data.code;
|
||||||
|
ChangePage(1);
|
||||||
|
//请求骑士个人信息
|
||||||
|
this.GetRiderInfo();
|
||||||
|
}.bindenv(this);
|
||||||
|
|
||||||
|
KnightButton.SetCallBackFunc(function(Button) {
|
||||||
|
//是否翻转的偏移
|
||||||
|
local FlipXOffset = ((Button.IsFlip == true) ? -35 : 0);
|
||||||
|
local horseKey = ((Button.IsFlip == true) ? "right" : "left");
|
||||||
|
//绘制旗帜
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img", 11 + Button.Data.code, Button.X - 6 + FlipXOffset, Button.Y + 46);
|
||||||
|
//绘制赔率信息
|
||||||
|
local OddsStr = format("%.2f", Button.Data.Odds.tofloat());
|
||||||
|
L_sq_DrawCode(OddsStr, Button.X + 18 + FlipXOffset - LenheartTextClass.GetStringLength(OddsStr) / 2, Button.Y + 53);
|
||||||
|
//绘制已投币数量
|
||||||
|
local codeItem = Button.Data.codeItem.tostring();
|
||||||
|
L_sq_DrawCode(codeItem, Button.X + 18 + FlipXOffset - LenheartTextClass.GetStringLength(codeItem) / 2, Button.Y + 68);
|
||||||
|
|
||||||
|
//绘制框
|
||||||
|
if (FlipXOffset == -35) FlipXOffset = -37; //傻逼国服美工这个偏移和那个翻转的偏移不一样
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_horse_" + horseKey + "_effect.img", Button.Data.code * 2, Button.X + FlipXOffset - 11, Button.Y - 54);
|
||||||
|
|
||||||
|
|
||||||
|
}.bindenv(this));
|
||||||
|
Childrens.append(KnightButton);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
//关闭按钮
|
||||||
|
local CloseButton = LenheartNewUI_BaseButton(750, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
|
CloseButton.OnClick = function() {
|
||||||
|
this.Visible = false;
|
||||||
|
}.bindenv(this);
|
||||||
|
Childrens.append(CloseButton);
|
||||||
|
|
||||||
|
local Tabbars1 = LenheartNewUI_TabbarsText(12, 27, "指引");
|
||||||
|
Tabbars1.State = 1;
|
||||||
|
AddChild(Tabbars1);
|
||||||
|
Tabbars1.OnClick = function() {
|
||||||
|
ChangePage(0);
|
||||||
|
}.bindenv(this);
|
||||||
|
Title.append(Tabbars1);
|
||||||
|
|
||||||
|
local Tabbars2 = LenheartNewUI_TabbarsText(74, 27, "骑士资料");
|
||||||
|
AddChild(Tabbars2);
|
||||||
|
Tabbars2.OnClick = function() {
|
||||||
|
ChangePage(1);
|
||||||
|
}.bindenv(this);
|
||||||
|
Tabbars2.SetTextOffset(7, 3);
|
||||||
|
Title.append(Tabbars2);
|
||||||
|
|
||||||
|
local Tabbars3 = LenheartNewUI_TabbarsText(136, 27, "过往战绩");
|
||||||
|
AddChild(Tabbars3);
|
||||||
|
Tabbars3.OnClick = function() {
|
||||||
|
ChangePage(2);
|
||||||
|
}.bindenv(this);
|
||||||
|
Tabbars3.SetTextOffset(7, 3);
|
||||||
|
Title.append(Tabbars3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function DrawInfo(obj) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
//绘制窗口
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img", 33, X, Y);
|
||||||
|
//绘制左边底槽窗口
|
||||||
|
L_sq_DrawWindow(X + 2, Y + 46, 210, 435, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||||
|
|
||||||
|
|
||||||
|
//绘制详情页
|
||||||
|
DrawInfo(obj);
|
||||||
|
|
||||||
|
//BackGround
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img", 0, X + 227, Y + 26);
|
||||||
|
|
||||||
|
// L_sq_DrawCode(L_sq_StringBinById(271069), X + 400, Y + 386, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//开始动画
|
||||||
|
CompetitionStartAnimotion = null;
|
||||||
|
//绘制动画
|
||||||
|
function DrawAnimation(obj) {
|
||||||
|
//绘制321开始
|
||||||
|
if (AnimationAct == 1) {
|
||||||
|
CompetitionStartAnimotion = T_DrawDynamicAni(obj, "common/horseguessing/countdown.ani", X + 9 + 287 - 14 + 202, Y + 45 + 237 + 64 - 144, "HorseGuessingCompetitionState8");
|
||||||
|
}
|
||||||
|
//绘制战斗
|
||||||
|
else if (AnimationAct == 2) {
|
||||||
|
local T = {
|
||||||
|
count = 4,
|
||||||
|
x = 282,
|
||||||
|
y = 346,
|
||||||
|
x2 = 282,
|
||||||
|
y2 = 346,
|
||||||
|
x3 = 282,
|
||||||
|
y3 = 346,
|
||||||
|
offset = 122,
|
||||||
|
}
|
||||||
|
// if(MyState < 10)
|
||||||
|
if (MyState >= 10 && MyState< 20) {
|
||||||
|
T.count = 2;
|
||||||
|
T.x = 344;
|
||||||
|
T.y = 222;
|
||||||
|
T.x2 = 310;
|
||||||
|
T.y2 = 232;
|
||||||
|
T.x3 = 380;
|
||||||
|
T.y3 = 232;
|
||||||
|
T.offset = 244;
|
||||||
|
} else if (MyState >= 20) {
|
||||||
|
T.count = 1;
|
||||||
|
T.x = 465;
|
||||||
|
T.y = 54;
|
||||||
|
T.x2 = 370;
|
||||||
|
T.y2 = 120;
|
||||||
|
T.x3 = 560;
|
||||||
|
T.y3 = 120;
|
||||||
|
T.offset = 244;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (local i = 0; i< T.count; i++) {
|
||||||
|
T_DrawDynamicAni(obj, "common/horseguessing/battle.ani", X + T.x + (i * T.offset), Y + T.y, "骑士马战战斗动画文字");
|
||||||
|
|
||||||
|
T_DrawDynamicAni(obj, "common/horseguessing/battleleffect.ani", X + T.x2 + (i * T.offset), Y + T.y2, "骑士马战战斗动画左");
|
||||||
|
T_DrawDynamicAni(obj, "common/horseguessing/battlereffect.ani", X + T.x3 + (i * T.offset), Y + T.y3, "骑士马战战斗动画右");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//结束绘制
|
||||||
|
else if (AnimationAct == 3) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制骑士和生命值
|
||||||
|
function DrawKnightAndHpDrawFunction(T, Key) {
|
||||||
|
foreach(i, value in FightInfo[Key]) {
|
||||||
|
local DrawX = X + T.x + ((i / 2) * T.offset1) + ((i % 2) * T.offset2);
|
||||||
|
local DrawY = Y + T.y;
|
||||||
|
|
||||||
|
local XRate = (i % 2 == 0 ? 1.0 : -1.0);
|
||||||
|
local Xoffset = (i % 2 == 0 ? 0 : 36);
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_cha_btn.img", value.code * 4, DrawX + Xoffset, DrawY, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||||
|
|
||||||
|
//绘制血条
|
||||||
|
setClip(DrawX + 2, DrawY - 4, DrawX + 2 + (34.0 * (value.hp.tofloat() / 100.0)).tointeger(), DrawY - 4 + 2);
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img", 2, DrawX + 2, DrawY - 4);
|
||||||
|
releaseClip();
|
||||||
|
|
||||||
|
//绘制胜利线
|
||||||
|
if (value.win > 0) {
|
||||||
|
local XXoffset = (i % 2 == 0 ? 0 : -2);
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img", 20 + T.imgoffset, DrawX + XXoffset + T.Xx, DrawY - 65 + T.Xy, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function DrawKnightAndHp(obj) {
|
||||||
|
if (!FightInfo) return;
|
||||||
|
|
||||||
|
if (MyState > 0) {
|
||||||
|
local T = {
|
||||||
|
x = 268,
|
||||||
|
y = 398,
|
||||||
|
offset1 = 121,
|
||||||
|
offset2 = 59,
|
||||||
|
imgoffset = 0,
|
||||||
|
Xx = 20,
|
||||||
|
Xy = 0
|
||||||
|
}
|
||||||
|
DrawKnightAndHpDrawFunction(T, "top8");
|
||||||
|
}
|
||||||
|
if (MyState >= 10) {
|
||||||
|
local T = {
|
||||||
|
x = 298,
|
||||||
|
y = 287,
|
||||||
|
offset1 = 242,
|
||||||
|
offset2 = 122,
|
||||||
|
imgoffset = 1,
|
||||||
|
Xx = 19,
|
||||||
|
Xy = 0
|
||||||
|
};
|
||||||
|
DrawKnightAndHpDrawFunction(T, "top4");
|
||||||
|
}
|
||||||
|
if (MyState >= 20) {
|
||||||
|
local T = {
|
||||||
|
x = 358,
|
||||||
|
y = 176,
|
||||||
|
offset1 = 400,
|
||||||
|
offset2 = 244,
|
||||||
|
imgoffset = 2,
|
||||||
|
Xx = 19,
|
||||||
|
Xy = 7
|
||||||
|
};
|
||||||
|
DrawKnightAndHpDrawFunction(T, "top2");
|
||||||
|
}
|
||||||
|
if (MyState >= 30) {
|
||||||
|
local T = {
|
||||||
|
x = 482,
|
||||||
|
y = 88,
|
||||||
|
offset1 = 121,
|
||||||
|
offset2 = 59,
|
||||||
|
imgoffset = 1,
|
||||||
|
Xx = 19,
|
||||||
|
Xy = 0
|
||||||
|
};
|
||||||
|
T_DrawDynamicAni(obj, "common/horseguessing/winnereffect_back.ani", X + T.x, Y + T.y, "骑士马战冠军背景");
|
||||||
|
DrawKnightAndHpDrawFunction(T, "top1");
|
||||||
|
T_DrawDynamicAni(obj, "common/horseguessing/winnereffect_front.ani", X + T.x - 15, Y + T.y - 10, "骑士马战冠军特效" + WinnerEffectTimer);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制公告
|
||||||
|
function DrawNoti(obj) {
|
||||||
|
//NotiStr
|
||||||
|
if (NotiState) {
|
||||||
|
// print(Clock() - NotiTime);
|
||||||
|
local A = 0;
|
||||||
|
if (Clock() - NotiTime< 2000) {
|
||||||
|
A = sq_GetUniformVelocity(0, 250, Clock() - NotiTime, 2000);
|
||||||
|
}
|
||||||
|
if (Clock() - NotiTime >= 2000 && Clock() - NotiTime< 3000) A = 250;
|
||||||
|
if (Clock() - NotiTime >= 3000) {
|
||||||
|
A = sq_GetUniformVelocity(250, 0, Clock() - NotiTime, 6000);
|
||||||
|
}
|
||||||
|
local Xpos = ((getroottable().Rindro_Scr_Width - 647) / 2).tointeger();
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img", 26, Xpos, 160, 0, sq_RGBA(255, 255, 255, A), 1.0, 1.0);
|
||||||
|
L_sq_DrawCode(NotiStr, Xpos + 366 - LenheartTextClass.GetStringLength(NotiStr), 160 + 44, sq_RGBA(255, 255, 255, A), 2, 1);
|
||||||
|
if (Clock() - NotiTime >= 6000) {
|
||||||
|
NotiState = false;
|
||||||
|
}
|
||||||
|
// NotiTime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
DrawAnimation(obj);
|
||||||
|
DrawKnightAndHp(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
|
||||||
|
//主动调用子对象窗口的Proc
|
||||||
|
foreach(Object in Childrens) {
|
||||||
|
if (Object instanceof LenheartNewUI_Windows)
|
||||||
|
Object.Proc(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function TopShow(obj) {
|
||||||
|
DrawNoti(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function OpenCallBack() {
|
||||||
|
this.Visible = true;
|
||||||
|
ResetFocus();
|
||||||
|
//获取基础配置
|
||||||
|
GetBaseConfig();
|
||||||
|
//获取历史战绩
|
||||||
|
GetPastRecord();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getroottable().rawdelete("HorseGuessing_Obj");
|
||||||
|
|
||||||
|
function Lenheart_HorseGuessing_Fun(obj) {
|
||||||
|
local RootTab = getroottable();
|
||||||
|
if (!RootTab.rawin("HorseGuessing_Obj")) {
|
||||||
|
RootTab.rawset("HorseGuessing_Obj", true);
|
||||||
|
local Winobj = LenheartNewUI_CreateWindow(HorseGuessingC, "骑士马战窗口", ((getroottable().Rindro_Scr_Width - 772) / 2).tointeger(), 30, 772, 539, 28);
|
||||||
|
|
||||||
|
EventList_Obj.AddEvent("骑士马战", 106, Winobj, "interface2/yosin/eventsystemlist2.img");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getroottable()["LenheartFuncTab"].rawset("HorseGuessingFuncN", Lenheart_HorseGuessing_Fun);
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
/*
|
||||||
|
文件名:HorseGuessing_Guide.nut
|
||||||
|
路径:Project/HorseGuessing/HorseGuessing_Guide.nut
|
||||||
|
创建日期:2024-09-25 20:50
|
||||||
|
文件用途:骑士马战指引窗口
|
||||||
|
*/
|
||||||
|
class HorseGuessing_GuideC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
// Visible = false;
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", 0, X, Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X - 7, Y - 50);
|
||||||
|
|
||||||
|
if (Parent && Parent.Visible && Parent.PageSelectM == 0) {
|
||||||
|
Visible = true;
|
||||||
|
X = Parent.X + 7;
|
||||||
|
Y = Parent.Y + 50;
|
||||||
|
} else {
|
||||||
|
Visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//因为要重载LenheartNewUI_Windows的构造函数
|
||||||
|
function ResetFocus() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getroottable().rawdelete("HorseGuessing_Obj");
|
||||||
|
|
@ -0,0 +1,147 @@
|
||||||
|
/*
|
||||||
|
文件名:HorseGuessing_KnightInfo.nut
|
||||||
|
路径:Project/HorseGuessing/HorseGuessing_KnightInfo.nut
|
||||||
|
创建日期:2024-09-25 21:11
|
||||||
|
文件用途:骑士信息
|
||||||
|
*/
|
||||||
|
class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
// Visible = false;
|
||||||
|
|
||||||
|
|
||||||
|
//输入框
|
||||||
|
InputObject = null;
|
||||||
|
|
||||||
|
AniList = null;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
// AniList = [];
|
||||||
|
// for (local i = 0; i< 13; i++) {
|
||||||
|
// local obj = sq_getMyCharacter();
|
||||||
|
// local ani = obj.getVar().GetAnimationMap("common/horseguessing/knight" + i + ".ani", "common/horseguessing/knight" + i + ".ani");
|
||||||
|
// AniList.append({
|
||||||
|
// ani = ani,
|
||||||
|
// flag = false
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
//下注按钮
|
||||||
|
local BetButton = LenheartNewUI_BaseButton(54, 654, 129, 33, "interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", 22);
|
||||||
|
BetButton.OnClickSound = "BUTTON_01";
|
||||||
|
BetButton.OnClick = function() {
|
||||||
|
local T = {
|
||||||
|
op = 20055005,
|
||||||
|
code = Parent.NowSelectRider,
|
||||||
|
num = InputObject.str,
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
}.bindenv(this);
|
||||||
|
BetButton.SetCallBackFunc(function(Button) {
|
||||||
|
if (Parent.MyState != 0) Button.Visible = false;
|
||||||
|
else Button.Visible = true;
|
||||||
|
}.bindenv(this));
|
||||||
|
Childrens.append(BetButton);
|
||||||
|
|
||||||
|
InputObject = LenheartNewUI_BaseInput(80, 564, 76, 20);
|
||||||
|
AddChild(InputObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", 1, X, Y);
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", 50, X + 7, Y + 12);
|
||||||
|
|
||||||
|
//DrawParent.RiderInfo
|
||||||
|
T_DrawDynamicAni(obj, "common/horseguessing/knight" + Parent.NowSelectRider + ".ani", X + 2, Y + 130, "HorseGuessingRiderAnimotion" + Parent.NowSelectRider);
|
||||||
|
T_DrawDynamicAni(obj, "common/horseguessing/knightinfoeffect.ani", X - 1, Y - 9, "HorseGuessingRiderAnimotionEff");
|
||||||
|
|
||||||
|
//绘制名字
|
||||||
|
local RiderNameStr = Parent.RiderName[Parent.NowSelectRider];
|
||||||
|
L_sq_DrawCode(RiderNameStr, X + 111 - (LenheartTextClass.GetStringLength(RiderNameStr) / 2), Y + 116 + 18 + 146 + 3, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
|
||||||
|
//绘制下注道具
|
||||||
|
DrawItemBase(X + 74, Y + 320, Parent.BetItem, 1);
|
||||||
|
|
||||||
|
|
||||||
|
//骑手胜率信息
|
||||||
|
if (Parent.RiderInfo && Parent.RiderInfo.len() > Parent.NowSelectRider && "outcome" in Parent.RiderInfo[Parent.NowSelectRider]) {
|
||||||
|
local Info = Parent.RiderInfo[Parent.NowSelectRider].outcome;
|
||||||
|
L_sq_DrawCode("获胜 : " + Info[2] + "次", X + 15 + 5, Y + 20, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
//胜负情况字符串
|
||||||
|
local outcomeStr = Info[0] + "胜" + Info[1] + "败";
|
||||||
|
L_sq_DrawCode(outcomeStr, X + 50 - LenheartTextClass.GetStringLength(outcomeStr) / 2, Y + 38, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
local WinRate = 0;
|
||||||
|
if (Info[0] + Info[1] != 0) //判断不要0 / 0
|
||||||
|
WinRate = ((Info[0].tofloat() / (Info[0] + Info[1]).tofloat()) * 100.0).tointeger();
|
||||||
|
WinRate = "胜率 : " + WinRate + "%";
|
||||||
|
L_sq_DrawCode(WinRate, X + 55 - LenheartTextClass.GetStringLength(WinRate) / 2, Y + 54, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
|
||||||
|
if (Info[3] != 0 && Info[4] != 0) {
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", Info[3], X + 25 + 5 + 152, Y + 10);
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", Info[4], X + 25 + 5 + 152, Y + 46);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//绘制剩余道具数量
|
||||||
|
if (Parent.ResidueCoin != null) {
|
||||||
|
L_sq_DrawCode(Parent.ResidueCoin.tostring(), X + 128, Y + 386, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X - 7, Y - 210);
|
||||||
|
|
||||||
|
if (Parent && Parent.Visible && Parent.PageSelectM == 1) {
|
||||||
|
Visible = true;
|
||||||
|
X = Parent.X + 7;
|
||||||
|
Y = Parent.Y + 50;
|
||||||
|
} else {
|
||||||
|
Visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断如果输入的金额大于自身有的金额
|
||||||
|
if (InputObject.str.len() > 0 && InputObject.str.tointeger() > Parent.ResidueCoin) {
|
||||||
|
InputObject.SetStr(Parent.ResidueCoin.tostring());
|
||||||
|
}
|
||||||
|
|
||||||
|
// //在城镇的时候才播放
|
||||||
|
// if (sq_GetCurrentModuleType() == 1) {
|
||||||
|
// foreach(value in AniList) {
|
||||||
|
// sq_AnimationProc(value.ani);
|
||||||
|
// sq_drawCurrentFrame(value.ani, -600, 0, true);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//因为要重载LenheartNewUI_Windows的构造函数
|
||||||
|
function ResetFocus() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getroottable().rawdelete("HorseGuessing_Obj");
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
/*
|
||||||
|
文件名:HorseGuessing_PastRecord.nut
|
||||||
|
路径:Project/HorseGuessing/HorseGuessing_PastRecord.nut
|
||||||
|
创建日期:2024-09-27 19:10
|
||||||
|
文件用途:马战过往战绩窗口
|
||||||
|
*/
|
||||||
|
class HorseGuessing_PastRecordC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
// Visible = false;
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", 26, X, Y);
|
||||||
|
|
||||||
|
|
||||||
|
if (Parent.InfoContestLog) {
|
||||||
|
foreach(Pos, Value in Parent.InfoContestLog) {
|
||||||
|
L_sq_DrawCode((format("%03d", Value.Periods)).tostring(), X + 6, Y + 26 + (Pos * 20), sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", 38 + Value.code, X + 32, Y + 24 + (Pos * 20));
|
||||||
|
L_sq_DrawCode(Parent.RiderName[Value.code], X + 32 + 28, Y + 26 + (Pos * 20), sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
L_sq_DrawCode((format("%.2f", Value.SOdds.tofloat())).tostring(), X + 32 + 28 + 100, Y + 26 + (Pos * 20), sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X - 7, Y - 50);
|
||||||
|
|
||||||
|
if (Parent && Parent.Visible && Parent.PageSelectM == 2) {
|
||||||
|
Visible = true;
|
||||||
|
X = Parent.X + 7;
|
||||||
|
Y = Parent.Y + 50;
|
||||||
|
} else {
|
||||||
|
Visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//因为要重载LenheartNewUI_Windows的构造函数
|
||||||
|
function ResetFocus() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getroottable().rawdelete("HorseGuessing_Obj");
|
||||||
|
|
@ -58,6 +58,15 @@ class HudUiC extends LenheartNewUI_Windows {
|
||||||
//城镇名称
|
//城镇名称
|
||||||
L_sq_WA(0x004CA27C, 850);
|
L_sq_WA(0x004CA27C, 850);
|
||||||
|
|
||||||
|
//城镇过场Tips背景
|
||||||
|
L_sq_WA(0x004580FD, 400 + 133);
|
||||||
|
//城镇过场Tips文本
|
||||||
|
L_sq_WA(0x004581DD, 400 + 133);
|
||||||
|
|
||||||
|
//头顶滚动公告
|
||||||
|
L_sq_WAB(0x11FA640, 0xC3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//物品栏
|
//物品栏
|
||||||
for (local i = 0; i< 6; i++) {
|
for (local i = 0; i< 6; i++) {
|
||||||
|
|
@ -120,8 +129,8 @@ class HudUiC extends LenheartNewUI_Windows {
|
||||||
L_sq_WA(5006965, -5000); //MP文字标识 Y轴
|
L_sq_WA(5006965, -5000); //MP文字标识 Y轴
|
||||||
|
|
||||||
//BUFF图标 X在C++Hook中处理
|
//BUFF图标 X在C++Hook中处理
|
||||||
L_sq_WAB(0x4c8bf5, 534); //Buff图标Y
|
L_sq_WAB(0x4c8bf5, 542); //Buff图标Y
|
||||||
L_sq_WAB(0x4bf55a, 534); //Buff图标文字标识Y
|
L_sq_WAB(0x4bf55a, 542); //Buff图标文字标识Y
|
||||||
|
|
||||||
//技能变更类型
|
//技能变更类型
|
||||||
local SkillChanageA = L_sq_RA(0x01ADE0CC) + 0x124;
|
local SkillChanageA = L_sq_RA(0x01ADE0CC) + 0x124;
|
||||||
|
|
@ -159,6 +168,9 @@ class HudUiC extends LenheartNewUI_Windows {
|
||||||
|
|
||||||
//干掉废弃的深渊悬停提示
|
//干掉废弃的深渊悬停提示
|
||||||
MemoryTool.WirteByteArr(0xE6D90C, [0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90]);
|
MemoryTool.WirteByteArr(0xE6D90C, [0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90]);
|
||||||
|
|
||||||
|
//修复点击邮箱会乱跳鼠标
|
||||||
|
L_sq_WAB(0x11BD16E, 0xEB);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
|
@ -192,7 +204,12 @@ class HudUiC extends LenheartNewUI_Windows {
|
||||||
|
|
||||||
// local Window = sq_GetPopupWindowMainCotrol(74);
|
// local Window = sq_GetPopupWindowMainCotrol(74);
|
||||||
// print(Window.IsWindowFocus());
|
// print(Window.IsWindowFocus());
|
||||||
|
|
||||||
|
|
||||||
|
// asos = R_Utils.GetCharacByEqu(0, 0, [601550071, 601560067, 601570062, 601520061, 601500069, 601510068, 601530060, 601540069, 601580026, 27601]);
|
||||||
|
// asos = sq_CreateAICharacter(900);
|
||||||
}
|
}
|
||||||
|
asos = null;
|
||||||
|
|
||||||
function RegisterWidget() {
|
function RegisterWidget() {
|
||||||
//铃铛按钮
|
//铃铛按钮
|
||||||
|
|
@ -558,7 +575,21 @@ class HudUiC extends LenheartNewUI_Windows {
|
||||||
//绘制主界面
|
//绘制主界面
|
||||||
function DrawMain(obj) {
|
function DrawMain(obj) {
|
||||||
//绘制背景
|
//绘制背景
|
||||||
L_sq_DrawImg("interface2/hud/hud.img", 0, 0, 526);
|
L_sq_DrawImg("interface2/hud/lenheartaddhud.img", 0, 347, 526);
|
||||||
|
|
||||||
|
//绘制框
|
||||||
|
for (local i = 0; i< 6; i++) {
|
||||||
|
//消耗品
|
||||||
|
L_sq_DrawImg("interface2/hud/hud.img", 200, 134 + (i * 31), 567);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (local i = 0; i< 7; i++) {
|
||||||
|
//上排技能
|
||||||
|
L_sq_DrawImg("interface2/hud/hud.img", 201, 431 + (i * 31), 531);
|
||||||
|
L_sq_DrawImg("interface2/hud/hud.img", 201, 431 + (i * 31), 562);
|
||||||
|
}
|
||||||
|
//绘制疲劳底框
|
||||||
|
L_sq_DrawImg("interface2/hud/hud.img", 230, 774, 592);
|
||||||
|
|
||||||
//绘制血球蓝球
|
//绘制血球蓝球
|
||||||
DrawBall(obj);
|
DrawBall(obj);
|
||||||
|
|
@ -566,6 +597,7 @@ class HudUiC extends LenheartNewUI_Windows {
|
||||||
//绘制经验盖槽
|
//绘制经验盖槽
|
||||||
L_sq_DrawImg("interface2/hud/hud.img", 202, 313, 582);
|
L_sq_DrawImg("interface2/hud/hud.img", 202, 313, 582);
|
||||||
|
|
||||||
|
|
||||||
//绘制经验条
|
//绘制经验条
|
||||||
DrawExpBar(obj);
|
DrawExpBar(obj);
|
||||||
|
|
||||||
|
|
@ -577,6 +609,7 @@ class HudUiC extends LenheartNewUI_Windows {
|
||||||
|
|
||||||
//绘制活动图标背景槽
|
//绘制活动图标背景槽
|
||||||
DrawEventBackground(obj);
|
DrawEventBackground(obj);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Show(obj) {
|
function Show(obj) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,233 @@
|
||||||
|
/*
|
||||||
|
文件名:MarrySystem.nut
|
||||||
|
路径:Project/MarrySystem/MarrySystem.nut
|
||||||
|
创建日期:2024-10-01 00:01
|
||||||
|
文件用途:结婚系统
|
||||||
|
*/
|
||||||
|
|
||||||
|
dofile("sqr/Project/MarrySystem/MarrySystem_Request.nut");
|
||||||
|
dofile("sqr/Project/MarrySystem/MarrySystem_Response.nut");
|
||||||
|
dofile("sqr/Project/MarrySystem/MarrySystem_Preparation.nut");
|
||||||
|
|
||||||
|
class MarrySystemC extends Rindro_BaseToolClass {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
// Visible = false;
|
||||||
|
|
||||||
|
//包头
|
||||||
|
OP = 20078000;
|
||||||
|
|
||||||
|
//结婚状态
|
||||||
|
MarryState = 0;
|
||||||
|
|
||||||
|
//申请订婚窗口
|
||||||
|
RequestWindow = null;
|
||||||
|
//答复窗口
|
||||||
|
ResponseWindow = null;
|
||||||
|
//准备婚礼窗口
|
||||||
|
PreparationWindow = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//查看自己是否有结婚
|
||||||
|
function CheckMarryState() {
|
||||||
|
SendPackEx({
|
||||||
|
op = OP + 9
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function CheckMarryStateCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
MarryState = Jso.Flag;
|
||||||
|
InitNpcEachButton();
|
||||||
|
}
|
||||||
|
|
||||||
|
//收到结婚请求
|
||||||
|
function RequestMarryCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
ResponseWindow.applicantName = Jso.applicantName;
|
||||||
|
ResponseWindow.applicantCid = Jso.applicantCid;
|
||||||
|
ResponseWindow.applicantUid = Jso.applicantUid;
|
||||||
|
ResponseWindow.Visible = true;
|
||||||
|
ResponseWindow.ResetFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
//打开准备婚礼窗口
|
||||||
|
function OpenPreparationWindowCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
PreparationWindow.Name1 = Jso.MyName;
|
||||||
|
PreparationWindow.Name2 = Jso.TargetName;
|
||||||
|
PreparationWindow.Visible = true;
|
||||||
|
PreparationWindow.ResetFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
|
||||||
|
RequestWindow = MarrySystem_RequestC("结婚系统_申请订婚窗口", ((getroottable().Rindro_Scr_Width - 329) / 2).tointeger(), 180, 329, 166, 16);
|
||||||
|
ResponseWindow = MarrySystem_ResponseC("结婚系统_订婚答复窗口", ((getroottable().Rindro_Scr_Width - 329) / 2).tointeger(), 180, 329, 166, 16);
|
||||||
|
PreparationWindow = MarrySystem_PreparationC("结婚系统_准备婚礼窗口", ((getroottable().Rindro_Scr_Width - 256) / 2).tointeger(), 100, 260, 374, 28);
|
||||||
|
|
||||||
|
OnSetCharacter_Control.MarrySystem <- OnSetCharacter.bindenv(this);
|
||||||
|
Pack_Control.rawset(OP + 10, CheckMarryStateCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(OP + 4, RequestMarryCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(OP + 12, OpenPreparationWindowCallBack.bindenv(this));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CheckMarryState();
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//注册NPC按钮
|
||||||
|
function InitNpcEachButton() {
|
||||||
|
local EachManager = getroottable()["L_Each_Obj"];
|
||||||
|
//先清空注册
|
||||||
|
EachManager.RemoveEachForNpc(20013);
|
||||||
|
|
||||||
|
//没结婚注册申请结婚按钮
|
||||||
|
if (MarryState == 0) {
|
||||||
|
EachManager.AddEachForNpc(20013, function(SThis) {
|
||||||
|
//关闭按钮
|
||||||
|
local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3);
|
||||||
|
ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img";
|
||||||
|
ApplyEngagementButton.IconIdx = 10;
|
||||||
|
ApplyEngagementButton.Str = "申请结婚";
|
||||||
|
ApplyEngagementButton.OnClick = function(Button) {
|
||||||
|
Button.Parent.CloseAllEach();
|
||||||
|
Button.Parent.CloseWindow();
|
||||||
|
RequestWindow.Visible = true;
|
||||||
|
RequestWindow.ResetFocus();
|
||||||
|
}.bindenv(this);
|
||||||
|
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
|
||||||
|
SThis.AddChild(ApplyEngagementButton);
|
||||||
|
}.bindenv(this));
|
||||||
|
}
|
||||||
|
//已订婚 未结婚
|
||||||
|
else if (MarryState == 1) {
|
||||||
|
EachManager.AddEachForNpc(20013, function(SThis) {
|
||||||
|
//关闭按钮
|
||||||
|
local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3);
|
||||||
|
ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img";
|
||||||
|
ApplyEngagementButton.IconIdx = 12;
|
||||||
|
ApplyEngagementButton.Str = "退婚";
|
||||||
|
ApplyEngagementButton.OnClick = function(Button) {
|
||||||
|
Button.Parent.CloseAllEach();
|
||||||
|
Button.Parent.CloseWindow();
|
||||||
|
local T = {
|
||||||
|
op = OP + 7,
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
}.bindenv(this);
|
||||||
|
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
|
||||||
|
SThis.AddChild(ApplyEngagementButton);
|
||||||
|
|
||||||
|
//关闭按钮
|
||||||
|
local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3);
|
||||||
|
ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img";
|
||||||
|
ApplyEngagementButton.IconIdx = 11;
|
||||||
|
ApplyEngagementButton.Str = "举办婚礼";
|
||||||
|
ApplyEngagementButton.OnClick = function(Button) {
|
||||||
|
Button.Parent.CloseAllEach();
|
||||||
|
Button.Parent.CloseWindow();
|
||||||
|
local T = {
|
||||||
|
op = OP + 11,
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
}.bindenv(this);
|
||||||
|
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
|
||||||
|
SThis.AddChild(ApplyEngagementButton);
|
||||||
|
}.bindenv(this));
|
||||||
|
}
|
||||||
|
//等待举行婚礼
|
||||||
|
else if (MarryState == 2) {
|
||||||
|
EachManager.AddEachForNpc(20013, function(SThis) {
|
||||||
|
//关闭按钮
|
||||||
|
local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3);
|
||||||
|
ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img";
|
||||||
|
ApplyEngagementButton.IconIdx = 13;
|
||||||
|
ApplyEngagementButton.Str = "进入礼堂";
|
||||||
|
ApplyEngagementButton.OnClick = function(Button) {
|
||||||
|
Button.Parent.CloseAllEach();
|
||||||
|
Button.Parent.CloseWindow();
|
||||||
|
local T = {
|
||||||
|
op = OP + 15,
|
||||||
|
room = -1
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
}.bindenv(this);
|
||||||
|
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
|
||||||
|
SThis.AddChild(ApplyEngagementButton);
|
||||||
|
}.bindenv(this));
|
||||||
|
EachManager.AddEachForNpc(20014, function(SThis) {
|
||||||
|
//关闭按钮
|
||||||
|
local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3);
|
||||||
|
ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img";
|
||||||
|
ApplyEngagementButton.IconIdx = 14;
|
||||||
|
ApplyEngagementButton.Str = "离开礼堂";
|
||||||
|
ApplyEngagementButton.OnClick = function(Button) {
|
||||||
|
Button.Parent.CloseAllEach();
|
||||||
|
Button.Parent.CloseWindow();
|
||||||
|
local T = {
|
||||||
|
op = OP + 17
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
}.bindenv(this);
|
||||||
|
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
|
||||||
|
SThis.AddChild(ApplyEngagementButton);
|
||||||
|
}.bindenv(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//重选角色回调
|
||||||
|
function OnSetCharacter() {
|
||||||
|
CheckMarryState();
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
getroottable().rawdelete("MarrySystem_Obj");
|
||||||
|
|
||||||
|
function Lenheart_MarrySystem_Fun(obj) {
|
||||||
|
local RootTab = getroottable();
|
||||||
|
if (!RootTab.rawin("MarrySystem_Obj")) {
|
||||||
|
RootTab.rawset("MarrySystem_Obj", MarrySystemC());
|
||||||
|
} else {
|
||||||
|
RootTab["MarrySystem_Obj"].Proc(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getroottable()["LenheartFuncTab"].rawset("MarrySystemFuncN", Lenheart_MarrySystem_Fun);
|
||||||
|
|
||||||
|
|
||||||
|
// local asos = R_Utils.GetCharacByEqu(0, 0, [601550071, 601560067, 601570062, 601520061, 601500069, 601510068, 601530060, 601540069, 601580026, 101010035]);
|
||||||
|
|
||||||
|
// local asos = sq_CreateAICharacter(900);
|
||||||
|
// asos.setCurrentPos(sq_getMyCharacter().getXPos() + 100, sq_getMyCharacter().getYPos(), 0);
|
||||||
|
// sq_AddObject(sq_getMyCharacter(), asos, OBJECTTYPE_VIRTUALCHARACTER, false);
|
||||||
|
|
||||||
|
// local ItemObject = L_sq_GetItem(27675);
|
||||||
|
// // local ItemObject = L_sq_GetItem(27582);
|
||||||
|
// L_Sq_CallFunc(0x8265A0, "void", FFI_THISCALL, ["int","int","int"], L_Sq_GetObjectAddress(asos),ItemObject,0xFFFFFFFF);
|
||||||
|
|
@ -0,0 +1,202 @@
|
||||||
|
/*
|
||||||
|
文件名:MarrySystem_Preparation.nut
|
||||||
|
路径:Project/MarrySystem/MarrySystem_Preparation.nut
|
||||||
|
创建日期:2024-10-03 22:43
|
||||||
|
文件用途:准备婚礼窗口
|
||||||
|
*/
|
||||||
|
class MarrySystem_PreparationC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
Visible = false;
|
||||||
|
|
||||||
|
//包头
|
||||||
|
OP = 20078000;
|
||||||
|
|
||||||
|
//名字
|
||||||
|
Name1 = "测试角色名字";
|
||||||
|
Name2 = "测试角色名字";
|
||||||
|
|
||||||
|
//时间按钮
|
||||||
|
NowTimeBtn = null;
|
||||||
|
littleTimeBtn = null;
|
||||||
|
longTimeBtn = null;
|
||||||
|
//时间Flag
|
||||||
|
TimeFlag = 0;
|
||||||
|
|
||||||
|
//婚礼等级按钮
|
||||||
|
//普通
|
||||||
|
NormalBtn = null;
|
||||||
|
//高级
|
||||||
|
AdvancedBtn = null;
|
||||||
|
//豪华
|
||||||
|
LuxuryBtn = null;
|
||||||
|
//婚礼等级Flag
|
||||||
|
MarryLevelFlag = -1;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
//关闭按钮
|
||||||
|
local CloseButton = LenheartNewUI_BaseButton(244, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
|
CloseButton.OnClick = function() {
|
||||||
|
this.Visible = false;
|
||||||
|
}.bindenv(this);
|
||||||
|
Childrens.append(CloseButton);
|
||||||
|
|
||||||
|
|
||||||
|
NowTimeBtn = LenheartNewUI_SwitchButtonText(24, 138, "现在");
|
||||||
|
NowTimeBtn.ImgIndex = 358;
|
||||||
|
NowTimeBtn.SetTextPos(12, 2);
|
||||||
|
NowTimeBtn.Width = 50;
|
||||||
|
NowTimeBtn.Height = 16;
|
||||||
|
NowTimeBtn.OnClick = function() {
|
||||||
|
TimeFlag = 0;
|
||||||
|
}.bindenv(this);
|
||||||
|
NowTimeBtn.SetCallBackFunc(function(Button) {
|
||||||
|
if (TimeFlag == 0) Button.State = 1;
|
||||||
|
else Button.State = 0;
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(NowTimeBtn);
|
||||||
|
|
||||||
|
littleTimeBtn = LenheartNewUI_SwitchButtonText(96, 138, "20分钟");
|
||||||
|
littleTimeBtn.ImgIndex = 358;
|
||||||
|
littleTimeBtn.SetTextPos(12, 2);
|
||||||
|
littleTimeBtn.Width = 50;
|
||||||
|
littleTimeBtn.Height = 16;
|
||||||
|
littleTimeBtn.OnClick = function() {
|
||||||
|
TimeFlag = 1;
|
||||||
|
}.bindenv(this);
|
||||||
|
littleTimeBtn.SetCallBackFunc(function(Button) {
|
||||||
|
if (TimeFlag == 1) Button.State = 1;
|
||||||
|
else Button.State = 0;
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(littleTimeBtn);
|
||||||
|
|
||||||
|
longTimeBtn = LenheartNewUI_SwitchButtonText(174, 138, "30分钟");
|
||||||
|
longTimeBtn.ImgIndex = 358;
|
||||||
|
longTimeBtn.SetTextPos(12, 2);
|
||||||
|
longTimeBtn.Width = 50;
|
||||||
|
longTimeBtn.Height = 16;
|
||||||
|
longTimeBtn.OnClick = function() {
|
||||||
|
TimeFlag = 2;
|
||||||
|
}.bindenv(this);
|
||||||
|
longTimeBtn.SetCallBackFunc(function(Button) {
|
||||||
|
if (TimeFlag == 2) Button.State = 1;
|
||||||
|
else Button.State = 0;
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(longTimeBtn);
|
||||||
|
|
||||||
|
NormalBtn = LenheartNewUI_SwitchButton(28, 202);
|
||||||
|
NormalBtn.ImgPath = "interface2/wedding/weddingreservationpopupui.img";
|
||||||
|
NormalBtn.ImgIndex = 2;
|
||||||
|
NormalBtn.Width = 200;
|
||||||
|
NormalBtn.Height = 39;
|
||||||
|
NormalBtn.OnClick = function() {
|
||||||
|
MarryLevelFlag = 0;
|
||||||
|
}.bindenv(this);
|
||||||
|
NormalBtn.SetCallBackFunc(function(Button) {
|
||||||
|
if (MarryLevelFlag == 0) Button.State = 1;
|
||||||
|
else Button.State = 0;
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(NormalBtn);
|
||||||
|
|
||||||
|
AdvancedBtn = LenheartNewUI_SwitchButton(28, 242);
|
||||||
|
AdvancedBtn.ImgPath = "interface2/wedding/weddingreservationpopupui.img";
|
||||||
|
AdvancedBtn.ImgIndex = 6;
|
||||||
|
AdvancedBtn.Width = 200;
|
||||||
|
AdvancedBtn.Height = 39;
|
||||||
|
AdvancedBtn.OnClick = function() {
|
||||||
|
MarryLevelFlag = 1;
|
||||||
|
}.bindenv(this);
|
||||||
|
AdvancedBtn.SetCallBackFunc(function(Button) {
|
||||||
|
if (MarryLevelFlag == 1) Button.State = 1;
|
||||||
|
else Button.State = 0;
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(AdvancedBtn);
|
||||||
|
|
||||||
|
LuxuryBtn = LenheartNewUI_SwitchButton(28, 282);
|
||||||
|
LuxuryBtn.ImgPath = "interface2/wedding/weddingreservationpopupui.img";
|
||||||
|
LuxuryBtn.ImgIndex = 10;
|
||||||
|
LuxuryBtn.Width = 200;
|
||||||
|
LuxuryBtn.Height = 39;
|
||||||
|
LuxuryBtn.OnClick = function() {
|
||||||
|
MarryLevelFlag = 2;
|
||||||
|
}.bindenv(this);
|
||||||
|
LuxuryBtn.SetCallBackFunc(function(Button) {
|
||||||
|
if (MarryLevelFlag == 2) Button.State = 1;
|
||||||
|
else Button.State = 0;
|
||||||
|
}.bindenv(this));
|
||||||
|
AddChild(LuxuryBtn);
|
||||||
|
|
||||||
|
//确认按钮
|
||||||
|
local ConfirmButton = LenheartNewUI_ButtonText(55, 338, 15, " 确 认");
|
||||||
|
ConfirmButton.DWidth = 18;
|
||||||
|
ConfirmButton.Width = 74;
|
||||||
|
ConfirmButton.SetTextOffset(-4, 1);
|
||||||
|
ConfirmButton.OnClick = function() {
|
||||||
|
local T = {
|
||||||
|
op = OP + 13,
|
||||||
|
Time = TimeFlag,
|
||||||
|
Level = MarryLevelFlag
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
R_Utils.PlaySound("BUTTON_06");
|
||||||
|
CloseWindow();
|
||||||
|
}.bindenv(this);
|
||||||
|
AddChild(ConfirmButton);
|
||||||
|
|
||||||
|
|
||||||
|
//取消按钮
|
||||||
|
local CancelButton = LenheartNewUI_ButtonText(131, 338, 15, " 取 消");
|
||||||
|
CancelButton.DWidth = 18;
|
||||||
|
CancelButton.Width = 74;
|
||||||
|
CancelButton.SetTextOffset(-4, 1);
|
||||||
|
CancelButton.OnClick = function() {
|
||||||
|
CloseWindow();
|
||||||
|
}.bindenv(this);
|
||||||
|
AddChild(CancelButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
//标题栏
|
||||||
|
L_sq_DrawButton(X - 2, Y, 252, "interface/lenheartwindowcommon.img", 609, 2, 7);
|
||||||
|
//绘制窗口名字
|
||||||
|
L_sq_DrawCode("申请举办婚礼", X + 95, Y + 4, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||||
|
//Item信息框一般为211的宽度
|
||||||
|
L_sq_DrawWindow(X, Y + 16, 240, 316, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||||
|
|
||||||
|
//绘制背景
|
||||||
|
L_sq_DrawImg("interface2/wedding/weddingreservationpopupui.img", 0, X + 16, Y + 36);
|
||||||
|
//绘制爱心
|
||||||
|
L_sq_DrawImg("interface2/wedding/weddingreservationpopupui.img", 1, X + 120, Y + 80);
|
||||||
|
//绘制姓名
|
||||||
|
L_sq_DrawCode(Name1, X + 110 - LenheartTextClass.GetStringLength(Name1), Y + 79, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||||
|
L_sq_DrawCode(Name2, X + 146, Y + 79, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
getroottable().rawdelete("MarrySystem_Obj");
|
||||||
|
|
@ -0,0 +1,112 @@
|
||||||
|
/*
|
||||||
|
文件名:MarrySystem_Request.nut
|
||||||
|
路径:Project/MarrySystem/MarrySystem_Request.nut
|
||||||
|
创建日期:2024-10-01 00:03
|
||||||
|
文件用途:结婚请求窗口
|
||||||
|
*/
|
||||||
|
class MarrySystem_RequestC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//包头
|
||||||
|
OP = 20078000;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
Visible = false;
|
||||||
|
|
||||||
|
InputObject = null;
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
//关闭按钮
|
||||||
|
local CloseButton = LenheartNewUI_BaseButton(312, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
|
CloseButton.OnClick = function() {
|
||||||
|
this.Visible = false;
|
||||||
|
}.bindenv(this);
|
||||||
|
Childrens.append(CloseButton);
|
||||||
|
|
||||||
|
|
||||||
|
InputObject = LenheartNewUI_BaseInput(83, 90, 160, 20);
|
||||||
|
AddChild(InputObject);
|
||||||
|
|
||||||
|
//确认按钮
|
||||||
|
local ConfirmButton = LenheartNewUI_ButtonText(83, 120, 15, "确认申请");
|
||||||
|
ConfirmButton.DWidth = 18;
|
||||||
|
ConfirmButton.Width = 74;
|
||||||
|
ConfirmButton.SetTextOffset(-4, 1);
|
||||||
|
ConfirmButton.OnClick = function() {
|
||||||
|
local T = {
|
||||||
|
op = OP + 3,
|
||||||
|
Name = InputObject.str,
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
R_Utils.PlaySound("BUTTON_06");
|
||||||
|
CloseWindow();
|
||||||
|
}.bindenv(this);
|
||||||
|
AddChild(ConfirmButton);
|
||||||
|
|
||||||
|
|
||||||
|
//取消按钮
|
||||||
|
local CancelButton = LenheartNewUI_ButtonText(174, 120, 15, " 取 消");
|
||||||
|
CancelButton.DWidth = 18;
|
||||||
|
CancelButton.Width = 74;
|
||||||
|
CancelButton.SetTextOffset(-4, 1);
|
||||||
|
CancelButton.OnClick = function() {
|
||||||
|
CloseWindow();
|
||||||
|
}.bindenv(this);
|
||||||
|
AddChild(CancelButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
//绘制窗口底
|
||||||
|
// L_sq_DrawWindow(X, Y, 347, 160, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||||
|
|
||||||
|
//标题栏
|
||||||
|
L_sq_DrawButton(X - 1, Y, 320, "interface/lenheartwindowcommon.img", 609, 2, 7);
|
||||||
|
//绘制窗口名字
|
||||||
|
L_sq_DrawCode("申请订婚", X + 142, Y + 4, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||||
|
//Item信息框一般为211的宽度
|
||||||
|
L_sq_DrawWindow(X - 1, Y + 16, 312, 120, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||||
|
|
||||||
|
//绘制窗口
|
||||||
|
// L_sq_DrawImg("marrysystem.img", 0, X, Y);
|
||||||
|
|
||||||
|
local Str = "请输入你想要与之订婚的角色名。";
|
||||||
|
//绘制文字
|
||||||
|
L_sq_DrawCode(Str, X + 80, Y + 50, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
local Str = "(直接点击想要订婚的角色,可自动输入名称。)";
|
||||||
|
//绘制文字
|
||||||
|
L_sq_DrawCode(Str, X + 53, Y + 66, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
|
||||||
|
local Str = L_Sq_GetPlayerEachName();
|
||||||
|
if (Str.len() > 0 && InputObject.str.len() == 0) {
|
||||||
|
// InputObject.SetStr(Str);
|
||||||
|
InputObject.str = Str;
|
||||||
|
InputObject.SetStr(Str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
getroottable().rawdelete("MarrySystem_Obj");
|
||||||
|
|
@ -0,0 +1,112 @@
|
||||||
|
/*
|
||||||
|
文件名:MarrySystem_Response.nut
|
||||||
|
路径:Project/MarrySystem/MarrySystem_Response.nut
|
||||||
|
创建日期:2024-10-01 10:32
|
||||||
|
文件用途:结婚答复
|
||||||
|
*/
|
||||||
|
class MarrySystem_ResponseC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
Visible = false;
|
||||||
|
|
||||||
|
//包头
|
||||||
|
OP = 20078000;
|
||||||
|
|
||||||
|
//申请人
|
||||||
|
applicantName = "瓜瓜";
|
||||||
|
//申请人CID
|
||||||
|
applicantCid = -1;
|
||||||
|
//申请人UID
|
||||||
|
applicantUid = -1;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
// //关闭按钮
|
||||||
|
// local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
|
// CloseButton.OnClick = function() {
|
||||||
|
// this.Visible = false;
|
||||||
|
// }.bindenv(this);
|
||||||
|
// Childrens.append(CloseButton);
|
||||||
|
|
||||||
|
//确认按钮
|
||||||
|
local ConfirmButton = LenheartNewUI_ButtonText(83, 120, 15, "同意请求");
|
||||||
|
ConfirmButton.DWidth = 18;
|
||||||
|
ConfirmButton.Width = 74;
|
||||||
|
ConfirmButton.SetTextOffset(-4, 1);
|
||||||
|
ConfirmButton.OnClick = function() {
|
||||||
|
local T = {
|
||||||
|
op = OP + 5,
|
||||||
|
applicantCid = this.applicantCid,
|
||||||
|
applicantUid = this.applicantUid,
|
||||||
|
Flag = 1
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
R_Utils.PlaySound("BUTTON_06");
|
||||||
|
CloseWindow();
|
||||||
|
}.bindenv(this);
|
||||||
|
AddChild(ConfirmButton);
|
||||||
|
|
||||||
|
|
||||||
|
//取消按钮
|
||||||
|
local CancelButton = LenheartNewUI_ButtonText(174, 120, 15, " 拒 绝");
|
||||||
|
CancelButton.DWidth = 18;
|
||||||
|
CancelButton.Width = 74;
|
||||||
|
CancelButton.SetTextOffset(-4, 1);
|
||||||
|
CancelButton.OnClick = function() {
|
||||||
|
local T = {
|
||||||
|
op = OP + 5,
|
||||||
|
applicantCid = this.applicantCid,
|
||||||
|
applicantUid = this.applicantUid,
|
||||||
|
Flag = 0
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
R_Utils.PlaySound("BUTTON_07");
|
||||||
|
CloseWindow();
|
||||||
|
}.bindenv(this);
|
||||||
|
AddChild(CancelButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
|
||||||
|
//标题栏
|
||||||
|
L_sq_DrawButton(X - 1, Y, 320, "interface/lenheartwindowcommon.img", 609, 2, 7);
|
||||||
|
//绘制窗口名字
|
||||||
|
L_sq_DrawCode("申请订婚", X + 142, Y + 4, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||||
|
//Item信息框一般为211的宽度
|
||||||
|
L_sq_DrawWindow(X - 1, Y + 16, 312, 120, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||||
|
|
||||||
|
|
||||||
|
//绘制窗口
|
||||||
|
L_sq_DrawImg("interface2/wedding/common.img", 8, X + 64, Y + 34);
|
||||||
|
|
||||||
|
local Str = "玩家 [" + applicantName + "] 想要与您订婚,是否同意?"
|
||||||
|
L_sq_DrawCode(Str, X + 80 - LenheartTextClass.GetStringLength(applicantName) / 2, Y + 88, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
getroottable().rawdelete("MarrySystem_Obj");
|
||||||
|
|
@ -125,6 +125,7 @@ function Sq_DrawMiniMapUI(obj) {
|
||||||
getroottable().rawdelete("RepairWorldMap_Obj");
|
getroottable().rawdelete("RepairWorldMap_Obj");
|
||||||
|
|
||||||
function Lenheart_RepairWorldMap_Fun(obj) {
|
function Lenheart_RepairWorldMap_Fun(obj) {
|
||||||
|
return;
|
||||||
local RootTab = getroottable();
|
local RootTab = getroottable();
|
||||||
if (!RootTab.rawin("RepairWorldMap_Obj")) {
|
if (!RootTab.rawin("RepairWorldMap_Obj")) {
|
||||||
RootTab.rawset("RepairWorldMap_Obj", LenheartNewUI_CreateWindow(RepairWorldMapC, "世界地图修补", 230, 0, 30, 30, 0));
|
RootTab.rawset("RepairWorldMap_Obj", LenheartNewUI_CreateWindow(RepairWorldMapC, "世界地图修补", 230, 0, 30, 30, 0));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,579 @@
|
||||||
|
/*
|
||||||
|
文件名:SkinHub.nut
|
||||||
|
路径:Project/SkinHub/SkinHub.nut
|
||||||
|
创建日期:2024-09-27 22:44
|
||||||
|
文件用途:皮肤仓库
|
||||||
|
*/
|
||||||
|
|
||||||
|
class DamageFontObjectC {
|
||||||
|
X = 0;
|
||||||
|
Y = 0;
|
||||||
|
IDX = null;
|
||||||
|
UIdx = null;
|
||||||
|
gName = null;
|
||||||
|
gImgPath = null;
|
||||||
|
gMaxNumArr = null;
|
||||||
|
ID = null;
|
||||||
|
Parent = null;
|
||||||
|
ItemId = null;
|
||||||
|
|
||||||
|
constructor(ItemId, gName, gImgPath, gMaxNumArr, gId, Parent) {
|
||||||
|
this.gName = gName;
|
||||||
|
this.gImgPath = gImgPath;
|
||||||
|
this.gMaxNumArr = gMaxNumArr;
|
||||||
|
this.gMaxNumArr = gMaxNumArr;
|
||||||
|
this.ID = gId;
|
||||||
|
this.Parent = Parent;
|
||||||
|
this.ItemId = ItemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制
|
||||||
|
function Show(obj, x, y) {
|
||||||
|
X = x;
|
||||||
|
Y = y;
|
||||||
|
|
||||||
|
//绘制底
|
||||||
|
L_sq_DrawImg("interface2/skinstorage/slots.img", 0, x, y);
|
||||||
|
L_Sq_DrawItem(X + 22, Y + 23, ID, 1, 0, 0, 0);
|
||||||
|
//绘制盖子
|
||||||
|
L_sq_DrawImg("interface2/skinstorage/slots.img", 2, x, y);
|
||||||
|
//
|
||||||
|
L_sq_DrawCode(gName, X + 84, Y + 23, sq_RGBA(178, 155, 113, 250), 0, 1);
|
||||||
|
L_sq_DrawCode("Yosin皮肤字体", X + 84, Y + 40, sq_RGBA(255, 177, 0, 250), 0, 1);
|
||||||
|
L_sq_DrawCode("无限制使用", X + 84, Y + 55, sq_RGBA(255, 85, 0, 250), 0, 1);
|
||||||
|
|
||||||
|
//绘制选中效果
|
||||||
|
if (Parent.FocusPrintIdx == ItemId) L_sq_DrawImg("interface2/skinstorage/slots.img", 4, x, y);
|
||||||
|
//绘制应用中
|
||||||
|
if (Parent.NowDamageSkinIndex == ItemId) L_sq_DrawImg("interface2/skinstorage/slots.img", 23, x + 290, y + 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SkinHubC extends LenheartNewUI_Windows {
|
||||||
|
//调试模式
|
||||||
|
// DeBugMode = true;
|
||||||
|
|
||||||
|
//不是窗口
|
||||||
|
// NoWindow = true;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
Visible = false;
|
||||||
|
|
||||||
|
|
||||||
|
//当前字体皮肤编号
|
||||||
|
NowDamageSkinIndex = null;
|
||||||
|
//拥有的字体列表
|
||||||
|
HasDamageSkinList = null;
|
||||||
|
//字体皮肤数据
|
||||||
|
DamageSkinList = null;
|
||||||
|
//数字伤害类型
|
||||||
|
RealType = null;
|
||||||
|
//当前页面
|
||||||
|
NowPage = 0;
|
||||||
|
|
||||||
|
//最大伤害数字
|
||||||
|
MaxDamageNumber = 99999999;
|
||||||
|
|
||||||
|
//显示对象
|
||||||
|
FocusPrintIdx = 561320400;
|
||||||
|
FocusPrintType = 0;
|
||||||
|
//Nut白字倍率
|
||||||
|
NutWRate = 0;
|
||||||
|
|
||||||
|
FontIdx = 0;
|
||||||
|
MapBaseXPos = 0;
|
||||||
|
MapBaseYPos = 0;
|
||||||
|
DamageFontArray = null;
|
||||||
|
|
||||||
|
//获取字体列表信息
|
||||||
|
function GetFontList() {
|
||||||
|
local T = {
|
||||||
|
op = 20076005,
|
||||||
|
}
|
||||||
|
SendPack(T);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取字体列表信息回调
|
||||||
|
function GetFontListCallBack(Chunk) {
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
NowDamageSkinIndex = Jso.damagefontCurrent;
|
||||||
|
InitDamageFont(NowDamageSkinIndex);
|
||||||
|
FocusPrintIdx = Jso.damagefontCurrent;
|
||||||
|
foreach(value in Jso.damagefont) {
|
||||||
|
DamageSkinList[value].IsHave = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//基础信息包回调
|
||||||
|
function GetBaseInfoCallBack(Chunk) {
|
||||||
|
DamageSkinList = {};
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
local Info = Jso.ZipS;
|
||||||
|
Info = Json.Decode(L_sq_Dezlib(Info)).info;
|
||||||
|
foreach(Idx, value in Info) {
|
||||||
|
value.IsHave <- false;
|
||||||
|
DamageSkinList.rawset(Idx.tointeger(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化伤害字体
|
||||||
|
function InitDamageFont(Idx) {
|
||||||
|
if (Idx == null) {
|
||||||
|
for (local i = 0; i< 7; i++) {
|
||||||
|
L_sq_IntiNumberDraw("common/etc/damagefontskin/damagefont00.img", 0 + (i * 10), i);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (local i = 0; i< 7; i++) {
|
||||||
|
L_sq_IntiNumberDraw(DamageSkinList[Idx].gImgPath, 0 + (i * 10), i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化数字伤害类型
|
||||||
|
function InitRealType() {
|
||||||
|
RealType = [0, 5, 1, 5, 2, 5, 1, 2, 3, 5, 4, 5, 3, 5, 4, 5, 0, 5, 4, 5, 2, 5, 4];
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置NUT白字
|
||||||
|
function SetNutRate() {
|
||||||
|
// local allRate = 1.0;
|
||||||
|
// for (local i = 1; i < 41; i++) {
|
||||||
|
// allRate = allRate * (sq_GetIntData(obj, 169, i) / 100).tofloat();
|
||||||
|
// }
|
||||||
|
// for (local w = 1; w < 21; w++) {
|
||||||
|
// allRate = allRate * (sq_GetIntData(obj, 174, w) / 100).tofloat();
|
||||||
|
// }
|
||||||
|
NutWRate = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置地图原点
|
||||||
|
function SetMapBasePos(obj) {
|
||||||
|
local objectManager = obj.getObjectManager();
|
||||||
|
if (!objectManager) return;
|
||||||
|
MapBaseXPos = objectManager.getFieldXPos(0, ENUM_DRAWLAYER_NORMAL);
|
||||||
|
MapBaseYPos = objectManager.getFieldYPos(0, 0, ENUM_DRAWLAYER_NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
Childrens = [];
|
||||||
|
|
||||||
|
DamageFontArray = {};
|
||||||
|
DamageSkinList = {};
|
||||||
|
HasDamageSkinList = [];
|
||||||
|
|
||||||
|
local T = {
|
||||||
|
gIdx = 0, //伤害字体排列编号
|
||||||
|
gName = "默认伤害字体", //伤害字体名称
|
||||||
|
gImgPath = "common/etc/damagefontskin/damagefont00.img", //Img路径
|
||||||
|
gMaxNumArr = [73, 72], //普通999帧数数组
|
||||||
|
gKeyMaxNumArr = [71, 70], //暴击999帧数数组
|
||||||
|
itemId = 561320400, //道具ID
|
||||||
|
IsHave = true
|
||||||
|
}
|
||||||
|
DamageSkinList.rawset(561320400, T);
|
||||||
|
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
|
||||||
|
|
||||||
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
|
Pack_Control.rawset(20076006, GetFontListCallBack.bindenv(this));
|
||||||
|
Pack_Control.rawset(20076010, GetBaseInfoCallBack.bindenv(this));
|
||||||
|
PushDamageFontDataFuncTab.rawset("SkinHub", PushDamageFontArray.bindenv(this));
|
||||||
|
|
||||||
|
//初始化伤害类型
|
||||||
|
InitRealType();
|
||||||
|
//初始化伤害字体
|
||||||
|
InitDamageFont(NowDamageSkinIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
//关闭按钮
|
||||||
|
local CloseButton = LenheartNewUI_BaseButton(765, 2, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
|
CloseButton.OnClick = function() {
|
||||||
|
this.Visible = false;
|
||||||
|
}.bindenv(this);
|
||||||
|
Childrens.append(CloseButton);
|
||||||
|
|
||||||
|
|
||||||
|
for (local i = 0; i< 5; i++) {
|
||||||
|
//激活按钮
|
||||||
|
local ActiveButton = LenheartNewUI_ButtonText(700, 140 + (i * 85), 15, "应 用");
|
||||||
|
ActiveButton.Data = i;
|
||||||
|
ActiveButton.SetFrame(null, 172);
|
||||||
|
ActiveButton.SetTextOffset(-3, 1);
|
||||||
|
ActiveButton.OnClickEx = function(Button) {
|
||||||
|
local T = {
|
||||||
|
op = 20076007,
|
||||||
|
itemId = HasDamageSkinList[Button.Data],
|
||||||
|
type = 0
|
||||||
|
}
|
||||||
|
SendPackEx(T);
|
||||||
|
NowDamageSkinIndex = HasDamageSkinList[Button.Data];
|
||||||
|
FocusPrintIdx = HasDamageSkinList[Button.Data];
|
||||||
|
InitDamageFont(HasDamageSkinList[Button.Data]);
|
||||||
|
}.bindenv(this);
|
||||||
|
ActiveButton.SetCallBackFunc(function(Button) {
|
||||||
|
if (Button.Data >= (HasDamageSkinList.len())) {
|
||||||
|
Button.Visible = false;
|
||||||
|
} else {
|
||||||
|
Button.Visible = true;
|
||||||
|
}
|
||||||
|
}.bindenv(this))
|
||||||
|
AddChild(ActiveButton);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//测试伤害按钮
|
||||||
|
local TestButton = LenheartNewUI_ButtonText(10, 536, 15, "测试字体");
|
||||||
|
TestButton.SetFrame(null, 172);
|
||||||
|
TestButton.SetTextOffset(-7, 1);
|
||||||
|
TestButton.OnClickEx = function(Button) {
|
||||||
|
PushDamageFontArray(0x1AB7CDC, 400, 300, 0, Clock(), FocusPrintType, 0, 0);
|
||||||
|
}.bindenv(this);
|
||||||
|
TestButton.SetCallBackFunc(function(Button) {
|
||||||
|
if (Button.isInRect) {
|
||||||
|
L_sq_DrawWindow(X + 10, Y + 500, 160, 12, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||||
|
L_sq_DrawCode("按下[空格键]以测试伤害数字。", X + 18, Y + 512, sq_RGBA(178, 155, 113, 250), 0, 1);
|
||||||
|
}
|
||||||
|
}.bindenv(this))
|
||||||
|
|
||||||
|
AddChild(TestButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制主界面
|
||||||
|
function DrawMain(obj) {
|
||||||
|
//绘制窗口
|
||||||
|
L_sq_DrawImg("interface2/skinstorage/skinstorage.img", 0, X, Y);
|
||||||
|
|
||||||
|
//绘制字体排列窗口
|
||||||
|
L_sq_DrawImg("interface2/skinstorage/skinstorage.img", 5, X + 421 - 9, Y + 108 - 67);
|
||||||
|
//总览
|
||||||
|
L_sq_DrawImg("interface2/skinstorage/tab/tab_summary.img", 3, X + 421 - 8, Y + 46 - 8);
|
||||||
|
//边框
|
||||||
|
L_sq_DrawImg("interface2/skinstorage/tab/tab_partyframe.img", 3, X + 487 - 8, Y + 46 - 8);
|
||||||
|
//伤害字体
|
||||||
|
L_sq_DrawImg("interface2/skinstorage/tab/tab_damagefonts.img", 2, X + 533 + 4, Y + 42 - 3);
|
||||||
|
//觉醒插图
|
||||||
|
L_sq_DrawImg("interface2/skinstorage/tab/tab_cutscene.img", 3, X + 609 - 7, Y + 52 - 14);
|
||||||
|
//表情
|
||||||
|
L_sq_DrawImg("interface2/skinstorage/tab/tab_instantemoticon.img", 3, X + 674 - 16, Y + 49 - 11);
|
||||||
|
//表情
|
||||||
|
L_sq_DrawImg("interface2/skinstorage/tab/tab_weaponlook.img", 3, X + 722 - 7, Y + 55 - 17);
|
||||||
|
|
||||||
|
|
||||||
|
L_sq_DrawCode("伤害字体类型: " + FocusPrintType, X + 84, Y + 542, sq_RGBA(178, 155, 113, 250), 0, 1);
|
||||||
|
|
||||||
|
local RealDrawPos = 0;
|
||||||
|
HasDamageSkinList = [];
|
||||||
|
foreach(Pos, v in DamageSkinList) {
|
||||||
|
//如果拥有字体
|
||||||
|
if (v.IsHave) {
|
||||||
|
HasDamageSkinList.append(v.itemId);
|
||||||
|
local Yoffset = ((RealDrawPos + NowPage) * 85);
|
||||||
|
RealDrawPos++;
|
||||||
|
if (Yoffset > 400 || Yoffset< 0) continue;
|
||||||
|
local Dobj = DamageFontObjectC(v.itemId, v.gName, v.gImgPath, v.gMaxNumArr, v.itemId, this);
|
||||||
|
Dobj.Show(obj, X + 425, Y + 114 + Yoffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//绘制页数
|
||||||
|
local Page = (abs(NowPage) + 1) + " / " + (abs(HasDamageSkinList.len() - 5) + 1);
|
||||||
|
L_sq_DrawCode(Page, X + 586 + LenheartTextClass.GetStringLength(Page) / 2, Y + 537, sq_RGBA(150, 255, 30, 250), 0, 1);
|
||||||
|
|
||||||
|
local chr = sq_GetCNRDObjectToSQRCharacter(obj);
|
||||||
|
local charAni = chr.sq_GetStayAni();
|
||||||
|
sq_AnimationProc(charAni);
|
||||||
|
sq_drawCurrentFrame(charAni, X + 210, Y + 364, false);
|
||||||
|
|
||||||
|
local MonsterAni = T_DrawDynamicAni_Fx(obj, "monster/goblin/animation_goblin2/down.ani", X + 360, Y + 364, "伤害字体哥布林倒地");
|
||||||
|
local NeArray = TryGetArry(1);
|
||||||
|
if (sq_GetCurrentTime(MonsterAni) >= 1000 && NeArray.len() == 0) {
|
||||||
|
local Timer = Clock();
|
||||||
|
local T = {
|
||||||
|
gIdx = "演示字体" + FontIdx,
|
||||||
|
XPos = X + 166,
|
||||||
|
YPos = Y + 230,
|
||||||
|
DamageNum = 999999999,
|
||||||
|
Type = 5,
|
||||||
|
TimeObj = Timer,
|
||||||
|
isKeyHit = false,
|
||||||
|
}
|
||||||
|
NeArray.append(T);
|
||||||
|
DamageFontArray.rawset(1, NeArray);
|
||||||
|
sq_Rewind(MonsterAni);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function TryGetArry(Type) {
|
||||||
|
if (DamageFontArray.rawin(Type)) return DamageFontArray[Type];
|
||||||
|
else return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//将伤害字体数据Push进数组
|
||||||
|
function PushDamageFontArray(ObjAddress, X, Y, Z, Value, Type, A1, A2) {
|
||||||
|
local Timer = Clock();
|
||||||
|
local gRealType;
|
||||||
|
if (Type <= 7) gRealType = RealType[Type];
|
||||||
|
else gRealType = RealType[((Type - 7) % 16) + 7];
|
||||||
|
//暴击
|
||||||
|
local KeyHit = false;
|
||||||
|
if (Type == 17) KeyHit = true;
|
||||||
|
//是扣血还是回血
|
||||||
|
if (Type == 7) {
|
||||||
|
if (Value< 0) gRealType = 4;
|
||||||
|
}
|
||||||
|
if (Type == 4) {
|
||||||
|
if (Value< 0) gRealType = 0;
|
||||||
|
}
|
||||||
|
if (Type == 1 || Type == 17) {
|
||||||
|
//记录总伤害
|
||||||
|
local oldDamageNum = Value;
|
||||||
|
//计算我的真是伤害
|
||||||
|
Value = (Value / NutWRate).tointeger();
|
||||||
|
//减去真实伤害 就是nut伤害
|
||||||
|
local newDamageNum = oldDamageNum - Value;
|
||||||
|
//如果有Nut伤害存在
|
||||||
|
if (newDamageNum > 0) {
|
||||||
|
local NeArray = TryGetArry(Type);
|
||||||
|
local Timer = Clock();
|
||||||
|
local T = {
|
||||||
|
gIdx = ObjAddress + FontIdx,
|
||||||
|
XPos = X,
|
||||||
|
YPos = Y - Z - (NeArray.len() * 16),
|
||||||
|
DamageNum = Value,
|
||||||
|
Type = 0,
|
||||||
|
TimeObj = Timer,
|
||||||
|
isKeyHit = KeyHit,
|
||||||
|
}
|
||||||
|
NeArray.append(T);
|
||||||
|
DamageFontArray.rawset(Type, NeArray);
|
||||||
|
++FontIdx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local NeArray = TryGetArry(Type);
|
||||||
|
local T = {
|
||||||
|
gIdx = ObjAddress + FontIdx,
|
||||||
|
XPos = X + sq_getRandom(-15, 15),
|
||||||
|
YPos = Y - Z + sq_getRandom(-20, 20),
|
||||||
|
DamageNum = Value,
|
||||||
|
Type = gRealType,
|
||||||
|
TimeObj = Timer,
|
||||||
|
isKeyHit = KeyHit,
|
||||||
|
}
|
||||||
|
NeArray.append(T);
|
||||||
|
DamageFontArray.rawset(Type, NeArray);
|
||||||
|
++FontIdx;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function DrawFontImg(X, Y, Type, DamageNum, Time, isKeyHit) {
|
||||||
|
local rate = sq_GetUniformVelocity(60, 100, Time, 100);
|
||||||
|
rate = rate.tofloat() / 100.0;
|
||||||
|
//如果暴击
|
||||||
|
if (isKeyHit) {
|
||||||
|
rate *= 1.3;
|
||||||
|
Type = 4;
|
||||||
|
}
|
||||||
|
//白字
|
||||||
|
if (Type == 0) {
|
||||||
|
rate *= 0.7;
|
||||||
|
Y += 60;
|
||||||
|
}
|
||||||
|
local UpOffset = 0;
|
||||||
|
local Alpha = 0;
|
||||||
|
//超过0.3秒开始飘
|
||||||
|
if (Time >= 300) {
|
||||||
|
UpOffset = sq_GetUniformVelocity(0, 15, Time - 300, 500);
|
||||||
|
}
|
||||||
|
//超过0.3秒开始飘
|
||||||
|
if (Time >= 800) {
|
||||||
|
UpOffset = sq_GetAccel(15, 100, Time - 800, 500, true);
|
||||||
|
Alpha = sq_GetUniformVelocity(0, 250, Time - 800, 500);
|
||||||
|
}
|
||||||
|
if (DamageNum > MaxDamageNumber) {
|
||||||
|
if (isKeyHit) {
|
||||||
|
foreach(imgpos in DamageSkinList[FocusPrintIdx].gKeyMaxNumArr) {
|
||||||
|
L_sq_DrawImg(DamageSkinList[FocusPrintIdx].gImgPath, imgpos, X + ((30 * (MaxDamageNumber.tostring().len())) - ((20 * (MaxDamageNumber.tostring().len())) * rate)), Y + (20 - (20 * rate)) - UpOffset, 0, sq_RGBA(255, 255, 255, 255 - Alpha), rate, rate);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
foreach(imgpos in DamageSkinList[FocusPrintIdx].gMaxNumArr) {
|
||||||
|
L_sq_DrawImg(DamageSkinList[FocusPrintIdx].gImgPath, imgpos, X + ((30 * (MaxDamageNumber.tostring().len())) - ((20 * (MaxDamageNumber.tostring().len())) * rate)), Y + (20 - (20 * rate)) - UpOffset, 0, sq_RGBA(255, 255, 255, 255 - Alpha), rate, rate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// L_sq_DrawNumber(X + ((30 * (DamageNum.tostring().len())) - ((20 * (DamageNum.tostring().len())) * rate)), Y + (20 - (20 * rate)) - UpOffset, sq_RGBA(255, 255, 255, 255 - Alpha), rate, rate, Type, 18 * rate, 6, sq_Abs(DamageNum));
|
||||||
|
L_sq_DrawNumber(X, Y - UpOffset, sq_RGBA(255, 255, 255, 255 - Alpha), rate, rate, Type, sq_Abs(DamageNum));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//伤害字体绘制
|
||||||
|
function DrawFont(obj) {
|
||||||
|
foreach(Type, FontArrayObject in DamageFontArray) {
|
||||||
|
if (Type == 0) continue;
|
||||||
|
for (local i = 0; i< FontArrayObject.len(); i++) {
|
||||||
|
local FontObject = FontArrayObject[i];
|
||||||
|
if (FontObject) {
|
||||||
|
local Timer = FontObject.TimeObj;
|
||||||
|
if (Timer) {
|
||||||
|
local Time = Clock() - Timer;
|
||||||
|
if (Time >= 1300) {
|
||||||
|
FontObject.TimeObj = null;
|
||||||
|
FontArrayObject.remove(i);
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
DrawFontImg(FontObject.XPos - MapBaseXPos, FontObject.YPos - MapBaseYPos, FontObject.Type, FontObject.DamageNum, Time, FontObject.isKeyHit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//白字
|
||||||
|
foreach(Type, FontArrayObject in DamageFontArray) {
|
||||||
|
if (Type != 0) break;
|
||||||
|
for (local i = 0; i< FontArrayObject.len(); i++) {
|
||||||
|
local FontObject = FontArrayObject[i];
|
||||||
|
if (FontObject) {
|
||||||
|
local Timer = FontObject.TimeObj;
|
||||||
|
if (Timer) {
|
||||||
|
local Time = Clock() - Timer;
|
||||||
|
if (Time >= 1100) {
|
||||||
|
FontObject.TimeObj = null;
|
||||||
|
FontArrayObject.remove(i);
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
DrawFontImg(FontObject.XPos - MapBaseXPos, FontObject.YPos - MapBaseYPos, FontObject.Type, FontObject.DamageNum, Time, FontObject.isKeyHit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function T_DrawDynamicAni_Fx(obj, aniFileName, x, y, aniname) {
|
||||||
|
local ani = obj.getVar().GetAnimationMap(aniname, aniFileName);
|
||||||
|
ani.setImageRateFromOriginal(-1.0, 1.0);
|
||||||
|
sq_AnimationProc(ani);
|
||||||
|
sq_drawCurrentFrame(ani, x, y, true);
|
||||||
|
return ani;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show(obj) {
|
||||||
|
DrawMain(obj);
|
||||||
|
LenheartNewUI_Windows.Show(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
function TopShow(obj) {
|
||||||
|
//绘制字体
|
||||||
|
DrawFont(obj);
|
||||||
|
|
||||||
|
|
||||||
|
if (MousePosFlag == 1) {
|
||||||
|
L_sq_DrawWindow(X + 60, Y + 500, 160, 12, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||||
|
L_sq_DrawCode("使用鼠标滚轮以改变字体类型。", X + 68, Y + 512, sq_RGBA(178, 155, 113, 250), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MousePosFlag = 0;
|
||||||
|
//override
|
||||||
|
//鼠标滚轮事件回调
|
||||||
|
function OnMouseWheel(Flag, MousePos_X, MousePos_Y) {
|
||||||
|
MousePos_X -= X;
|
||||||
|
MousePos_Y -= Y;
|
||||||
|
|
||||||
|
|
||||||
|
//鼠标在滚动字体类型区域
|
||||||
|
if (MousePosFlag == 1) {
|
||||||
|
if (Flag) {
|
||||||
|
if (FocusPrintType< 17) FocusPrintType++;
|
||||||
|
} else {
|
||||||
|
if (FocusPrintType > 0) FocusPrintType--;
|
||||||
|
}
|
||||||
|
} else if (MousePosFlag == 2) {
|
||||||
|
if (Flag) {
|
||||||
|
if (NowPage< 0) NowPage++;
|
||||||
|
} else {
|
||||||
|
if ((HasDamageSkinList.len()) > abs(NowPage - 5)) NowPage--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//调用原生方法
|
||||||
|
LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
//override
|
||||||
|
function OnMouseProc(Flag, MousePos_X, MousePos_Y) {
|
||||||
|
//调用原生方法
|
||||||
|
LenheartNewUI_Windows.OnMouseProc(Flag, MousePos_X, MousePos_Y);
|
||||||
|
|
||||||
|
MousePos_X -= X;
|
||||||
|
MousePos_Y -= Y;
|
||||||
|
|
||||||
|
|
||||||
|
//鼠标在滚动字体类型区域
|
||||||
|
if (MousePos_X >= 82 && MousePos_Y >= 538 && MousePos_X <= 188 && MousePos_Y <= 558) {
|
||||||
|
MousePosFlag = 1;
|
||||||
|
} else if (MousePos_X >= 420 && MousePos_Y >= 110 && MousePos_X <= 782 && MousePos_Y <= 564) {
|
||||||
|
MousePosFlag = 2;
|
||||||
|
} else {
|
||||||
|
MousePosFlag = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||||
|
|
||||||
|
//绘制字体
|
||||||
|
if (sq_GetCurrentModuleType() == 3) DrawFont(obj);
|
||||||
|
//回到城镇清空字体数组
|
||||||
|
else if (Visible == false) {
|
||||||
|
DamageFontArray = null;
|
||||||
|
DamageFontArray = {};
|
||||||
|
MapBaseXPos = 0;
|
||||||
|
MapBaseYPos = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置地图原点
|
||||||
|
SetMapBasePos(obj);
|
||||||
|
//设置NUT白字
|
||||||
|
SetNutRate();
|
||||||
|
|
||||||
|
|
||||||
|
if (KeyPressNB.isKeyPress(7, "damage") && this.Visible && sq_GetCurrentModuleType() != 3) {
|
||||||
|
PushDamageFontArray(0x1AB7CDC, 400, 300, 0, Clock(), FocusPrintType, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function OpenCallBack() {
|
||||||
|
this.Visible = true;
|
||||||
|
ResetFocus();
|
||||||
|
GetFontList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function Lenheart_SkinHub_Fun(obj) {
|
||||||
|
local RootTab = getroottable();
|
||||||
|
if (!RootTab.rawin("SkinHub_Obj")) {
|
||||||
|
local Winobj = LenheartNewUI_CreateWindow(SkinHubC, "皮肤仓库窗口", ((getroottable().Rindro_Scr_Width - 788) / 2).tointeger(), 12, 788, 576, 26);
|
||||||
|
|
||||||
|
EventList_Obj.AddEvent("皮肤仓库", 670, Winobj, "interface2/hud/information_button/information_button_cn.img");
|
||||||
|
RootTab.rawset("SkinHub_Obj", Winobj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getroottable()["LenheartFuncTab"].rawset("SkinHubFuncN", Lenheart_SkinHub_Fun);
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
/*
|
|
||||||
文件名:SkinWarehouse.nut
|
|
||||||
路径:Project/SkinWarehouse/SkinWarehouse.nut
|
|
||||||
创建日期:2024-08-25 09:55
|
|
||||||
文件用途:皮肤仓库
|
|
||||||
*/
|
|
||||||
class SkinWarehouseC extends LenheartNewUI_Windows {
|
|
||||||
//调试模式
|
|
||||||
// DeBugMode = true;
|
|
||||||
|
|
||||||
//不是窗口
|
|
||||||
// NoWindow = true;
|
|
||||||
|
|
||||||
//是否可见
|
|
||||||
// Visible = false;
|
|
||||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
|
||||||
Childrens = [];
|
|
||||||
//注册控件
|
|
||||||
RegisterWidget();
|
|
||||||
|
|
||||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
|
||||||
}
|
|
||||||
|
|
||||||
function RegisterWidget() {
|
|
||||||
// //关闭按钮
|
|
||||||
// local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
|
||||||
// CloseButton.OnClick = function() {
|
|
||||||
// this.Visible = false;
|
|
||||||
// }.bindenv(this);
|
|
||||||
// Childrens.append(CloseButton);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//绘制主界面
|
|
||||||
function DrawMain(obj) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function Show(obj) {
|
|
||||||
DrawMain(obj);
|
|
||||||
LenheartNewUI_Windows.Show(obj);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//逻辑入口
|
|
||||||
function Proc(obj) {
|
|
||||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
getroottable().rawdelete("SkinWarehouse_Obj");
|
|
||||||
|
|
||||||
function Lenheart_SkinWarehouse_Fun(obj) {
|
|
||||||
local RootTab = getroottable();
|
|
||||||
if (!RootTab.rawin("SkinWarehouse_Obj")) {
|
|
||||||
RootTab.rawset("SkinWarehouse_Obj", true);
|
|
||||||
LenheartNewUI_CreateWindow(SkinWarehouseC, "皮肤仓库窗口", ((getroottable().Rindro_Scr_Width - 405) / 2).tointeger(), 64, 405, 372, 28);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getroottable()["LenheartFuncTab"].rawset("SkinWarehouseFuncN", Lenheart_SkinWarehouse_Fun);
|
|
||||||
|
|
@ -50,7 +50,12 @@ class Tuguan_NewC extends LenheartNewUI_Windows {
|
||||||
State = 2;
|
State = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
BoxWindowName = Rindro_ItemInfoObject[BoxId].Name;
|
//读取物品名称
|
||||||
|
local ItemObject = L_sq_GetItem(BoxId);
|
||||||
|
local NamePointer = L_sq_RA(ItemObject + 0x20);
|
||||||
|
local Name = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString();
|
||||||
|
|
||||||
|
BoxWindowName = Name;
|
||||||
Visible = true;
|
Visible = true;
|
||||||
//初始化完成
|
//初始化完成
|
||||||
InitState = true;
|
InitState = true;
|
||||||
|
|
@ -201,7 +206,7 @@ class Tuguan_NewC extends LenheartNewUI_Windows {
|
||||||
local ItemId = RewardObj[i][z]["itemid"];
|
local ItemId = RewardObj[i][z]["itemid"];
|
||||||
local ItemCount = RewardObj[i][z]["num"];
|
local ItemCount = RewardObj[i][z]["num"];
|
||||||
//绘制物品
|
//绘制物品
|
||||||
L_Sq_DrawItem((X - 195) + 198 + 30 + 9 + ((ofs % 4) * 86) + (z * 34) + 3, Y + 62 + 9 + ((ofs / 4) * 50) + 3, ItemId, ItemCount, 0, 0, 0);
|
DrawItemEx((X - 195) + 198 + 30 + 9 + ((ofs % 4) * 86) + (z * 34) + 3, Y + 62 + 9 + ((ofs / 4) * 50) + 3, ItemId, ItemCount);
|
||||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, (X - 195) + 198 + 30 + 9 + ((ofs % 4) * 86) + (z * 34) + 3, Y + 62 + 9 + ((ofs / 4) * 50) + 3, 24, 24)) {
|
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, (X - 195) + 198 + 30 + 9 + ((ofs % 4) * 86) + (z * 34) + 3, Y + 62 + 9 + ((ofs / 4) * 50) + 3, 24, 24)) {
|
||||||
ItemInfoDrawS = {};
|
ItemInfoDrawS = {};
|
||||||
ItemInfoDrawS.X <- (X - 195) + 198 + 30 + 9 + ((ofs % 4) * 86) + (z * 34) + 3;
|
ItemInfoDrawS.X <- (X - 195) + 198 + 30 + 9 + ((ofs % 4) * 86) + (z * 34) + 3;
|
||||||
|
|
|
||||||
|
|
@ -97,5 +97,14 @@
|
||||||
},
|
},
|
||||||
"Project/CollectionBox": {
|
"Project/CollectionBox": {
|
||||||
"description": "收集箱"
|
"description": "收集箱"
|
||||||
|
},
|
||||||
|
"Project/HorseGuessing": {
|
||||||
|
"description": "骑士马战"
|
||||||
|
},
|
||||||
|
"Project/SkinHub": {
|
||||||
|
"description": "皮肤中心"
|
||||||
|
},
|
||||||
|
"Project/MarrySystem": {
|
||||||
|
"description": "结婚系统"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue