252 lines
		
	
	
		
			8.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
		
		
			
		
	
	
			252 lines
		
	
	
		
			8.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
|  | /* | ||
|  | 文件名:FiendwarPartyInfo.nut | ||
|  | 路径:Plugins/Fiendwar/FiendwarPartyInfo.nut | ||
|  | 创建日期:2024-03-27	19:18 | ||
|  | 文件用途:超时空攻坚队队伍信息窗口 | ||
|  | */ | ||
|  | class FiendwarPartyInfoC extends LenheartNewUI_Windows { | ||
|  |     //调试模式 | ||
|  |     // DeBugMode = true; | ||
|  | 
 | ||
|  |     //队员列表 | ||
|  |     MembersList = null; | ||
|  | 
 | ||
|  |     //队伍名称 | ||
|  |     TeamName = ""; | ||
|  |     //队伍ID | ||
|  |     TeamID = 99999999; | ||
|  | 
 | ||
|  |     //是否是我的攻坚队 | ||
|  |     IsMyTeam = false; | ||
|  |     //是否是队长 | ||
|  |     IsCaptain = false; | ||
|  | 
 | ||
|  | 
 | ||
|  | 
 | ||
|  |     //收到请求加入攻坚队包 | ||
|  |     function JoinTeamCallBack(Chunk) { | ||
|  |         // Sout("收到请求加入包 : \n\n\n %L", Chunk); | ||
|  |         local Jso = Json.Decode(Chunk); | ||
|  |         local win = LenheartNewUI_CreateWindow(FiendwarHallApplyJoinC, "超时空申请加入队伍窗口", 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(20063006, JoinTeamCallBack.bindenv(this)); | ||
|  | 
 | ||
|  |     } | ||
|  | 
 | ||
|  |     function RegisterWidget() { | ||
|  |         //清除老的按钮在刷新 | ||
|  |         RemoveChilds(FiendwarPartyInfoMemberC, false); | ||
|  |         //关闭按钮 | ||
|  |         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 Striiu = "入场材料"; | ||
|  |         if (FiendwarTotal.GetInstance().EndTime) Striiu = "通关次数"; | ||
|  |         local StageButton = LenheartNewUI_ButtonText(289, 60, 0, Striiu); | ||
|  |         StageButton.Idx = 163; | ||
|  |         StageButton.DWidth = 26; | ||
|  |         StageButton.FillWidth = 1; | ||
|  |         StageButton.FirstWidth = 21; | ||
|  |         StageButton.SetTextOffset(-14, 1); | ||
|  |         AddChild(StageButton); | ||
|  | 
 | ||
|  |         //如果不是我的队伍 并且我没有攻坚队 | ||
|  |         if (!IsMyTeam && !FiendwarTotal.GetInstance().MyPartyId) { | ||
|  |             local JoinPartyButton = LenheartNewUI_ButtonText(10, 268, 10, "参加攻坚队"); | ||
|  |             JoinPartyButton.SetTextOffset(-15, 1); | ||
|  |             JoinPartyButton.OnClick = function() { | ||
|  |                 local T = { | ||
|  |                     op = 20063005, | ||
|  |                     teamsId = TeamID, | ||
|  |                     items = [L_sq_GetCharacterAttribute(0x1c, 21), L_sq_GetCharacterAttribute(0x1c, 15), L_sq_GetCharacterAttribute(0x1c, 14), L_sq_GetCharacterAttribute(0x1c, 13)], | ||
|  |                 } | ||
|  |                 Rindro_BaseToolClass.SendPackEx(T); | ||
|  |             }.bindenv(this); | ||
|  |             AddChild(JoinPartyButton); | ||
|  |         } | ||
|  | 
 | ||
|  |         //如果是我的队伍 | ||
|  |         if (IsMyTeam) { | ||
|  |             //退出按钮 | ||
|  |             local ExitButton = LenheartNewUI_ButtonText(220, 268, 5, "退出"); | ||
|  |             ExitButton.SetTextOffset(-1, 1); | ||
|  |             ExitButton.OnClick = function() { | ||
|  |                 local T = { | ||
|  |                     op = 20063009, | ||
|  |                     teamsId = TeamID | ||
|  |                 } | ||
|  |                 Rindro_BaseToolClass.SendPackEx(T); | ||
|  |                 FiendwarTotal.GetInstance().MyCid = null; | ||
|  |                 FiendwarTotal.GetInstance().MyPartyId = null; | ||
|  |                 FiendwarTotal.GetInstance().IsCaptain = null; | ||
|  |             }.bindenv(this); | ||
|  |             AddChild(ExitButton); | ||
|  | 
 | ||
|  |             if (IsCaptain) { | ||
|  |                 //队伍编制按钮 | ||
|  |                 local PartyEditButton = LenheartNewUI_ButtonText(10, 268, 5, "队伍编制"); | ||
|  |                 PartyEditButton.SetTextOffset(-12, 1); | ||
|  |                 PartyEditButton.OnClick = function() { | ||
|  |                     local win = LenheartNewUI_CreateWindow(FiendwarPartyFormation, "超时空我的队伍编队窗口", 105, 40, 294, 192, 18); | ||
|  |                     win.Visible = true; | ||
|  |                 }.bindenv(this); | ||
|  |                 AddChild(PartyEditButton); | ||
|  | 
 | ||
|  |                 //修改信息按钮 | ||
|  |                 local FqButton = LenheartNewUI_ButtonText(100, 267, 5, "修改信息"); | ||
|  |                 FqButton.State = 8; | ||
|  |                 FqButton.SetTextOffset(-12, 1); | ||
|  |                 AddChild(FqButton); | ||
|  | 
 | ||
|  |                 //队伍招募按钮 | ||
|  |                 local FqButton1 = LenheartNewUI_ButtonText(160, 267, 5, "队伍招募"); | ||
|  |                 FqButton1.State = 8; | ||
|  |                 FqButton1.SetTextOffset(-12, 1); | ||
|  |                 AddChild(FqButton1); | ||
|  | 
 | ||
|  |                 if (!FiendwarTotal.GetInstance().EndTime) { | ||
|  |                     //队伍招募按钮 | ||
|  |                     local FightOpenButton = LenheartNewUI_ButtonText(290, 268, 5, "开始攻坚"); | ||
|  |                     FightOpenButton.SetTextOffset(-12, 1); | ||
|  |                     FightOpenButton.OnClick = function() { | ||
|  |                         local T = { | ||
|  |                             op = 20063051, | ||
|  |                             teamsId = TeamID | ||
|  |                         } | ||
|  |                         Rindro_BaseToolClass.SendPackEx(T); | ||
|  |                     }.bindenv(this); | ||
|  |                     AddChild(FightOpenButton); | ||
|  |                 } | ||
|  |             } | ||
|  |         } | ||
|  |     } | ||
|  | 
 | ||
|  | 
 | ||
|  |     //绘制主界面 | ||
|  |     function DrawMain(obj) { | ||
|  |         //标题栏 | ||
|  |         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, 250, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13); | ||
|  |         //绘制头图 | ||
|  |         L_sq_DrawImg("interface2/gcontents/180621_fiendwar/raid/memberwindow.img", 0, X + 10, Y + 24); | ||
|  |         //绘制阶段图 //TODO 根据阶段绘制img | ||
|  |         L_sq_DrawImg("hud/fiendwarl.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(FiendwarHallPlayerInteractiveC, "超时空玩家交互", X, Y, 100, 21, 0); | ||
|  |             Each.Visible = false; | ||
|  |         } | ||
|  | 
 | ||
|  |     } | ||
|  | } |