1087 lines
		
	
	
		
			46 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			1087 lines
		
	
	
		
			46 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| /*
 | |
| 文件名:lukeparty.nut
 | |
| 路径:Plugins/Luke/lukeparty.nut
 | |
| 创建日期:2023-03-30	13:55
 | |
| 文件用途:卢克攻坚队伍逻辑
 | |
| */
 | |
| 
 | |
| 
 | |
| class LukeTownMainControl_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 Encode(Table) {
 | |
|         local Size = Table.len();
 | |
|         local Pos = 0;
 | |
|         local Str = "{";
 | |
|         foreach(Key, Value in Table) {
 | |
|             ++Pos;
 | |
|             Str += "\"";
 | |
|             Str += Key.tostring();
 | |
|             Str += "\"";
 | |
|             Str += ":";
 | |
|             Str += Value;
 | |
|             if (Pos != Size) Str += ",";
 | |
|         }
 | |
|         Str += "}";
 | |
|         return Str;
 | |
|     }
 | |
| 
 | |
|     function LukePartyReqPack(chunk) {
 | |
|         //print(chunk);
 | |
|         local RootTab = getroottable();
 | |
|         BasicsDrawTool.InitClass("LukePartyReqJson"); //自动判断清空
 | |
|         local JsonObj = Json_STL("LukePartyReqJson");
 | |
|         RootTab.rawset("LukePartyReqJson", JsonObj);
 | |
|         RootTab["LukePartyReqJson"].Parse(chunk, 0, false);
 | |
| 
 | |
| 
 | |
|         local TabBuffer = {
 | |
|             UID = RootTab["LukePartyReqJson"].Get("Charac->UID"),
 | |
|             CID = RootTab["LukePartyReqJson"].Get("Charac->CID"),
 | |
|             CaptainBool = RootTab["LukePartyReqJson"].Get("Charac->CaptainBool"),
 | |
|             PartyCaptain = RootTab["LukePartyReqJson"].Get("Charac->PartyCaptain"),
 | |
|             PlayerSession = RootTab["LukePartyReqJson"].Get("Charac->PlayerSession"),
 | |
|             PartyID = RootTab["LukePartyReqJson"].Get("Charac->PartyID"),
 | |
|             PlayerLevel = RootTab["LukePartyReqJson"].Get("Charac->PlayerLevel"),
 | |
|             PlayerName = RootTab["LukePartyReqJson"].Get("Charac->PlayerName"),
 | |
|             PlayerJob = RootTab["LukePartyReqJson"].Get("Charac->PlayerJob"),
 | |
|             PlayerJobEx = RootTab["LukePartyReqJson"].Get("Charac->PlayerJobEx"),
 | |
|             PlayerGrowTypeJob = RootTab["LukePartyReqJson"].Get("Charac->PlayerGrowTypeJob"),
 | |
|             isPrepare = RootTab["LukePartyReqJson"].Get("Charac->isPrepare"),
 | |
|             UiButton = null,
 | |
|         }
 | |
| 
 | |
|         RootTab["LUKETOWNMAINCONTROLREQ"].ReqList.append(TabBuffer);
 | |
|     }
 | |
| 
 | |
|     constructor() {
 | |
|         ReqList = [];
 | |
|         Pack_Control.rawset(25600104, LukePartyReqPack);
 | |
|     }
 | |
| 
 | |
|     //获取汉字偏移
 | |
|     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 = LukeButtonPro(obj, "LukePartyReqListSwitchButton" + ReqList[i].PlayerName, X - 5, Y + 53 + (19 * i), "common/anton/new/newnull.ani", 255, 15, 0);
 | |
