private static void LoadWindows() { //waiting = true; //foreach (var del in WindowLoadingDelegates) //{ // waiting = true; // del.DynamicInvoke(); // while (waiting) { } //} GroupWindow = new GroupWindow(); CooldownWindow = new CooldownWindow(); BossWindow = new BossWindow(); BuffWindow = new BuffWindow(); CharacterWindow = new CharacterWindow(); ClassWindow = new ClassWindow(); InfoWindow = new InfoWindow(); FlightDurationWindow = new FlightDurationWindow(); LfgListWindow = new LfgListWindow(); SkillConfigWindow = new SkillConfigWindow(); GroupAbnormalConfigWindow = new GroupAbnormalConfigWindow(); CivilUnrestWindow = new CivilUnrestWindow(); FloatingButton = new FloatingButtonWindow(); ChatWindowManager.Instance.InitWindows(); //GroupWindow.Show(); //CooldownWindow.Show(); //BossWindow.Show(); //BuffWindow.Show(); //CharacterWindow.Show(); //ClassWindow.Show(); }
public CooldownWindow() { Instance = this; Opacity = 0; InitializeComponent(); //SkillsDatabase.Progress += UpdateLoadGauge; SkillIconControl.SkillEnded += SkillIconControl_SkillEnded; NormalSkillsPanel.ItemsSource = SkillManager.NormalSkillsQueue; LongSkillsPanel.ItemsSource = SkillManager.LongSkillsQueue; NormalSkillsPanel.DataContext = SkillManager.NormalSkillsQueue; LongSkillsPanel.DataContext = SkillManager.LongSkillsQueue; }
private static void LoadCooldownWindow() { var cooldownWindowThread = new Thread(new ThreadStart(() => { SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher)); CooldownWindow = new CooldownWindow(); //CooldownWindow.AllowsTransparency = SettingsManager.CooldownWindowSettings.AllowTransparency; CooldownWindow.Show(); waiting = false; Dispatcher.Run(); })); cooldownWindowThread.Name = "Cooldown bar thread"; cooldownWindowThread.SetApartmentState(ApartmentState.STA); cooldownWindowThread.Start(); Debug.WriteLine("Cd window loaded"); }
private static void LoadCooldownWindow() { var cooldownWindowThread = new Thread(() => { SynchronizationContext.SetSynchronizationContext( new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher)); Thread.CurrentThread.Priority = ThreadPriority.Highest; CooldownWindow = new CooldownWindow(); if (CooldownWindow.WindowSettings.Enabled) { CooldownWindow.Show(); } AddDispatcher(Thread.CurrentThread.ManagedThreadId, Dispatcher.CurrentDispatcher); Dispatcher.Run(); RemoveDispatcher(Thread.CurrentThread.ManagedThreadId); }) { Name = "Cdwn" }; cooldownWindowThread.SetApartmentState(ApartmentState.STA); cooldownWindowThread.Start(); }
public static void Init() { CooldownWindow = new CooldownWindow(); CharacterWindow = new CharacterWindow(); BossGauge = new BossGageWindow(); BuffBar = new AbnormalitiesWindow(); ContextMenu = new ContextMenu(); TrayIcon = new System.Windows.Forms.NotifyIcon() { Icon = Icon.ExtractAssociatedIcon(Process.GetCurrentProcess().MainModule.FileName), Visible = true }; TrayIcon.MouseDown += NI_MouseDown; var v = Assembly.GetExecutingAssembly().GetName().Version; TrayIcon.Text = String.Format("TCC v{0}.{1}.{2}", v.Major, v.Minor, v.Build); var ForceShowButton = new MenuItem() { Header = "Force visibility on" }; ClickThruButton = new MenuItem() { Header = "Click through" }; var CloseButton = new MenuItem() { Header = "Close" }; CharacterWindowVisibilityButton = new MenuItem() { Header = "Unhide character window" }; CharacterWindowVisibilityButton.Click += (s, ev) => { CharacterWindow.Visibility = Visibility.Visible; }; CooldownWindowVisibilityButton = new MenuItem() { Header = "Unhide cooldowns bar" }; CooldownWindowVisibilityButton.Click += (s, ev) => { CooldownWindow.Visibility = Visibility.Visible; }; BossGaugeWindowVisibilityButton = new MenuItem() { Header = "Unhide boss bar" }; BossGaugeWindowVisibilityButton.Click += (s, ev) => { BossGauge.Visibility = Visibility.Visible; }; BuffBarWindowVisibilityButton = new MenuItem() { Header = "Unhide buffs bar" }; BuffBarWindowVisibilityButton.Click += (s, ev) => { BuffBar.Visibility = Visibility.Visible; }; CloseButton.Click += (s, ev) => App.CloseApp(); ClickThruButton.Click += (s, ev) => ToggleClickThru(); ForceShowButton.Click += (s, ev) => ForceShow(); ContextMenu.Items.Add(CooldownWindowVisibilityButton); ContextMenu.Items.Add(BuffBarWindowVisibilityButton); ContextMenu.Items.Add(BossGaugeWindowVisibilityButton); ContextMenu.Items.Add(CharacterWindowVisibilityButton); ContextMenu.Items.Add(new Separator()); ContextMenu.Items.Add(ClickThruButton); ContextMenu.Items.Add(CloseButton); FocusManager.FocusTimer = new DispatcherTimer() { Interval = TimeSpan.FromSeconds(1) }; FocusManager.FocusTimer.Tick += FocusManager.CheckForegroundWindow; FocusManager.ForegroundWindowChanged += FocusManager_ForegroundWindowChanged; }