void _lcg_LolClientFocussed(StaticPinvokeLolClient sender, EventArgs e) { if (_lcg.ClientState == LolClientState.InChampSelect) { Visibility = System.Windows.Visibility.Visible; } }
public wndClientOverload(StaticGroupManager gmGroupManager, StaticPinvokeLolClient lcg, Action <string> DisplayPopup) : this() { if (gmGroupManager != null && lcg != null && DisplayPopup != null) { this._gm = gmGroupManager; this._lcg = lcg; this._displayPopup = DisplayPopup; _gm.GroupsChanged += _groupManager_GroupsChanged; for (int i = 0; i < _gm.GroupCount; i++) { _gm.getGroup(i).NameChanged += _groupManager_ChampionList_NameChanged; } _lcg.OnLeagueClientReposition += OnLeagueClientReposition; _lcg.LolClientFocussed += _lcg_LolClientFocussed; _lcg.LolClientFocusLost += _lcg_LolClientFocusLost; _lcg.LolClientStateChanged += _lcg_LolClientStateChanged; } else { DisplayPopup("wndClientlay.xaml.cs has null parameters!"); } Redraw(); }
private void OnLeagueClientReposition(StaticPinvokeLolClient sender, EventArgs e) { Rectangle rect = sender.getClientOverlayPosition(); this.Left = rect.X; this.Top = rect.Y; }
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(); }
void _lcg_LolClientStateChanged(StaticPinvokeLolClient sender, EventArgs e) { if (sender.ClientState != LolClientState.InChampSelect) { Visibility = System.Windows.Visibility.Collapsed; } else { Visibility = System.Windows.Visibility.Visible; } }
void pilc_LolClientStateChanged(StaticPinvokeLolClient sender, PinvokeLolClientEventArgs e) { if (e.CurrentState != LolClientState.NoClient || File.Exists(StaticSerializer.FullPath_ClientImage)) { btnConfigClientOverlay.IsEnabled = true; } else { btnConfigClientOverlay.IsEnabled = false; } }
public AppRuntimeResourcesManager() { MyTaskbarManager = StaticTaskbarManager.getInstance(AppName); MyTaskbarManager.MyTaskbarIcon.PreviewTrayContextMenuOpen += Tb_PreviewTrayContextMenuOpen; //Taskbar ContextMenu binding MyTaskbarManager.MyTaskbarIcon.TrayMouseDoubleClick += (s, args) => mniShowMainWindow_Click(s, args); LoadSettings(); //Load this first LoadSerializedGroupManager(); LoadAllChampions(); //Load all champions (Riot api or local) MyLolClientProcessInvokeHandler = StaticPinvokeLolClient.GetInstance(MySettings, DisplayPopup); Window_Main = new wndMain(this); Window_Main.Closed += (s, args) => Window_Main = null; Window_ClientOverlay = new wndClientOverload(MyGroupManager, MyLolClientProcessInvokeHandler, DisplayPopup); if (MySettings.StartLeagueWithEcs) { if (MyLolClientProcessInvokeHandler.ClientState == LolClientState.NoClient) { if (MySettings.LeaguePath.Length > 0) { try { FileInfo fi = new FileInfo(MySettings.LeaguePath); Process.Start(new ProcessStartInfo(fi.FullName)); } catch (Exception) { } } } } if (MySettings.ShowMainFormOnLaunch) { Show_Window_Main(); } }
void _lcg_LolClientFocusLost(StaticPinvokeLolClient sender, EventArgs e) { Visibility = Visibility.Collapsed; }