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