111
This commit is contained in:
233
Plugins/Anton/antontownmainparty_req.nut
Normal file
233
Plugins/Anton/antontownmainparty_req.nut
Normal file
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
文件名:antontownmainparty_req.nut
|
||||
路径:Plugins/Anton/antontownmainparty_req.nut
|
||||
创建日期:2022-09-04 20:11
|
||||
文件用途:城镇中打开安图恩攻坚队面板攻坚队申请部分
|
||||
*/
|
||||
|
||||
|
||||
class AntonTownMainControl_PartyReq_C extends BasicsDrawTool {
|
||||
X = 57;
|
||||
Y = 385;
|
||||
ReqList = null;
|
||||
|
||||
Page = 1;
|
||||
NowSelect = 0;
|
||||
|
||||
|
||||
LeftButtonObject = null; //左按钮
|
||||
RightButtonObject = null; //右按钮
|
||||
|
||||
ClossButtonObj = null;
|
||||
AllowJoinButtonObj = null;
|
||||
RejectJoinButtonObj = null;
|
||||
|
||||
|
||||
function AntonPartyReqPack(chunk) {
|
||||
//print(chunk);
|
||||
local RootTab = getroottable();
|
||||
BasicsDrawTool.InitClass("AntonPartyReqJson"); //自动判断清空
|
||||
local JsonObj = Json_STL("AntonPartyReqJson");
|
||||
RootTab.rawset("AntonPartyReqJson", JsonObj);
|
||||
RootTab["AntonPartyReqJson"].Parse(chunk, 0, false);
|
||||
|
||||
|
||||
local TabBuffer = {
|
||||
UID = RootTab["AntonPartyReqJson"].Get("Charac->UID"),
|
||||
CID = RootTab["AntonPartyReqJson"].Get("Charac->CID"),
|
||||
CaptainBool = RootTab["AntonPartyReqJson"].Get("Charac->CaptainBool"),
|
||||
PartyCaptain = RootTab["AntonPartyReqJson"].Get("Charac->PartyCaptain"),
|
||||
PlayerSession = RootTab["AntonPartyReqJson"].Get("Charac->PlayerSession"),
|
||||
PartyID = RootTab["AntonPartyReqJson"].Get("Charac->PartyID"),
|
||||
PlayerLevel = RootTab["AntonPartyReqJson"].Get("Charac->PlayerLevel"),
|
||||
PlayerName = RootTab["AntonPartyReqJson"].Get("Charac->PlayerName"),
|
||||
PlayerJob = RootTab["AntonPartyReqJson"].Get("Charac->PlayerJob"),
|
||||
PlayerJobEx = RootTab["AntonPartyReqJson"].Get("Charac->PlayerJobEx"),
|
||||
PlayerGrowTypeJob = RootTab["AntonPartyReqJson"].Get("Charac->PlayerGrowTypeJob"),
|
||||
isPrepare = RootTab["AntonPartyReqJson"].Get("Charac->isPrepare"),
|
||||
UiButton = null,
|
||||
}
|
||||
|
||||
RootTab["ANTONTOWNMAINCONTROLREQ"].ReqList.append(TabBuffer);
|
||||
}
|
||||
|
||||
constructor() {
|
||||
ReqList = [];
|
||||
Pack_Control.rawset(1004, AntonPartyReqPack);
|
||||
}
|
||||
|
||||
//获取汉字偏移
|
||||
function GetOffserFromLen(char, offset) {
|
||||
return (char.len() * offset)
|
||||
}
|
||||
|
||||
//绘制申请人具体信息
|
||||
function DrawReqPlayerInfo(obj) {
|
||||
//材料准备情况
|
||||
T_DrawStayAni(obj, "common/anton/material.ani", X + 157, Y - 1, ReqList[NowSelect].isPrepare.tointeger(), "安图恩队伍申请材料准备情况" + ReqList[NowSelect].isPrepare);
|
||||
//头像
|
||||
T_DrawStayAni(obj, "common/anton/face/" + ReqList[NowSelect].PlayerJob + "/" + (ReqList[NowSelect].PlayerJobEx % 16) + ".ani", X, Y, 0, "安图恩队伍申请头像编号" + ReqList[NowSelect].PlayerName);
|
||||
//绘制等级
|
||||
L_Code_STL("Lv." + ReqList[NowSelect].PlayerLevel, X + 40, Y + 17, 0xFF29708a, 1);
|
||||
//绘制名字
|
||||
L_Code_STL(ReqList[NowSelect].PlayerName, X + 40, Y - 1, 0xFF29708a, 1);
|
||||
//绘制职业名
|
||||
L_Code_STL(ReqList[NowSelect].PlayerGrowTypeJob, X + 65 + GetOffserFromLen(ReqList[NowSelect].PlayerGrowTypeJob.tostring(), 3), Y + 17, 0xFF29708a, 1);
|
||||
//绘制信息
|
||||
L_Code_STL("", X + 200, Y + 75, 0xFF29708a, 1);
|
||||
}
|
||||
|
||||
//绘制申请人列表
|
||||
function DrawReqPlayerList(obj) {
|
||||
local Min = 0 + (5 * (Page - 1));
|
||||
local Max = 5 * Page;
|
||||
for (local i = Min; i < ReqList.len() % Max; ++i) {
|
||||
T_DrawStayAni(obj, "common/anton/new/newbaseui.ani", X - 5, Y + 53 + (19 * i), 1, "安图恩队伍申请列表底框" + i);
|
||||
//绘制等级
|
||||
L_Code_STL("Lv." + ReqList[i].PlayerLevel, X + 3, Y + 56 + (19 * i), 0xFF29708a, 1);
|
||||
//绘制名字
|
||||
L_Code_STL(ReqList[i].PlayerName, X + 57, Y + 56 + (19 * i), 0xFF29708a, 1);
|
||||
//材料准备情况
|
||||
T_DrawStayAni(obj, "common/anton/material.ani", X + 160, Y + 56 + (19 * i), ReqList[i].isPrepare.tointeger(), "安图恩队伍申请材料准备情况" + ReqList[NowSelect].isPrepare);
|
||||
|
||||
ReqList[i].UiButton = AntonButtonPro(obj, "AntonPartyReqListSwitchButton" + ReqList[i].PlayerName, X - 5, Y + 53 + (19 * i), "common/anton/new/newnull.ani", 255, 15, 0);
|
||||
ReqList[i].UiButton.SetRectEnble(true, "AntonPartyReqListSwitchButtonr" + ReqList[i].PlayerName, X - 5, Y + 53 + (19 * i), "common/anton/new/newbaseui.ani", 3);
|
||||
ReqList[i].UiButton.Show();
|
||||
|
||||
if (ReqList[i].UiButton.isLBActive()) {
|
||||
obj.sq_PlaySound("CLICK_BUTTON1");
|
||||
NowSelect = i;
|
||||
}
|
||||
}
|
||||
T_DrawStayAni(obj, "common/anton/new/newbaseui.ani", X - 5, Y + 53 + (19 * NowSelect), 2, "安图恩队伍申请列表界面当前选中");
|
||||
}
|
||||
|
||||
//绘制申请人页面控制
|
||||
function DrawReqPlayerListPageConctrl(obj) {
|
||||
//绘制申请人页面数量
|
||||
local ListMaxPage = (ReqList.len() / 5).tointeger() + 1;
|
||||
L_Code_STL(Page.tostring() + " / " + ListMaxPage.tostring(), X + 21, Y + 155, 0xFFFFFFFF, 1);
|
||||
|
||||
//如果申请人列表不止1页
|
||||
if (ListMaxPage > 1) {
|
||||
//左按钮
|
||||
{
|
||||
if (LeftButtonObject == null) {
|
||||
LeftButtonObject = AntonButtonPro(obj, "AntonPartyReqListLeftButton", X - 3, Y + 154, "common/anton/new/newbasebutton.ani", 15, 13, 0);
|
||||
LeftButtonObject.SetRectEnble(true, "AntonPartyReqListLeftButtonr", X - 3, Y + 154, "common/anton/new/newbasebutton.ani", 1);
|
||||
LeftButtonObject.SetCustomClickEnble(true, "AntonPartyReqListLeftButtonc", X - 3, Y + 155, "common/anton/new/newbasebutton.ani", 2);
|
||||
}
|
||||
LeftButtonObject.Show();
|
||||
if (LeftButtonObject.isLBActive()) {
|
||||
obj.sq_PlaySound("CLICK_BUTTON2");
|
||||
if (Page > 1) --Page;
|
||||
}
|
||||
}
|
||||
|
||||
//右按钮
|
||||
{
|
||||
if (RightButtonObject == null) {
|
||||
RightButtonObject = AntonButtonPro(obj, "AntonPartyReqListRightButton", X + 55, Y + 154, "common/anton/new/newbasebutton.ani", 15, 13, 3);
|
||||
RightButtonObject.SetRectEnble(true, "AntonPartyReqListRightButtonr", X + 55, Y + 154, "common/anton/new/newbasebutton.ani", 4);
|
||||
RightButtonObject.SetCustomClickEnble(true, "AntonPartyReqListRightButtonc", X + 55, Y + 155, "common/anton/new/newbasebutton.ani", 5);
|
||||
}
|
||||
RightButtonObject.Show();
|
||||
if (RightButtonObject.isLBActive()) {
|
||||
obj.sq_PlaySound("CLICK_BUTTON2");
|
||||
if (Page < ListMaxPage) ++Page;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//绘制申请人控制按钮
|
||||
function DrawReqPlayerConctrlButton(obj, Type) {
|
||||
if (Type == 0) {
|
||||
T_DrawStayAni(obj, "common/anton/new/newbasebutton.ani", X + 138, Y + 153, 20, "安图恩队伍申请同意不可用");
|
||||
T_DrawStayAni(obj, "common/anton/new/newbasebutton.ani", X + 138 + 43, Y + 153, 24, "安图恩队伍申请拒绝不可用");
|
||||
} else {
|
||||
//同意按钮
|
||||
{
|
||||
if (AllowJoinButtonObj == null) {
|
||||
AllowJoinButtonObj = AntonButtonPro(obj, "AntonAllowJoinButton", X + 138, Y + 153, "common/anton/new/newbasebutton.ani", 40, 17, 21);
|
||||
AllowJoinButtonObj.SetRectEnble(true, "AntonAllowJoinButtonr", X + 138, Y + 153, "common/anton/new/newbasebutton.ani", 22);
|
||||
AllowJoinButtonObj.SetCustomClickEnble(true, "AntonAllowJoinButtonc", X + 138, Y + 153, "common/anton/new/newbasebutton.ani", 23);
|
||||
}
|
||||
AllowJoinButtonObj.Show();
|
||||
if (AllowJoinButtonObj.isLBActive()) {
|
||||
obj.sq_PlaySound("CLICK_BUTTON2");
|
||||
local TabBuffer = {
|
||||
UID = ReqList[NowSelect].UID,
|
||||
CID = ReqList[NowSelect].CID,
|
||||
CaptainBool = ReqList[NowSelect].CaptainBool,
|
||||
PartyCaptain = ReqList[NowSelect].PartyCaptain,
|
||||
PlayerSession = ReqList[NowSelect].PlayerSession,
|
||||
PartyID = ReqList[NowSelect].PartyID,
|
||||
PlayerLevel = ReqList[NowSelect].PlayerLevel,
|
||||
PlayerJob = ReqList[NowSelect].PlayerJob,
|
||||
PlayerJobEx = ReqList[NowSelect].PlayerJobEx,
|
||||
IsPrepare = ReqList[NowSelect].isPrepare,
|
||||
}
|
||||
local TabBufferB = {
|
||||
Charac = TabBuffer,
|
||||
op = 1013,
|
||||
}
|
||||
local ReqStr = Json.Encode(TabBufferB);
|
||||
L_sq_SendPackType(130);
|
||||
L_sq_SendPackWChar(ReqStr);
|
||||
L_sq_SendPack();
|
||||
ReqList.remove(NowSelect);
|
||||
}
|
||||
}
|
||||
|
||||
//拒绝按钮
|
||||
{
|
||||
if (RejectJoinButtonObj == null) {
|
||||
RejectJoinButtonObj = AntonButtonPro(obj, "AntonRejectJoinButton", X + 138 + 43, Y + 153, "common/anton/new/newbasebutton.ani", 40, 17, 25);
|
||||
RejectJoinButtonObj.SetRectEnble(true, "AntonRejectJoinButtonr", X + 138 + 43, Y + 153, "common/anton/new/newbasebutton.ani", 26);
|
||||
RejectJoinButtonObj.SetCustomClickEnble(true, "AntonRejectJoinButtonc", X + 138 + 43, Y + 153, "common/anton/new/newbasebutton.ani", 27);
|
||||
}
|
||||
RejectJoinButtonObj.Show();
|
||||
if (RejectJoinButtonObj.isLBActive()) {
|
||||
obj.sq_PlaySound("CLICK_BUTTON2");
|
||||
ReqList.remove(NowSelect);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
//绘制申请人具体信息
|
||||
DrawReqPlayerInfo(obj);
|
||||
|
||||
//绘制申请人列表
|
||||
DrawReqPlayerList(obj);
|
||||
|
||||
//绘制申请人页面控制
|
||||
DrawReqPlayerListPageConctrl(obj);
|
||||
|
||||
//绘制申请人控制按钮
|
||||
DrawReqPlayerConctrlButton(obj, 1);
|
||||
}
|
||||
|
||||
function Run(obj) {
|
||||
//如果不是自己的界面打开
|
||||
local RootTab = getroottable();
|
||||
if(RootTab["ANTONTEAMMAINBUTTON"].State == 0)return;
|
||||
local ArrSize = ReqList.len();
|
||||
if (ArrSize > 0) {
|
||||
Show(obj);
|
||||
} else DrawReqPlayerConctrlButton(obj, 0);
|
||||
}
|
||||
}
|
||||
|
||||
local RootTab = getroottable();
|
||||
RootTab.rawdelete("ANTONTOWNMAINCONTROLREQ");
|
||||
|
||||
function AntonTownMainControl_PartyReq(obj) {
|
||||
local RootTab = getroottable();
|
||||
if (RootTab.rawin("ANTONTOWNMAINCONTROLREQ") == false) {
|
||||
local ANTONTOWNMAINCONTROLREQOBJ = AntonTownMainControl_PartyReq_C();
|
||||
RootTab.rawset("ANTONTOWNMAINCONTROLREQ", ANTONTOWNMAINCONTROLREQOBJ);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user