121 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
		
		
			
		
	
	
			121 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
|  | /* | ||
|  | 文件名:Rindro_Fiendwar_PartyFormation.nut | ||
|  | 路径:Plugins/New_Fiendwar/Rindro_Fiendwar_PartyFormation.nut | ||
|  | 创建日期:2024-07-16	16:22 | ||
|  | 文件用途:超时空 队内编队 | ||
|  | */ | ||
|  | //编队用按钮需要传递参数所以重写 | ||
|  | class Rindro_FiendwarPartyInfoEdit_BaseButton extends LenheartNewUI_BaseButton { | ||
|  |     MyInfoIndex = 0; | ||
|  |     constructor(X, Y, W, H, Path, Idx, InfoIndex) { | ||
|  |         MyInfoIndex = InfoIndex; | ||
|  |         LenheartNewUI_BaseButton.constructor(X, Y, W, H, Path, Idx); | ||
|  |     } | ||
|  | 
 | ||
|  |     //鼠标左键弹起回调 | ||
|  |     function OnMouseLbUp(MousePos_X, MousePos_Y) { | ||
|  |         if (isLBDown && OnClick) { | ||
|  |             OnClick(MyInfoIndex); | ||
|  |         } | ||
|  |         isLBDown = false; | ||
|  |     } | ||
|  | } | ||
|  | //编队窗口 | ||
|  | class Rindro_FiendwarPartyFormation extends LenheartNewUI_Windows { | ||
|  |     //调试模式 | ||
|  |     // DeBugMode = true; | ||
|  |     Visible = false; | ||
|  | 
 | ||
|  |     PartyMarkFlag = -1; | ||
|  | 
 | ||
|  |     constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { | ||
|  |         Childrens = []; | ||
|  |         //注册控件 | ||
|  |         RegisterWidget(); | ||
|  | 
 | ||
|  |         LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); | ||
|  |     } | ||
|  | 
 | ||
|  | 
 | ||
|  |     function RegisterWidget() { | ||
|  |         //关闭按钮 | ||
|  |         local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); | ||
|  |         CloseButton.OnClick = function() { | ||
|  |             CloseWindow(); | ||
|  |         }.bindenv(this); | ||
|  |         AddChild(CloseButton); | ||
|  | 
 | ||
|  |         //搜索按钮 | ||
|  |         local QdButton = LenheartNewUI_ButtonText(10, 157, 5, "签到"); | ||
|  |         QdButton.State = 8; | ||
|  |         QdButton.SetTextOffset(0, 1); | ||
|  |         AddChild(QdButton); | ||
|  | 
 | ||
|  |         //解散队伍按钮 | ||
|  |         local BreakPartyButton = LenheartNewUI_ButtonText(80, 158, 5, "解散队伍"); | ||
|  |         BreakPartyButton.SetTextOffset(-12, 1); | ||
|  |         BreakPartyButton.OnClick = function() { | ||
|  |             PartyMarkFlag = 99; | ||
|  |         }.bindenv(this); | ||
|  |         AddChild(BreakPartyButton); | ||
|  | 
 | ||
|  |         //关闭按钮 | ||
|  |         local CloseButton = LenheartNewUI_ButtonText(150, 158, 5, "关闭"); | ||
|  |         CloseButton.SetTextOffset(0, 1); | ||
|  |         CloseButton.OnClick = function() { | ||
|  |             CloseWindow(); | ||
|  |         }.bindenv(this); | ||
|  |         AddChild(CloseButton); | ||
|  | 
 | ||
|  |         for (local i = 0; i< 8; i++) { | ||
|  |             //右翻页按钮 | ||
|  |             local PartyIndexButton = Rindro_FiendwarPartyInfoEdit_BaseButton(12 + (i % 2 * 136), 35 + ((i / 2) * 30), 41, 17, "interface/newstyle/windows/party/party_icon.img", 3 + (i * 3), i); | ||
|  |             //继承类 并重写 调用时传入InfoIndex | ||
|  |             PartyIndexButton.OnClick = function(MyInfoIndex) { | ||
|  |                 PartyMarkFlag = MyInfoIndex; | ||
|  |             }.bindenv(this); | ||
|  |             AddChild(PartyIndexButton); | ||
|  |         } | ||
|  |     } | ||
|  | 
 | ||
|  |     //绘制主界面 | ||
|  |     function DrawMain(obj) { | ||
|  |         //标题栏 | ||
|  |         L_sq_DrawButton(X - 1, Y, 284, "interface/lenheartwindowcommon.img", 609, 2, 7); | ||
|  |         //Item信息框一般为211的宽度 | ||
|  |         L_sq_DrawWindow(X, Y + 17, 272, 154, "interface/lenheartwindowcommon.img", 213, 12, 2, 13, 2); | ||
|  | 
 | ||
|  |         for (local q = 0; q< 8; q++) { | ||
|  |             L_sq_DrawImg("interface/lenheartwindowcommon.img", 358, X + 60 + (q % 2 * 136), Y + 34 + ((q / 2) * 30)); | ||
|  |             for (local i = 0; i< 3; i++) { | ||
|  |                 L_sq_DrawImg("interface/lenheartwindowcommon.img", 361, X + 80 + (q % 2 * 136) + (i * 20), Y + 34 + ((q / 2) * 30)); | ||
|  |             } | ||
|  |         } | ||
|  | 
 | ||
|  |         if (PartyMarkFlag != -1) { | ||
|  |             R_Mouse.SetType(151); | ||
|  |         } | ||
|  |     } | ||
|  | 
 | ||
|  |     function Show(obj) { | ||
|  |         DrawMain(obj); | ||
|  |         LenheartNewUI_Windows.Show(obj); | ||
|  | 
 | ||
|  |     } | ||
|  | 
 | ||
|  |     //逻辑入口 | ||
|  |     function Proc(obj) { | ||
|  |         LenheartNewUI_Windows.SyncPos(X, Y); | ||
|  | 
 | ||
|  |     } | ||
|  | 
 | ||
|  |     //鼠标左键弹起回调 | ||
|  |     function OnMouseLbUp(MousePos_X, MousePos_Y) { | ||
|  |         //还原编队的鼠标指针 | ||
|  |         if (this.PartyMarkFlag != -1) { | ||
|  |             this.PartyMarkFlag = -1; | ||
|  |             R_Mouse.SetType(0); | ||
|  |         } | ||
|  |         LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y); | ||
|  |     } | ||
|  | } |