108 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
		
		
			
		
	
	
			108 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
|  | /* | ||
|  | 文件名:antontownmainbutton.nut | ||
|  | 路径:Plugins/Anton/antontownmainbutton.nut | ||
|  | 创建日期:2022-09-04	08:54 | ||
|  | 文件用途:城镇中打开安图恩攻坚队面板按钮部分 | ||
|  | */ | ||
|  | 
 | ||
|  | class AntonTeamMainButtonC extends BasicsDrawTool { | ||
|  |     ButtonObject = null; | ||
|  |     State = 0; | ||
|  |     WindowSwitch = false; | ||
|  | 
 | ||
|  |     //创建队伍和加入队伍事件 | ||
|  |     function SendPackEvent_JoinTeam_and_CreatTeam(Type) { | ||
|  |         local JoinTeam_and_CreatTeam = Json_STL("JoinTeam_and_CreatTeam"); | ||
|  |         JoinTeam_and_CreatTeam.Put("op", 1025); | ||
|  |         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", 1029); | ||
|  |         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", 1023); | ||
|  |         local str = PartyGiveM.GetString(); | ||
|  |         L_sq_SendPackType(130); | ||
|  |         L_sq_SendPackWChar(str); | ||
|  |         L_sq_SendPack(); | ||
|  |         PartyGiveM.Delete(); | ||
|  |     } | ||
|  | 
 | ||
|  |     constructor(obj) { | ||
|  |         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); | ||
|  | 
 | ||
|  |         //安图恩创建队伍和加入队伍事件 | ||
|  |         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 Run(obj) { | ||
|  |         if (State == 0 && !sq_GetPopupWindowMainCotrol(267)) { | ||
|  |             ButtonObject.Show(); | ||
|  |             if (ButtonObject.isLBActive()) { | ||
|  |                 State = 1; | ||
|  |                 L_NewWindows("Lenheart", 267, 0x65535); | ||
|  | 
 | ||
|  |                 local GetAntonTeamList = Json_STL("GetAntonTeamList"); | ||
|  |                 GetAntonTeamList.Put("op", 1007); | ||
|  |                 GetAntonTeamList.Put("Page", 1); | ||
|  |                 local str = GetAntonTeamList.GetString(); | ||
|  |                 L_sq_SendPackType(130); | ||
|  |                 L_sq_SendPackWChar(str); | ||
|  |                 L_sq_SendPack(); | ||
|  |                 GetAntonTeamList.Delete(); | ||
|  |             } | ||
|  |         } else if (State == 1 && !sq_GetPopupWindowMainCotrol(267)) { | ||
|  |             local RootTab = getroottable(); | ||
|  |             RootTab["ANTONTOWNMAINCONTROLLIST"].NowSelectTeamFunc = null; //把功能选择页关掉 | ||
|  |             RootTab["ANTONTOWNMAINCONTROLLIST"].NowSelectTeam = null; //把功能选择页关掉 | ||
|  |             State = 0; | ||
|  |             WindowSwitch = false; | ||
|  |         } else if (State == 1 && sq_GetPopupWindowMainCotrol(267)) { | ||
|  |             WindowSwitch = true; | ||
|  |         } | ||
|  |     } | ||
|  | } | ||
|  | 
 | ||
|  | local RootTab = getroottable(); | ||
|  | RootTab.rawdelete("ANTONTEAMMAINBUTTON"); | ||
|  | 
 | ||
|  | function AntonTownMainButtonControl(obj) { | ||
|  |     local RootTab = getroottable(); | ||
|  |     if (RootTab.rawin("ANTONTEAMMAINBUTTON") == false) { | ||
|  |         local ANTONTEAMMAINBUTTONOBJ = AntonTeamMainButtonC(obj); | ||
|  |         RootTab.rawset("ANTONTEAMMAINBUTTON", ANTONTEAMMAINBUTTONOBJ); | ||
|  |     } else { | ||
|  |         RootTab["ANTONTEAMMAINBUTTON"].Run(obj); | ||
|  |     } | ||
|  | } |