public wndConfigLolClientOverlay(StaticPinvokeLolClient lcg, EcsSettings ecsSettings, Action <string> DisplayPopup) : this()
        {
            if (ecsSettings == null || DisplayPopup == null)
            {
                throw new ArgumentNullException();
            }

            _lcg          = lcg;
            _ecsSettings  = ecsSettings;
            _displayPopup = DisplayPopup;

            if (File.Exists(StaticSerializer.FullPath_ClientImage))
            {
                _ClientBitmap   = new Bitmap(StaticImageUtilities.LoadImageFromFile(StaticSerializer.FullPath_ClientImage));
                _lolClientImage = StaticImageUtilities.BitmapToBitmapSource(_ClientBitmap);
                Visualize_lolClientImage();
            }
            else
            {
                if (_lcg.ClientState != LolClientState.NoClient)
                {
                    btnGetCurrentClientImage_Click(null, null);
                }
            }
        }
        public wndSettings(EcsSettings s, StaticPinvokeLolClient pilc, Action <string> DisplayMessage)
            : this()
        {
            if (s == null || pilc == null || DisplayMessage == null)
            {
                throw new ArgumentNullException();
            }

            _s = s;
            _displayMessage = DisplayMessage;
            _pilc           = pilc;

            _s.ChampionSearchbarChanged += _s_ChampionSearchbarChanged;
            _s.ClientOverlayChanged     += _s_ClientOverlayChanged;
            _s.TeamChatChanged          += _s_TeamChatChanged;

            double dotNetVersion = DotnetRegistryVersion();

            if (dotNetVersion < 4.5)
            {
                gbBasicRequirements.Visibility = System.Windows.Visibility.Visible;
                spDotNetVersion.Visibility     = System.Windows.Visibility.Visible;
                lblDotNetVersion.Content      += " " + dotNetVersion;
            }

            if (!isRunFromProgramFiles())
            {
                gbBasicRequirements.Visibility = System.Windows.Visibility.Visible;
                lblProgramFiles.Visibility     = Visibility.Visible;
                lblProgramFiles.Content        = "Not run from " + Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
            }

            txtApiKey.Text = s.UserApiKey;
            chkShowMainFormOnLaunch.IsChecked = s.ShowMainFormOnLaunch;
            chkStartLeagueWithECS.IsChecked   = s.StartLeagueWithEcs;
            txtLeaguePath.Text = s.LeaguePath;

            lblChampionSearchBar.Content += " " + _s.ChampionSearchbarRelativePos.ToString();
            lblClientOverlay.Content     += " " + _s.ClientOverlayRelativePos.ToString();
            lblTeamChat.Content          += " " + _s.TeamChatRelativePos.ToString();

            lblApplicationpath.Content += " " + StaticSerializer.applicationPath();
            lblAppDataPath.Content     += " " + StaticSerializer.userAppDataPath();

            if (pilc.ClientState == LolClientState.NoClient && !File.Exists(StaticSerializer.FullPath_ClientImage))
            {
                btnConfigClientOverlay.IsEnabled = false;
            }

            pilc.LolClientStateChanged += pilc_LolClientStateChanged;

            DispatcherTimer dptm = new DispatcherTimer(DispatcherPriority.Loaded);

            dptm.Interval = new TimeSpan(0, 0, 5);
            dptm.Tick    += dptm_Tick;
            dptm.Start();
        }
Ejemplo n.º 3
0
 private void LoadSettings()
 {
     if (File.Exists(StaticSerializer.FullPath_Settings))
     {
         MySettings = (EcsSettings)StaticSerializer.DeSerializeObject(StaticSerializer.FullPath_Settings);
     }
     if (MySettings == null)
     {
         MySettings = new EcsSettings();
     }
     MySettings.SettingsChanged += (s, args) => StaticSerializer.SerializeObject(MySettings, StaticSerializer.FullPath_Settings);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Create a StaticLolClientGraphics object.
        /// </summary>
        public static StaticPinvokeLolClient GetInstance(EcsSettings ecsSettings, Action <string> DisplayPopup)
        {
            if (ecsSettings == null || DisplayPopup == null)
            {
                throw new ArgumentNullException();
            }
            else
            {
                _instance = new StaticPinvokeLolClient(ecsSettings, DisplayPopup);
            }

            return(_instance);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Private constructor, please use GetInstance() to use the class.
        /// </summary>
        private StaticPinvokeLolClient(EcsSettings ecsSettings, Action <string> DisplayPopup)
        {
            _displayPopup = DisplayPopup;
            _ecsSettings  = ecsSettings;

            _tmspTimerClienActiveInterval    = new TimeSpan(0, 0, 1);
            _tmspTimerAfkInterval            = new TimeSpan(0, 0, 10);
            _tmrCheckForChampSelect          = new DispatcherTimer(DispatcherPriority.Background);
            _tmrCheckForChampSelect.Interval = _tmspTimerClienActiveInterval;
            _tmrCheckForChampSelect.Tick    += _tmrCheckForChampSelect_Tick;
            _tmrCheckForChampSelect_Tick(null, EventArgs.Empty); //Manual search for gameclient regardless of timer tick timespan
            _tmrCheckForChampSelect.Start();
        }
Ejemplo n.º 6
0
 private void MySettings_ApiKeyChanged(EcsSettings sender, EventArgs e)
 {
     _ARR.LoadAllChampionsRiotApi();
     DisplayAllChampionsMinusInSelectedGroupAccordingToFilter();
 }
 private void _s_ChampionSearchbarChanged(EcsSettings sender, EventArgs e)
 {
     lblChampionSearchBar.Content = "Champion Searchbar: " + _s.ChampionSearchbarRelativePos.ToString();
 }
 private void _s_ClientOverlayChanged(EcsSettings sender, EventArgs e)
 {
     lblClientOverlay.Content = "ECS Overlay: " + _s.ClientOverlayRelativePos.ToString();
 }
 private void _s_TeamChatChanged(EcsSettings sender, EventArgs e)
 {
     lblTeamChat.Content = "Team Chatbar: " + _s.TeamChatRelativePos.ToString();
 }