|             ReqList[i].UiButton.SetRectEnble(true, "LukePartyReqListSwitchButtonr" + 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 = LukeButtonPro(obj, "LukePartyReqListLeftButton", X - 3, Y + 154, "common/anton/new/newbasebutton.ani", 15, 13, 0);
 | |
|                     LeftButtonObject.SetRectEnble(true, "LukePartyReqListLeftButtonr", X - 3, Y + 154, "common/anton/new/newbasebutton.ani", 1);
 | |
|                     LeftButtonObject.SetCustomClickEnble(true, "LukePartyReqListLeftButtonc", 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 = LukeButtonPro(obj, "LukePartyReqListRightButton", X + 55, Y + 154, "common/anton/new/newbasebutton.ani", 15, 13, 3);
 | |
|                     RightButtonObject.SetRectEnble(true, "LukePartyReqListRightButtonr", X + 55, Y + 154, "common/anton/new/newbasebutton.ani", 4);
 | |
|                     RightButtonObject.SetCustomClickEnble(true, "LukePartyReqListRightButtonc", 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 = LukeButtonPro(obj, "LukeAllowJoinButton", X + 138, Y + 153, "common/anton/new/newbasebutton.ani", 40, 17, 21);
 | |
|                     AllowJoinButtonObj.SetRectEnble(true, "LukeAllowJoinButtonr", X + 138, Y + 153, "common/anton/new/newbasebutton.ani", 22);
 | |
|                     AllowJoinButtonObj.SetCustomClickEnble(true, "LukeAllowJoinButtonc", 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 LukeJoinPack = Json_STL("LukeJoinPack");
 | |
|                     // local eqstr = Json_STL.Encode(TabBuffer);
 | |
|                     // local pstr = "{" + eqstr.slice(1, eqstr.len() - 1) + "}";
 | |
|                     // print(pstr);
 | |
|                     // LukeJoinPack.Put("Charac", pstr);
 | |
| 
 | |
|                     // LukeJoinPack.Put("op", 25600113);
 | |
|                     // local str = LukeJoinPack.GetString();
 | |
|                     // L_sq_SendPackType(130);
 | |
|                     // L_sq_SendPackWChar(str);
 | |
|                     // L_sq_SendPack();
 | |
|                     // LukeJoinPack.Delete();
 | |
| 
 | |
|                     local TabBufferB = {
 | |
|                         Charac = Encode(TabBuffer),
 | |
|                         op = 25600113,
 | |
|                     }
 | |
|                     local ReqStr = Encode(TabBufferB);
 | |
|                     print(ReqStr);
 | |
| 
 | |
|                     L_sq_SendPackType(130);
 | |
|                     L_sq_SendPackWChar(ReqStr);
 | |
|                     L_sq_SendPack();
 | |
| 
 | |
|                     ReqList.remove(NowSelect);
 | |
|                 }
 | |
|             }
 | |
| 
 | |
|             //拒绝按钮
 | |
|             {
 | |
|                 if (RejectJoinButtonObj == null) {
 | |
|                     RejectJoinButtonObj = LukeButtonPro(obj, "LukeRejectJoinButton", X + 138 + 43, Y + 153, "common/anton/new/newbasebutton.ani", 40, 17, 25);
 | |
|                     RejectJoinButtonObj.SetRectEnble(true, "LukeRejectJoinButtonr", X + 138 + 43, Y + 153, "common/anton/new/newbasebutton.ani", 26);
 | |
|                     RejectJoinButtonObj.SetCustomClickEnble(true, "LukeRejectJoinButtonc", 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["LukePartyObj"].State == 0)return;
 | |
|         local ArrSize = ReqList.len();
 | |
|         if (ArrSize > 0) {
 | |
|             Show(obj);
 | |
|         } else DrawReqPlayerConctrlButton(obj, 0);
 | |
|     }
 | |
| }
 | |
| 
 | |
| 
 | |
| function LukeTownMainControl_PartyReq(obj) {
 | |
|     local RootTab = getroottable();
 | |
|     if (RootTab.rawin("LUKETOWNMAINCONTROLREQ") == false) {
 | |
|         local LUKETOWNMAINCONTROLREQOBJ = LukeTownMainControl_PartyReq_C();
 | |
|         RootTab.rawset("LUKETOWNMAINCONTROLREQ", LUKETOWNMAINCONTROLREQOBJ);
 | |
|     }
 | |
| }
 | |
| 
 | |
| 
 | |
| 
 | |
| class LukeUserControl_C extends BasicsDrawTool {
 | |
|     CaptainControl = null; //攻坚队长主控
 | |
| 
 | |
|     PartyID = null; //队伍ID
 | |
|     PlayerLevel = null; //玩家等级
 | |
|     PlayerName = null; //玩家名字
 | |
|     PlayerJob = null; //玩家基础职业
 | |
|     PlayerJobEx = null; //玩家转职职业
 | |
|     PlayerGrowTypeJob = null; //玩家转职职业
 | |
|     PlayerSession = null; //玩家世界编号
 | |
|     PartyCaptain = null; //玩家是否小队队长
 | |
|     CaptainBool = null; //是否攻坚队队长
 | |
|     Material = null; //是否拥有材料
 | |
|     CID = null; //玩家CID
 | |
| 
 | |
|     CheakPlayerInfoFunc = null;
 | |
| 
 | |
|     FuncButtonSwitch = false; //功能界面是否打开
 | |
|     MyName = null;
 | |
|     ButtonObj = null;
 | |
|     X = 0;
 | |
|     Y = 0;
 | |
| 
 | |
|     KickoutPlayerButtonObj = null; //踢出玩家按钮
 | |
|     CheckPlayerInfoButtonObj = null; //查看信息按钮
 | |
|     PartyFuncButtonObj = null; //组队按钮
 | |
|     TradingPlayerButtonObj = null; //交易按钮
 | |
| 
 | |
|     //获取汉字偏移
 | |
|     function GetOffserFromLen(char, offset) {
 | |
|         return (char.len() * offset)
 | |
|     }
 | |
| 
 | |
|     constructor(gName, gX, gY, gCaptainControl) {
 | |
|         MyName = gName;
 | |
|         X = gX;
 | |
|         Y = gY;
 | |
|         //print("LukeUserControl_C ClassObject Succes");
 | |
|         CaptainControl = gCaptainControl;
 | |
|     }
 | |
| 
 | |
|     //设置Player信息
 | |
|     function SetPlayerInfo(InfoTable) {
 | |
|         PartyID = InfoTable.PartyID; //队伍ID
 | |
|         PlayerLevel = InfoTable.PlayerLevel; //玩家等级
 | |
|         PlayerName = InfoTable.PlayerName; //玩家名字
 | |
|         PlayerJob = InfoTable.PlayerJob; //玩家基础职业
 | |
|         PlayerJobEx = InfoTable.PlayerJobEx; //玩家转职职业
 | |
|         PlayerGrowTypeJob = InfoTable.PlayerGrowTypeJob; //玩家转职职业
 | |
|         PlayerSession = InfoTable.PlayerSession; //玩家世界编号
 | |
|         PartyCaptain = InfoTable.PartyCaptain; //玩家是否小队队长
 | |
|         CaptainBool = InfoTable.CaptainBool; //是否攻坚队队长
 | |
|         Material = InfoTable.Material; //是否拥有材料
 | |
|         CID = InfoTable.CID; //玩家CID
 | |
|     }
 | |
| 
 | |
|     function FuncButtonC(obj, YposOffset, AniIndex) {
 | |
|         local FuncThis = null;
 | |
|         if (FuncThis == null) {
 | |
|             FuncThis = LukeButtonPro(obj, MyName + FuncThis + "Func", LukeTownControl_C.X + X - 110, LukeTownControl_C.Y + Y - 1 + YposOffset, "common/anton/funcbutton.ani", 100, 21, AniIndex);
 | |
|             FuncThis.SetRectEnble(true, MyName + FuncThis + "Func", LukeTownControl_C.X + X - 110, LukeTownControl_C.Y + Y - 1 + YposOffset, "common/anton/funcbutton.ani", AniIndex + 1);
 | |
|             FuncThis.SetCustomClickEnble(true, FuncThis + "FuncSwitchButtonc", LukeTownControl_C.X + X - 110, LukeTownControl_C.Y + Y - 1 + YposOffset, "common/anton/funcbutton.ani", AniIndex + 2);
 | |
|         }
 | |
|         FuncThis.Show();
 | |
|         return FuncThis;
 | |
|     }
 | |
| 
 | |
|     //绘制功能按键
 | |
|     function DrawFucButton(obj) {
 | |
|         if (FuncButtonSwitch) //功能函数开关
 | |
|         {
 | |
|             local Ypos = 0; //初始偏移
 | |
| 
 | |
|             { //邀请组队
 | |
|                 if (PartyID == 0) {
 | |
|                     local CheakPlayer = FuncButtonC(obj, Ypos, 12);
 | |
|                     if (CheakPlayer.isLBActive()) {
 | |
|                         L_sq_SendPackType(10);
 | |
|                         L_sq_SendPackWord(PlayerSession);
 | |
|                         L_sq_SendPackByte(0);
 | |
|                         L_sq_SendPackDWord(1);
 | |
|                         L_sq_SendPackWord(0);
 | |
|                         L_sq_SendPack();
 | |
|                     }
 | |
|                     Ypos += 21;
 | |
|                 }
 | |
|             }
 | |
| 
 | |
| 
 | |
|             { //查看信息
 | |
|                 local CheakPlayer = FuncButtonC(obj, Ypos, 0);
 | |
|                 if (CheakPlayer.isLBActive()) {
 | |
|                     L_sq_SendPackType(8);
 | |
|                     L_sq_SendPackWord(PlayerSession);
 | |
|                     L_sq_SendPackByte(3);
 | |
|                     L_sq_SendPack();
 | |
|                 }
 | |
|                 Ypos += 21;
 | |
|             }
 | |
| 
 | |
|             { //交易
 | |
|                 local TradingPlayer = FuncButtonC(obj, Ypos, 6);
 | |
|                 if (TradingPlayer.isLBActive()) {
 | |
|                     L_sq_SendPackType(10);
 | |
|                     L_sq_SendPackWord(PlayerSession);
 | |
|                     L_sq_SendPackByte(1);
 | |
|                     L_sq_SendPackDWord(22053);
 | |
|                     L_sq_SendPack();
 | |
|                 }
 | |
|                 Ypos += 21;
 | |
|             }
 | |
| 
 | |
| 
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     //绘制主Ani
 | |
|     function DrawMainAni(obj) {
 | |
|         if (ButtonObj == null) {
 | |
|             ButtonObj = LukeButtonPro(obj, MyName, LukeTownControl_C.X + X, LukeTownControl_C.Y + Y, "common/anton/user.ani", 329, 17, 0);
 | |
|             ButtonObj.SetRectEnble(true, MyName + "SwitchButtonr", LukeTownControl_C.X + X - 8, LukeTownControl_C.Y + Y - 8, "common/anton/user.ani", 2);
 | |
|         }
 | |
|         ButtonObj.Show();
 | |
| 
 | |
|         //绘制队伍
 | |
|         T_DrawStayAni(obj, "common/anton/partytype.ani", LukeTownControl_C.X + X + 6, LukeTownControl_C.Y + Y + 2, PartyID + 1, "安图恩队伍编号" + PartyID, 1.0);
 | |
|         //绘制材料准备情况
 | |
|         T_DrawStayAni(obj, "common/anton/material.ani", LukeTownControl_C.X + X + 272, LukeTownControl_C.Y + Y + 2, Material.tointeger(), "安图恩材料准备情况" + Material, 1.0);
 | |
|     }
 | |
| 
 | |
|     //绘制头像
 | |
|     function DrawFaceAni(obj) {
 | |
|         T_DrawStayAni(obj, "common/anton/face/" + PlayerJob + "/" + (PlayerJobEx % 16) + ".ani", X, Y, 0, "安图恩头像编号" + PlayerName);
 | |
|         //如果是攻坚队长主控
 | |
|         if (CaptainControl && !CaptainBool) {
 | |
|             KickoutPlayerButtonObj = LukeButtonPro(obj, "LukePartyKickoutButton" + PlayerName.tostring(), X - 9, Y - 10, "common/anton/new/newnull.ani", 38, 39, 0);
 | |
|             KickoutPlayerButtonObj.SetRectEnble(true, "LukePartyKickoutButtonr" + PlayerName.tostring(), X - 9, Y - 10, "common/anton/new/newfunc.ani", 0);
 | |
|             KickoutPlayerButtonObj.Show();
 | |
| 
 | |
|             if (KickoutPlayerButtonObj.isLBActive()) {
 | |
|                 obj.sq_PlaySound("CLICK_BUTTON1");
 | |
|                 local LukeKickoutPartyPlayer = Json_STL("LukeKickoutPartyPlayer");
 | |
|                 LukeKickoutPartyPlayer.Put("op", 25600115);
 | |
|                 LukeKickoutPartyPlayer.Put("TCID", CID);
 | |
|                 local str = LukeKickoutPartyPlayer.GetString();
 | |
|                 L_sq_SendPackType(130);
 | |
|                 L_sq_SendPackWChar(str);
 | |
|                 L_sq_SendPack();
 | |
|                 LukeKickoutPartyPlayer.Delete();
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     //绘制名字
 | |
|     function DrawPlayerName(obj) {
 | |
|         L_Code_STL(PlayerName.tostring(), X + 40, Y - 1, 0xFF4990aa, 1);
 | |
|     }
 | |
| 
 | |
|     //绘制等级
 | |
|     function DrawPlayerLevel(obj) {
 | |
|         L_Code_STL("Lv." + PlayerLevel, X + 40, Y + 17, 0xFF29708a, 1);
 | |
|     }
 | |
| 
 | |
|     //绘制职业名字
 | |
|     function DrawPlayerGrowTypeName(obj) {
 | |
|         L_Code_STL(PlayerGrowTypeJob, X + 65 + GetOffserFromLen(PlayerLevel.tostring(), 3), Y + 17, 0xFF29708a, 1);
 | |
|     }
 | |
| 
 | |
|     //绘制队伍图标
 | |
|     function DrawPlayerPartyType(obj) {
 | |
|         if (CaptainBool == true) {
 | |
|             T_DrawStayAni(obj, "common/anton/partytype.ani", X + 133, Y - 1, 0, "安图恩队伍编号队长");
 | |
|         } else T_DrawStayAni(obj, "common/anton/partytype.ani", X + 133, Y - 1, PartyID + 1, "安图恩队伍编号" + PartyID);
 | |
|     }
 | |
| 
 | |
|     //绘制材料准备情况
 | |
|     function DrawPlayerMaterial(obj) {
 | |
|         T_DrawStayAni(obj, "common/anton/material.ani", X + 157, Y - 1, Material.tointeger(), "安图恩材料准备情况" + Material.tostring());
 | |
|     }
 | |
| 
 | |
|     //绘制交互功能按钮
 | |
|     function DrawPlayerFunc(obj) {
 | |
|         //绘制查看信息按钮
 | |
|         {
 | |
|             if (!CheckPlayerInfoButtonObj) {
 | |
|                 CheckPlayerInfoButtonObj = LukeButtonPro(obj, "LukeCheckPlayerInfoButton", X + 153, Y + 12, "common/anton/new/newfunc.ani", 16, 16, 1);
 | |
|                 CheckPlayerInfoButtonObj.SetRectEnble(true, "LukeCheckPlayerInfoButtonr", X + 153, Y + 12, "common/anton/new/newfunc.ani", 2);
 | |
|                 CheckPlayerInfoButtonObj.SetCustomClickEnble(true, "LukeCheckPlayerInfoButtonr", X + 153, Y + 13, "common/anton/new/newfunc.ani", 2);
 | |
|             }
 | |
|             CheckPlayerInfoButtonObj.Show();
 | |
|             if (CheckPlayerInfoButtonObj.isLBActive()) {
 | |
|                 obj.sq_PlaySound("CLICK_BUTTON1");
 | |
|                 L_sq_SendPackType(8);
 | |
|                 L_sq_SendPackWord(PlayerSession);
 | |
|                 L_sq_SendPackByte(3);
 | |
|                 L_sq_SendPack();
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         //绘制交易按钮
 | |
|         {
 | |
|             if (!TradingPlayerButtonObj) {
 | |
|                 TradingPlayerButtonObj = LukeButtonPro(obj, "LukeTradingPlayerButton", X + 171, Y + 12, "common/anton/new/newfunc.ani", 16, 16, 3);
 | |
|                 TradingPlayerButtonObj.SetRectEnble(true, "LukeTradingPlayerButtonr", X + 171, Y + 12, "common/anton/new/newfunc.ani", 4);
 | |
|                 TradingPlayerButtonObj.SetCustomClickEnble(true, "LukeTradingPlayerButtonr", X + 171, Y + 13, "common/anton/new/newfunc.ani", 4);
 | |
|             }
 | |
|             TradingPlayerButtonObj.Show();
 | |
|             if (TradingPlayerButtonObj.isLBActive()) {
 | |
|                 obj.sq_PlaySound("CLICK_BUTTON1");
 | |
|                 L_sq_SendPackType(10);
 | |
|                 L_sq_SendPackWord(PlayerSession);
 | |
|                 L_sq_SendPackByte(1);
 | |
|                 L_sq_SendPackDWord(22053);
 | |
|                 L_sq_SendPack();
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         //绘制组队按钮
 | |
|         {
 | |
|             if (!PartyFuncButtonObj) {
 | |
|                 PartyFuncButtonObj = LukeButtonPro(obj, "LukePartyFuncButton", X + 189, Y + 12, "common/anton/new/newfunc.ani", 16, 16, 5);
 | |
|                 PartyFuncButtonObj.SetRectEnble(true, "LukePartyFuncButtonr", X + 189, Y + 12, "common/anton/new/newfunc.ani", 6);
 | |
|                 PartyFuncButtonObj.SetCustomClickEnble(true, "LukePartyFuncButtonr", X + 189, Y + 13, "common/anton/new/newfunc.ani", 6);
 | |
|             }
 | |
|             PartyFuncButtonObj.Show();
 | |
|             if (PartyFuncButtonObj.isLBActive()) {
 | |
|                 obj.sq_PlaySound("CLICK_BUTTON1");
 | |
|                 L_sq_SendPackType(10);
 | |
|                 L_sq_SendPackWord(PlayerSession);
 | |
|                 L_sq_SendPackByte(0);
 | |
|                 L_sq_SendPackDWord(1);
 | |
|                 L_sq_SendPackWord(0);
 | |
|                 L_sq_SendPack();
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     function Show(obj) {
 | |
|         //绘制头像
 | |
|         DrawFaceAni(obj);
 | |
| 
 | |
|         //绘制名字
 | |
|         DrawPlayerName(obj);
 | |
| 
 | |
|         //绘制等级
 | |
|         DrawPlayerLevel(obj);
 | |
| 
 | |
|         //绘制职业名字
 | |
|         DrawPlayerGrowTypeName(obj);
 | |
| 
 | |
|         //绘制队伍图标
 | |
|         DrawPlayerPartyType(obj);
 | |
| 
 | |
|         //绘制材料准备情况
 | |
|         DrawPlayerMaterial(obj);
 | |
| 
 | |
|         //绘制交互功能按钮
 | |
|         DrawPlayerFunc(obj);
 | |
|     }
 | |
| 
 | |
|     function Run(obj) {
 | |
|         Show(obj);
 | |
|     }
 | |
| }
 | |
| 
 | |
| 
 | |
| class LukeTownControlInfo_C extends BasicsDrawTool {
 | |
|     X = 424;
 | |
|     Y = 28;
 | |
|     UserUiMap = null; //小队成员UI Map
 | |
|     UserInfoMap = null; //小队成员Info Map
 | |
|     MySelfMap = null; //自己
 | |
| 
 | |
|     CaptainControl = false; //攻坚队长主控
 | |
| 
 | |
|     function RedLukePlayerInfo(chunk) {
 | |
|         //Sout("收到包: %L", chunk);
 | |
|         local RootTab = getroottable();
 | |
|         BasicsDrawTool.InitClass("LukeTownUserJson"); //自动判断清空
 | |
|         local JsonObj = Json_STL("LukeTownUserJsonBuffer");
 | |
|         RootTab.rawset("LukeTownUserJson", JsonObj);
 | |
|         RootTab["LukeTownUserJson"].Parse(chunk, 0, false);
 | |
| 
 | |
|         //判断是否是攻坚队长主控
 | |
|         RootTab["LukeTOWNCONTROLINFO"].CaptainControl = RootTab["LukeTownUserJson"].Get("CaptainBool");
 | |
|         //清空自己的信息
 | |
|         RootTab["LukeTOWNCONTROLINFO"].MySelfMap = {};
 | |
|         //写入自己的信息
 | |
|         RootTab["LukeTOWNCONTROLINFO"].MySelfMap.rawset("PartyID", RootTab["LukeTownUserJson"].Get("myself->PartyID"));
 | |
|         RootTab["LukeTOWNCONTROLINFO"].MySelfMap.rawset("PartyCaptain", RootTab["LukeTownUserJson"].Get("myself->PartyCaptain"));
 | |
|         RootTab["LukeTOWNCONTROLINFO"].MySelfMap.rawset("PlayerGrowTypeJob", RootTab["LukeTownUserJson"].Get("myself->PlayerGrowTypeJob"));
 | |
|         RootTab["LukeTOWNCONTROLINFO"].MySelfMap.rawset("PlayerSession", RootTab["LukeTownUserJson"].Get("myself->PlayerSession"));
 | |
|         RootTab["LukeTOWNCONTROLINFO"].MySelfMap.rawset("PlayerLevel", RootTab["LukeTownUserJson"].Get("myself->PlayerLevel"));
 | |
|         RootTab["LukeTOWNCONTROLINFO"].MySelfMap.rawset("PlayerJob", RootTab["LukeTownUserJson"].Get("myself->PlayerJob"));
 | |
|         RootTab["LukeTOWNCONTROLINFO"].MySelfMap.rawset("PlayerName", RootTab["LukeTownUserJson"].Get("myself->PlayerName"));
 | |
|         RootTab["LukeTOWNCONTROLINFO"].MySelfMap.rawset("CaptainBool", RootTab["LukeTownUserJson"].Get("myself->CaptainBool"));
 | |
|         RootTab["LukeTOWNCONTROLINFO"].MySelfMap.rawset("isPrepare", RootTab["LukeTownUserJson"].Get("myself->isPrepare"));
 | |
| 
 | |
|         //清空小队成员数组
 | |
|         RootTab["LukeTOWNCONTROLINFO"].UserInfoMap = [];
 | |
|         //写入小队成员信息
 | |
|         for (local i = 0; i < 20; i++) {
 | |
|             local gPartyID = RootTab["LukeTownUserJson"].Get("result->" + i + "->PartyID"); //得到队伍ID
 | |
|             if (gPartyID == true || gPartyID == false) break; //如果读不到说明读完了 直接走
 | |
|             local gPartyCaptain = RootTab["LukeTownUserJson"].Get("result->" + i + "->PartyCaptain"); //得到是否为小队队长
 | |
|             local gPlayerGrowTypeJob = RootTab["LukeTownUserJson"].Get("result->" + i + "->PlayerGrowTypeJob"); //得到转职职业(String)
 | |
|             local gPlayerSession = RootTab["LukeTownUserJson"].Get("result->" + i + "->PlayerSession"); //得到世界编号
 | |
|             local gPlayerLevel = RootTab["LukeTownUserJson"].Get("result->" + i + "->PlayerLevel"); //得到等级
 | |
|             local gPlayerJob = RootTab["LukeTownUserJson"].Get("result->" + i + "->PlayerJob"); //得到基础职业
 | |
|             local gPlayerJobEx = RootTab["LukeTownUserJson"].Get("result->" + i + "->PlayerJobEx"); //得到基础职业
 | |
|             local gPlayerName = RootTab["LukeTownUserJson"].Get("result->" + i + "->PlayerName"); //得到玩家名字
 | |
|             local gCaptainBool = RootTab["LukeTownUserJson"].Get("result->" + i + "->CaptainBool"); //得到是否为攻坚队队长
 | |
|             local gMaterial = RootTab["LukeTownUserJson"].Get("result->" + i + "->isPrepare"); //得到是否拥有材料
 | |
|             local gCID = RootTab["LukeTownUserJson"].Get("result->" + i + "->CID"); //得到是否拥有材料
 | |
| 
 | |
|             local PlayerTab = {
 | |
|                 PartyID = gPartyID,
 | |
|                 PartyCaptain = gPartyCaptain,
 | |
|                 PlayerGrowTypeJob = gPlayerGrowTypeJob,
 | |
|                 PlayerSession = gPlayerSession,
 | |
|                 PlayerLevel = gPlayerLevel,
 | |
|                 PlayerJob = gPlayerJob,
 | |
|                 PlayerJobEx = gPlayerJobEx,
 | |
|                 PlayerName = gPlayerName,
 | |
|                 CaptainBool = gCaptainBool,
 | |
|                 Material = gMaterial,
 | |
|                 CID = gCID,
 | |
|             }
 | |
|             RootTab["LukeTOWNCONTROLINFO"].UserInfoMap.append(PlayerTab); //PlayerInfoTable丢进数组
 | |
|         }
 | |
| 
 | |
|     }
 | |
| 
 | |
|     constructor() {
 | |
|         UserUiMap = []; //小队成员UI Map
 | |
|         UserInfoMap = []; //小队成员Info Map
 | |
|         MySelfMap = {}; //自己
 | |
| 
 | |
|         //print("LukeTownControl_C ClassObject Succes");
 | |
|         Pack_Control.rawset(25600102, RedLukePlayerInfo);
 | |
|         Pack_Control.rawset(25600112, RedLukePlayerInfo);
 | |
|         UserUiMap.resize(20);
 | |
|     }
 | |
| 
 | |
|     function DrawPartyInfo(obj) {
 | |
|         for (local i = 0; i < UserInfoMap.len(); ++i) {
 | |
|             if (!UserUiMap[i]) UserUiMap[i] = LukeUserControl_C("LukeUserPlayer" + i, 308 + ((i % 2) * 223), 97 + ((i / 2) * 42), CaptainControl); //如果用户Map没有被实例化则实例化他
 | |
| 
 | |
|             UserUiMap[i].SetPlayerInfo(UserInfoMap[i]);
 | |
| 
 | |
|             UserUiMap[i].Run(obj);
 | |
|         }
 | |
|     }
 | |
| 
 | |
| 
 | |
| 
 | |
|     function Show(obj) {
 | |
|         //如果有攻坚队的具体信息才绘制
 | |
|         if (UserInfoMap.len() > 0) {
 | |
|             DrawPartyInfo(obj);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     function Run(obj) {
 | |
|         Show(obj);
 | |
|     }
 | |
| }
 | |
| 
 | |
| 
 | |
| 
 | |
| function LukeTownMainControl_PartyInfo(obj) {
 | |
|     local RootTab = getroottable();
 | |
|     if (RootTab.rawin("LukeTOWNCONTROLINFO") == false) {
 | |
|         local LukeTOWNCONTROLINFOOBJ = LukeTownControlInfo_C();
 | |
|         RootTab.rawset("LukeTOWNCONTROLINFO", LukeTOWNCONTROLINFOOBJ);
 | |
|     }
 | |
| 
 | |
| }
 | |
| 
 | |
| class LukePartyC extends BasicsDrawTool {
 | |
| 
 | |
|     X = 37;
 | |
|     Y = 38;
 | |
| 
 | |
|     State = 0; //攻坚队对象状态   0未打开  1打开界面
 | |
| 
 | |
| 
 | |
|     ListUiMap = null; //小队成员UI Map
 | |
|     ListInfoMap = null; //小队成员Info Map
 | |
| 
 | |
|     ListCount = null;
 | |
|     NowSelectTeam = null;
 | |
|     NowSelectTeamFunc = null; //当前选择队伍功能
 | |
|     MyTeamId = -1; //我的队伍Id
 | |
|     MyCaptainControl = 0; //我是否为攻坚队长
 | |
| 
 | |
|     ReloadingButtonObject = null; //刷新按钮
 | |
|     MyTeamButtonObject = null; //我的队伍按钮
 | |
|     LeftButtonObject = null; //左按钮
 | |
|     RightButtonObject = null; //右按钮
 | |
|     PartyReqButtonObject = null; //申请加入攻坚队伍按钮
 | |
|     PartyExitButtonObject = null; //退出攻坚队伍按钮
 | |
|     PartyStartButtonObject = null; //开始攻坚按钮
 | |
|     Page = 1;
 | |
| 
 | |
| 
 | |
|     //创建队伍和加入队伍事件
 | |
|     function SendPackEvent_JoinTeam_and_CreatTeam(Type) {
 | |
|         local JoinTeam_and_CreatTeam = Json_STL("JoinTeam_and_CreatTeam");
 | |
|         JoinTeam_and_CreatTeam.Put("op", 25600125);
 | |
|         local str = JoinTeam_and_CreatTeam.GetString();
 | |
|         L_sq_SendPackType(130);
 | |
|         L_sq_SendPackWChar(str);
 | |
|         L_sq_SendPack();
 | |
|         JoinTeam_and_CreatTeam.Delete();
 | |
|     }
 | |
| 
 | |
|     //退出队伍事件
 | |
|     function SendPackEvent_ExitTeam(Type) {
 | |
|         local ExitTeam = Json_STL("ExitTeam");
 | |
|         ExitTeam.Put("op", 25600129);
 | |
|         local str = ExitTeam.GetString();
 | |
|         L_sq_SendPackType(130);
 | |
|         L_sq_SendPackWChar(str);
 | |
|         L_sq_SendPack();
 | |
|         ExitTeam.Delete();
 | |
|     }
 | |
| 
 | |
|     //退出队伍请求
 | |
|     function PartyKickPlayer(chunk) {
 | |
|         print(chunk);
 | |
|         L_sq_SendPackType(13);
 | |
|         L_sq_SendPack();
 | |
|     }
 | |
| 
 | |
|     //委任队长事件
 | |
|     function PartyGiveM(chunk) {
 | |
|         local PartyGiveM = Json_STL("PartyGiveM");
 | |
|         PartyGiveM.Put("op", 25600123);
 | |
|         local str = PartyGiveM.GetString();
 | |
|         L_sq_SendPackType(130);
 | |
|         L_sq_SendPackWChar(str);
 | |
|         L_sq_SendPack();
 | |
|         PartyGiveM.Delete();
 | |
|     }
 | |
| 
 | |
|     constructor() {
 | |
| 
 | |
|         ListUiMap = [];
 | |
|         ListInfoMap = [];
 | |
|         ListUiMap.resize(10);
 | |
| 
 | |
|         Pack_Control.rawset(25600108, RedLukeListInfo);
 | |
|         Pack_Control.rawset(25600110, RedLukeListInfo);
 | |
| 
 | |
|                 //安图恩创建队伍和加入队伍事件
 | |
|         SendPackTypeTable.rawset(11, SendPackEvent_JoinTeam_and_CreatTeam);
 | |
|         SendPackTypeTable.rawset(12, SendPackEvent_JoinTeam_and_CreatTeam);
 | |
|         //安图恩退出队伍事件
 | |
|         SendPackTypeTable.rawset(13, SendPackEvent_ExitTeam);
 | |
|         //委任队长事件
 | |
|         SendPackTypeTable.rawset(124, PartyGiveM);
 | |
|         //玩家自己退出队伍
 | |
|         Pack_Control.rawset(1030, PartyKickPlayer);
 | |
|     }
 | |
| 
 | |
| 
 | |
|     //收包区
 | |
|     function RedLukeListInfo(chunk) {
 | |
|         //Sout("\n\n收到包数据: %L", chunk);
 | |
|         local RootTab = getroottable();
 | |
|         BasicsDrawTool.InitClass("LukeTownListJson"); //自动判断清空
 | |
|         local JsonObj = Json_STL("LukeTownListJsonBuffer");
 | |
|         RootTab.rawset("LukeTownListJson", JsonObj);
 | |
|         RootTab["LukeTownListJson"].Parse(chunk, 0, false);
 | |
| 
 | |
|         //清空自己的信息
 | |
|         RootTab["LukePartyObj"].ListInfoMap = [];
 | |
| 
 | |
|         //获取自己的攻坚队ID
 | |
|         local gMyTeamId = RootTab["LukeTownListJson"].Get("MyTeamId");
 | |
|         if (gMyTeamId) RootTab["LukePartyObj"].MyTeamId = gMyTeamId;
 | |
| 
 | |
|         //获取自己是否为攻坚队队长
 | |
|         local gMyCaptain = RootTab["LukeTownListJson"].Get("MyCaptain");
 | |
|         if (gMyCaptain) RootTab["LukePartyObj"].MyCaptainControl = gMyCaptain;
 | |
| 
 | |
|         RootTab["LukePartyObj"].ListCount = RootTab["LukeTownListJson"].Get("ListCount").tointeger();
 | |
|         //写入小队成员信息
 | |
|         for (local i = 0; i < RootTab["LukePartyObj"].ListCount; i++) {
 | |
|             local gTeamId = RootTab["LukeTownListJson"].Get("result->" + i + "->TeamId"); //得到攻坚队伍ID
 | |
|             if (gTeamId == true || gTeamId == false) break; //如果读不到说明读完了 直接走
 | |
|             local gTeamName = RootTab["LukeTownListJson"].Get("result->" + i + "->TeamName"); //得到攻坚队名称
 | |
|             local gState = RootTab["LukeTownListJson"].Get("result->" + i + "->State"); //得到队伍状态
 | |
|             local gTeamPlayerCount = RootTab["LukeTownListJson"].Get("result->" + i + "->TeamPlayerCount"); //得到队伍人数
 | |
| 
 | |
|             local ListTab = {
 | |
|                 TeamId = gTeamId,
 | |
|                 TeamName = gTeamName,
 | |
|                 State = gState,
 | |
|                 TeamPlayerCount = gTeamPlayerCount,
 | |
|             }
 | |
|             RootTab["LukePartyObj"].ListInfoMap.append(ListTab); //ListTabInfoTable丢进数组
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     //收包区
 | |
| 
 | |
| 
 | |
|     //发包区
 | |
|     //获取卢克攻坚队列表信息 //TODO op未更改
 | |
|     function GetLukeTeamList() {
 | |
|         local GetLukeTeamList = Json_STL("GetLukeTeamList");
 | |
|         GetLukeTeamList.Put("op", 25600107);
 | |
|         GetLukeTeamList.Put("Page", 1);
 | |
|         local str = GetLukeTeamList.GetString();
 | |
|         L_sq_SendPackType(130);
 | |
|         L_sq_SendPackWChar(str);
 | |
|         L_sq_SendPack();
 | |
|         GetLukeTeamList.Delete();
 | |
|     }
 | |
| 
 | |
|     //发包区
 | |
| 
 | |
| 
 | |
| 
 | |
|     function DrawMain(obj) {
 | |
|         //绘制主界面
 | |
|         {
 | |
|             T_DrawStayAni(obj, "common/Anton/new/newbaseui.ani", X, Y, 0, "安图恩队伍列表界面");
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     //绘制攻坚队伍页面控制
 | |
|     function DrawPartyListPageConctrl(obj) {
 | |
|         if (!ListCount) return;
 | |
|         //绘制攻坚队伍数量
 | |
|         local ListMaxPage = (ListCount / 12).tointeger() + 1;
 | |
|         L_Code_STL(Page.tostring() + " / " + ListMaxPage.tostring(), X + 41, Y + 293, 0xFFFFFFFF, 1);
 | |
|         //如果不止1页
 | |
|         if (ListMaxPage > 1) {
 | |
|             //左按钮
 | |
|             {
 | |
|                 if (LeftButtonObject == null) {
 | |
|                     LeftButtonObject = LukeButtonPro(obj, "LukePartyListLeftButton", X + 17, Y + 292, "common/Anton/new/newbasebutton.ani", 15, 13, 0);
 | |
|                     LeftButtonObject.SetRectEnble(true, "LukePartyListLeftButtonr", X + 17, Y + 292, "common/Anton/new/newbasebutton.ani", 1);
 | |
|                     LeftButtonObject.SetCustomClickEnble(true, "LukePartyListLeftButtonc", X + 17, Y + 293, "common/Anton/new/newbasebutton.ani", 2);
 | |
|                 }
 | |
|                 LeftButtonObject.Show();
 | |
|                 if (LeftButtonObject.isLBActive()) {
 | |
|                     obj.sq_PlaySound("CLICK_BUTTON2");
 | |
|                     if (Page > 1) --Page;
 | |
|                     local GetLukeTeamList = Json_STL("GetLukeTeamList");
 | |
|                     GetLukeTeamList.Put("op", 1007);
 | |
|                     GetLukeTeamList.Put("Page", Page);
 | |
|                     local str = GetLukeTeamList.GetString();
 | |
|                     L_sq_SendPackType(130);
 | |
|                     L_sq_SendPackWChar(str);
 | |
|                     L_sq_SendPack();
 | |
|                     GetLukeTeamList.Delete();
 | |
|                 }
 | |
|             }
 | |
| 
 | |
|             //右按钮
 | |
|             {
 | |
|                 if (RightButtonObject == null) {
 | |
|                     RightButtonObject = LukeButtonPro(obj, "LukePartyListRightButton", X + 75, Y + 292, "common/Anton/new/newbasebutton.ani", 15, 13, 3);
 | |
|                     RightButtonObject.SetRectEnble(true, "LukePartyListRightButtonr", X + 75, Y + 292, "common/Anton/new/newbasebutton.ani", 4);
 | |
|                     RightButtonObject.SetCustomClickEnble(true, "LukePartyListRightButtonc", X + 75, Y + 293, "common/Anton/new/newbasebutton.ani", 5);
 | |
|                 }
 | |
|                 RightButtonObject.Show();
 | |
|                 if (RightButtonObject.isLBActive()) {
 | |
|                     obj.sq_PlaySound("CLICK_BUTTON2");
 | |
|                     if (Page < ListMaxPage) ++Page;
 | |
|                     local GetLukeTeamList = Json_STL("GetLukeTeamList");
 | |
|                     GetLukeTeamList.Put("op", 1007);
 | |
|                     GetLukeTeamList.Put("Page", Page);
 | |
|                     local str = GetLukeTeamList.GetString();
 | |
|                     L_sq_SendPackType(130);
 | |
|                     L_sq_SendPackWChar(str);
 | |
|                     L_sq_SendPack();
 | |
|                     GetLukeTeamList.Delete();
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     //绘制攻坚队列表信息
 | |
|     function DrawPartyListInfo(obj) {
 | |
|         //已经开始的  0xFF676665  灰色
 | |
|         //可以申请的  0xFFddddea  珍珠白
 | |
|         //可以申请的  0xFF4990aa  定义黄
 | |
|         if (!ListCount) return;
 | |
|         local Min = 0 + (12 * (Page - 1));
 | |
|         local Max = 12 * Page;
 | |
|         for (local i = Min; i < ListCount % Max; ++i) {
 | |
|             T_DrawStayAni(obj, "common/Anton/new/newbaseui.ani", X + 15, Y + 61 + (19 * i), 1, "安图恩队伍列表底框" + i);
 | |
| 
 | |
|             //阶段
 | |
|             local stage = 5;
 | |
|             if (ListInfoMap[i].State >= 1 && ListInfoMap[i].State <= 3) stage = 6;
 | |
|             if (ListInfoMap[i].State >= 4 && ListInfoMap[i].State <= 5) stage = 7;
 | |
|             if (ListInfoMap[i].State >= 6) stage = 8;
 | |
| 
 | |
|             T_DrawStayAni(obj, "common/Anton/new/newbaseui.ani", X + 18, Y + 62 + (19 * i), stage, "安图恩队伍列表底框" + stage);
 | |
| 
 | |
|             local Color = null;
 | |
|             if (ListInfoMap[i].State != 3) {
 | |
|                 Color = 0xFF4990aa;
 | |
|             } else {
 | |
|                 Color = 0xFF676665;
 | |
|             }
 | |
| 
 | |
|             //绘制攻坚队名称
 | |
|             local TeamNameStr = ListInfoMap[i].TeamName;
 | |
| 
 | |
|             L_Code_STL(TeamNameStr, X + 60, Y + 64 + (19 * i), Color, 1);
 | |
| 
 | |
|             //绘制攻坚队人数
 | |
|             local PlayerCountStr = ListInfoMap[i].TeamPlayerCount + "/20";
 | |
|             L_Code_STL(PlayerCountStr, X + 205, Y + 64 + (19 * i), Color, 1);
 | |
| 
 | |
|             ListUiMap[i] = LukeButtonPro(obj, "LukePartyListSwitchButton" + TeamNameStr, X + 15, Y + 61 + (19 * i), "common/Anton/new/newnull.ani", 255, 15, 0);
 | |
|             ListUiMap[i].SetRectEnble(true, "LukePartyListSwitchButtonr" + TeamNameStr, X + 15, Y + 61 + (19 * i), "common/Anton/new/newbaseui.ani", 3);
 | |
|             ListUiMap[i].Show();
 | |
| 
 | |
|             if (ListUiMap[i].isLBActive()) {
 | |
|                 obj.sq_PlaySound("CLICK_BUTTON1");
 | |
|                 NowSelectTeam = i;
 | |
| 
 | |
|                 local GetLukeTeamInfo = Json_STL("GetLukeTeamInfo");
 | |
|                 GetLukeTeamInfo.Put("op", 25600111);
 | |
|                 GetLukeTeamInfo.Put("TeamId", ListInfoMap[i].TeamId);
 | |
|                 local str = GetLukeTeamInfo.GetString();
 | |
|                 L_sq_SendPackType(130);
 | |
|                 L_sq_SendPackWChar(str);
 | |
|                 L_sq_SendPack();
 | |
|                 GetLukeTeamInfo.Delete();
 | |
|             }
 | |
| 
 | |
|             //当前选择队伍不为空 并且等于当前的i
 | |
|             if (NowSelectTeam != null && NowSelectTeam == i) {
 | |
|                 local Ani = T_DrawStayAni(obj, "common/Anton/new/newbaseui.ani", X + 15, Y + 61 + (19 * i), 2, "安图恩队伍列表界面当前选中");
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     //绘制攻坚队列表功能按钮
 | |
|     function DrawPartyListFuncButton(obj) {
 | |
|         //刷新攻坚队
 | |
|         {
 | |
|             if (ReloadingButtonObject == null) {
 | |
|                 ReloadingButtonObject = LukeButtonPro(obj, "LukePartyListReloadingButton", X + 96, Y + 291, "common/Anton/new/newbasebutton.ani", 46, 17, 7);
 | |
|                 ReloadingButtonObject.SetRectEnble(true, "LukePartyListReloadingButtonr", X + 96, Y + 291, "common/Anton/new/newbasebutton.ani", 8);
 | |
|                 ReloadingButtonObject.SetCustomClickEnble(true, "LukePartyListReloadingButtonc", X + 96, Y + 291, "common/Anton/new/newbasebutton.ani", 9);
 | |
|             }
 | |
|             ReloadingButtonObject.Show();
 | |
|             if (ReloadingButtonObject.isLBActive()) {
 | |
|                 obj.sq_PlaySound("CLICK_BUTTON1");
 | |
|                 local GetLukeTeamList = Json_STL("GetLukeTeamList");
 | |
|                 GetLukeTeamList.Put("op", 25600107);
 | |
|                 GetLukeTeamList.Put("Page", Page);
 | |
|                 local str = GetLukeTeamList.GetString();
 | |
|                 L_sq_SendPackType(130);
 | |
|                 L_sq_SendPackWChar(str);
 | |
|                 L_sq_SendPack();
 | |
|                 GetLukeTeamList.Delete();
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         //我的攻坚队
 | |
|         {
 | |
|             if (MyTeamId == -1) {
 | |
|                 T_DrawStayAni(obj, "common/Anton/new/newbasebutton.ani", X + 96 + 48 + 3, Y + 291, 10, "安图恩队伍列表我的攻坚队不可用");
 | |
|             } else {
 | |
|                 if (MyTeamButtonObject == null) {
 | |
|                     MyTeamButtonObject = LukeButtonPro(obj, "LukePartyListMyTeamButton", X + 96 + 48 + 3, Y + 291, "common/Anton/new/newbasebutton.ani", 97, 23, 11);
 | |
|                     MyTeamButtonObject.SetRectEnble(true, "LukePartyListMyTeamButtonr", X + 96 + 48 + 3, Y + 291, "common/Anton/new/newbasebutton.ani", 12);
 | |
|                     MyTeamButtonObject.SetCustomClickEnble(true, "LukePartyListMyTeamButtonc", X + 96 + 48 + 3, Y + 291, "common/Anton/new/newbasebutton.ani", 13);
 | |
|                 }
 | |
|                 MyTeamButtonObject.Show();
 | |
|                 if (MyTeamButtonObject.isLBActive()) {
 | |
|                     obj.sq_PlaySound("CLICK_BUTTON1");
 | |
|                     local GetLukeTeamList = Json_STL("GetLukeTeamList");
 | |
|                     GetLukeTeamList.Put("op", 1011);
 | |
|                     local str = GetLukeTeamList.GetString();
 | |
|                     L_sq_SendPackType(130);
 | |
|                     L_sq_SendPackWChar(str);
 | |
|                     L_sq_SendPack();
 | |
|                     GetLukeTeamList.Delete();
 | |
|                     NowSelectTeam = -1;
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     //绘制攻坚队请求按钮
 | |
|     function DrawPartyReqButton(obj) {
 | |
|         if (MyTeamId == -1) {
 | |
|             //申请加入
 | |
|             {
 | |
|                 if (PartyReqButtonObject == null) {
 | |
|                     PartyReqButtonObject = LukeButtonPro(obj, "LukePartyListReloadingButton", X + 636, Y + 500, "common/Anton/new/newbasebutton.ani", 70, 17, 14);
 | |
|                     PartyReqButtonObject.SetRectEnble(true, "LukePartyListReloadingButtonr", X + 636, Y + 500, "common/Anton/new/newbasebutton.ani", 15);
 | |
|                     PartyReqButtonObject.SetCustomClickEnble(true, "LukePartyListReloadingButtonc", X + 636, Y + 500, "common/Anton/new/newbasebutton.ani", 16);
 | |
|                 }
 | |
|                 PartyReqButtonObject.Show();
 | |
|                 if (PartyReqButtonObject.isLBActive()) {
 | |
|                     obj.sq_PlaySound("CLICK_BUTTON4");
 | |
|                     local LukeJoinPartyReq = Json_STL("LukeJoinPartyReq");
 | |
|                     LukeJoinPartyReq.Put("op", 25600103);
 | |
|                     LukeJoinPartyReq.Put("TeamId", ListInfoMap[NowSelectTeam].TeamId);
 | |
|                     local str = LukeJoinPartyReq.GetString();
 | |
|                     L_sq_SendPackType(130);
 | |
|                     L_sq_SendPackWChar(str);
 | |
|                     L_sq_SendPack();
 | |
|                     LukeJoinPartyReq.Delete();
 | |
|                 }
 | |
|             }
 | |
|         } else {
 | |
|             //退出攻坚队
 | |
|             {
 | |
|                 if (PartyExitButtonObject == null) {
 | |
|                     PartyExitButtonObject = LukeButtonPro(obj, "LukePartyListReloadingButton", X + 636, Y + 500, "common/Anton/new/newbasebutton.ani", 70, 17, 17);
 | |
|                     PartyExitButtonObject.SetRectEnble(true, "LukePartyListReloadingButtonr", X + 636, Y + 500, "common/Anton/new/newbasebutton.ani", 18);
 | |
|                     PartyExitButtonObject.SetCustomClickEnble(true, "LukePartyListReloadingButtonc", X + 636, Y + 500, "common/Anton/new/newbasebutton.ani", 19);
 | |
|                 }
 | |
|                 PartyExitButtonObject.Show();
 | |
|                 if (PartyExitButtonObject.isLBActive()) {
 | |
|                     obj.sq_PlaySound("CLICK_BUTTON4");
 | |
|                     local LukeExitPartyReq = Json_STL("LukeExitPartyReq");
 | |
|                     LukeExitPartyReq.Put("op", 25600105);
 | |
|                     local str = LukeExitPartyReq.GetString();
 | |
|                     L_sq_SendPackType(130);
 | |
|                     L_sq_SendPackWChar(str);
 | |
|                     L_sq_SendPack();
 | |
|                     LukeExitPartyReq.Delete();
 | |
|                     NowSelectTeam = null; //关闭队伍详细信息显示
 | |
|                     MyTeamId = -1; //清空自己的队伍信息
 | |
| 
 | |
|                     //清除正在攻坚的信息
 | |
|                     local RootTab = getroottable();
 | |
|                     RootTab.rawdelete("LUKEDUNGEONINFOCONTROL");
 | |
|                 }
 | |
|             }
 | |
|             //开始攻坚
 | |
|             {
 | |
|                 local RootTab = getroottable();
 | |
|                 //如果自己是攻坚队队长 并且 攻坚状态为未开启
 | |
|                 if (MyCaptainControl == 1 && RootTab.rawin("LUKEDUNGEONINFOCONTROL") && (RootTab["LUKEDUNGEONINFOCONTROL"].State == -1 || RootTab["LUKEDUNGEONINFOCONTROL"].State == 2)) {
 | |
|                     if (PartyStartButtonObject == null) {
 | |
|                         PartyStartButtonObject = LukeButtonPro(obj, "LukePartyListReloadingButton", X + 536, Y + 500, "common/Anton/new/newbasebutton.ani", 70, 17, 29);
 | |
|                         PartyStartButtonObject.SetRectEnble(true, "LukePartyListReloadingButtonr", X + 536, Y + 500, "common/Anton/new/newbasebutton.ani", 30);
 | |
|                         PartyStartButtonObject.SetCustomClickEnble(true, "LukePartyListReloadingButtonc", X + 536, Y + 500, "common/Anton/new/newbasebutton.ani", 31);
 | |
|                     }
 | |
|                     PartyStartButtonObject.Show();
 | |
|                     if (PartyStartButtonObject.isLBActive()) {
 | |
|                         obj.sq_PlaySound("CLICK_BUTTON4");
 | |
|                         local LukePartyStart = Json_STL("LukePartyStart");
 | |
|                         local op = 25600141;
 | |
|                         //默认一阶段 如果是二阶段则发1047包二阶段开始
 | |
|                         if (RootTab["LUKEDUNGEONINFOCONTROL"].State == 2) op = 25600147;
 | |
|                         LukePartyStart.Put("op", op);
 | |
|                         local str = LukePartyStart.GetString();
 | |
|                         L_sq_SendPackType(130);
 | |
|                         L_sq_SendPackWChar(str);
 | |
|                         L_sq_SendPack();
 | |
|                         LukePartyStart.Delete();
 | |
|                     }
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| 
 | |
| 
 | |
|     function Draw(obj) {
 | |
|         if (State == 1) {
 | |
|             //绘制主界面
 | |
|             DrawMain(obj);
 | |
|             //绘制攻坚队伍页面控制
 | |
|             DrawPartyListPageConctrl(obj);
 | |
|             //绘制攻坚队列表信息
 | |
|             DrawPartyListInfo(obj);
 | |
|             //绘制攻坚队列表功能按钮
 | |
|             DrawPartyListFuncButton(obj);
 | |
|             //绘制攻坚队请求按钮
 | |
|             DrawPartyReqButton(obj);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     function Run(obj) {
 | |
| 
 | |
|         if (State == 0) {
 | |
|             local ButtonObject = ButtonPro(obj, "RankSystemMainSwitchButton", 15, 300, "common/training/main/maintab.ani", 39, 35);
 | |
|             ButtonObject.SetRectEnble(true, "RankSystemMainSwitchButtonr", 15, 300, "common/training/main/maintab.ani", 0);
 | |
|             ButtonObject.SetCustomClickEnble(true, "RankSystemMainSwitchButtonc", 15, 300, "common/training/main/maintab.ani", 0);
 | |
|             ButtonObject.Show();
 | |
|             //按下打开按钮
 | |
|             if (ButtonObject.isLBActive()) {
 | |
|                 State = 1;
 | |
|                 L_NewWindows("Lenheart", 267, 0x65535);
 | |
|                 GetLukeTeamList();
 | |
|             }
 | |
|         } else if (State == 1) {
 | |
|             if (!sq_GetPopupWindowMainCotrol(267)) {
 | |
|                 State = 0;
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| }
 | |
| 
 | |
| function LukeParty(obj) {
 | |
|     local RootTab = getroottable();
 | |
|     if (RootTab.rawin("LukePartyObj") == false) {
 | |
|         local Buffer = LukePartyC();
 | |
|         RootTab.rawset("LukePartyObj", Buffer);
 | |
|     } else {
 | |
|         RootTab["LukePartyObj"].Run(obj);
 | |
|     }
 | |
| } |