| | |
| | | using Emgu.CV; |
| | | using Emgu.CV.Structure; |
| | | using RichCreator.Maps; |
| | | using RichCreator.Utility; |
| | | using RichCreator.Utility.Captures; |
| | | using RichCreator.Utility.CV; |
| | | using RichCreator.Utility.Structs; |
| | | using RichCreator.Utilitys; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | |
| | | //频道距离“频道选择文字”的偏移 |
| | | private static ZTPoint[] channelOffsets = new ZTPoint[] { |
| | | new ZTPoint(-279,246), |
| | | new ZTPoint(-279,291) |
| | | new ZTPoint(-270,252), |
| | | new ZTPoint(-270,293) |
| | | }; |
| | | |
| | | //首次进入标记 |
| | |
| | | break; |
| | | case ChannelStates.CloseAllWindow1: |
| | | //关闭所有窗口1 |
| | | CloseAllAlertWindow(cancelToken, gameRect); |
| | | GameUtils.CloseAllAlertWindowByX(cancelToken, gameRect); |
| | | currentState = ChannelStates.CheckGroupMode; |
| | | break; |
| | | case ChannelStates.IsChoiceRolePage: |
| | |
| | | break; |
| | | case ChannelStates.OpenChangeChannelPage: |
| | | //打开切换频道界面 |
| | | G.Instance.InputControl.MoveToAndClick(new ZTPoint(gameRect.End.X - 136, gameRect.Start.Y + 9)); |
| | | G.Instance.InputControl.MoveToAndClick(new ZTPoint(gameRect.Start.X +690, gameRect.Start.Y + 11)); |
| | | Thread.Sleep(2000); |
| | | currentState = ChannelStates.ChangeChannelPageIsOpen; |
| | | break; |
| | | case ChannelStates.CloseAllWindow: |
| | | //关闭所有窗口 |
| | | CloseAllAlertWindow(cancelToken,gameRect); |
| | | GameUtils.CloseAllAlertWindowByX(cancelToken,gameRect); |
| | | currentState = ChannelStates.Complete; |
| | | break; |
| | | default: |
| | |
| | | |
| | | return ZTResult.Success; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 关闭所有弹出窗 |
| | | /// </summary> |
| | | /// <param name="cancelToken"></param> |
| | | /// <param name="gameRect"></param> |
| | | /// <returns></returns> |
| | | private bool CloseAllAlertWindow(CancellationToken cancelToken, ZTRectangle gameRect) |
| | | { |
| | | while (!cancelToken.IsCancellationRequested) |
| | | { |
| | | G.Instance.InputControl.MoveTo(0, 0, false, false, false); |
| | | Thread.Sleep(10); |
| | | //截图 |
| | | System.Drawing.Bitmap bitmap = ScreenCapture.Instance.CaptureScreen(); |
| | | Image<Rgb, byte> image = new Image<Rgb, byte>(bitmap); |
| | | |
| | | ZTRectangle closeButtonRect = ZTRectangle.Empty; |
| | | if (!DnfCVHelper.GetAlertWindow(out closeButtonRect, image, gameRect)) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | G.Instance.InputControl.MoveToAndClick(closeButtonRect.GetCenterPoint()); |
| | | Thread.Sleep(500); |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 频道状态 |
| | | /// </summary> |