Пример #1
0
 public override void DoFinish()
 {
     foreach (Hotspot Hotspot in this.Hotspots)
     {
         Hotspot.DoFinish();
     }
 }
Пример #2
0
        public ClientTypeGame(Panel displayWindow, Settings AppSettings)
        {
            this.AppSettings = AppSettings;

            foreach (SettingHotspot SettingHotspot in AppSettings.HotSpots)
            {
                Hotspot Hotspot = null;
                switch (SettingHotspot.Type)
                {
                case SettingsHotSpotType.Skill:
                    Hotspot = new HotspotSkill();
                    break;

                case SettingsHotSpotType.SummonerSkill:
                    Hotspot = new HotspotSkill();
                    break;

                case SettingsHotSpotType.Item:
                    Hotspot = new HotspotSkill();
                    break;

                case SettingsHotSpotType.ResourceBar:
                    Hotspot = new HotspotResourceBar();
                    break;

                case SettingsHotSpotType.Trinket:
                    Hotspot = new HotspotSkill();
                    break;

                case SettingsHotSpotType.Back:
                    Hotspot = new HotspotSkill();
                    break;

                case SettingsHotSpotType.Char:
                    Hotspot = new HotspotSkill();
                    break;
                }
                if (Hotspot != null)
                {
                    Hotspot.Name     = SettingHotspot.Name;
                    Hotspot.StatesUI = new WPFUIHotspotStates();
                    if (SettingHotspot.ImagePartsOrientation == "V")
                    {
                        ((StackPanel)Hotspot.StatesUI.FindName("ImageParts")).Orientation = Orientation.Vertical;
                    }



                    displayWindow.Children.Add(Hotspot.StatesUI);
                    Hotspot.Initialize();
                    Hotspot.SettingHotspot = SettingHotspot;
                    this.Hotspots.Add(Hotspot);
                }
            }
        }
Пример #3
0
        public override void DoFrameAction()
        {
            foreach (Hotspot Hotspot in this.Hotspots)
            {
                Hotspot.SetCaptureRect(Hotspot.SettingHotspot.CaptureRect);
                Hotspot.SetCastableDetectionArea(Hotspot.SettingHotspot.CastableDetectionArea);
                Hotspot.SetCastableDetectionColors(Hotspot.SettingHotspot.CastableDetectionColors);
                Hotspot.BorderCut = Hotspot.SettingHotspot.BorderCut;

                Mat HotspotMat = new Mat(this.CaptureResult, Hotspot.CaptureRect);
                Hotspot.CaptureSource = HotspotMat;
                Hotspot.CreateFilteredMat();

                Hotspot.DoBeforeFrameAction();
                Hotspot.Tick();
                Hotspot.DoFrameAction();
                Hotspot.DoAfterFrameAction();


                foreach (SettingLedChain LedChain in Hotspot.SettingHotspot.LedChains)
                {
                    List <LedResults.Color> colors = Hotspot.getCurrentColors(LedChain.LedIdNames);
                    int colorIndex = 0;
                    foreach (string LedIdName in LedChain.LedIdNames)
                    {
                        CorsairLedId ledId = (CorsairLedId)Enum.Parse(typeof(CorsairLedId), LedIdName);

                        int curColorIndex         = colorIndex % LedChain.LedIdNames.Count;
                        LedResults.Color CurColor = colors.ElementAt(curColorIndex);
                        GetICueBridge().GetDevice(LedChain.DeviceType).SetLedColor(ledId, CurColor);
                        colorIndex++;
                    }
                }
            }

            GetICueBridge().Keyboard.sendToHardware();
            GetICueBridge().LedStrip.sendToHardware();
            this.DrawFPS();

            /*
             *  var ledResult = new LedResult();
             *  var indexer = mat.GetGenericIndexer<OpenCvSharp.Vec3b>();
             *  int getX = 60;
             *  int getY = 50;
             *  for (int i = 0; i < 4; i++)
             *  {
             *      OpenCvSharp.Vec3b color = indexer[getY, getX + i];
             *      ledResult.setSkill(i, new LedResults.Color(color.Item2, color.Item1, color.Item0));
             *  }
             *  iCueBridge.SetResult(ledResult);
             *
             *  mat.Rectangle(new OpenCvSharp.Point(getX - 1, getY - 1), new OpenCvSharp.Point(getX + 5, getY + 1), new OpenCvSharp.Scalar(164, 196, 215, 255));
             */
        }