public MainForm() { InitializeComponent(); if (settings.SettingsUpgradeRequired) { settings.Upgrade(); settings.WowVersion = (string)settings.Properties["WowVersion"].DefaultValue; settings.SettingsUpgradeRequired = false; } options = new Options(this); about = new About(); this.pic_LfdTank.Image = Helper.ConvertToGrayScale(Helper.bmpTank); this.pic_LfdHeal.Image = Helper.ConvertToGrayScale(Helper.bmpHeal); this.pic_LfdDps.Image = Helper.ConvertToGrayScale(Helper.bmpDps); this.pic_LfrTank.Image = Helper.ConvertToGrayScale(Helper.bmpTank); this.pic_LfrHeal.Image = Helper.ConvertToGrayScale(Helper.bmpHeal); this.pic_LfrDps.Image = Helper.ConvertToGrayScale(Helper.bmpDps); lfdModule = new DTModule( lbl_LfdStatus, lbl_LfdWait, lbl_LfdQueueTime, lbl_LfdTank, lbl_LfdHealer, lbl_LfdDps, pic_LfdTank, pic_LfdHeal, pic_LfdDps ); lfrModule = new DTModule( lbl_LfrStatus, lbl_LfrWait, lbl_LfrQueueTime, lbl_LfrTank, lbl_LfrHealer, lbl_LfrDps, pic_LfrTank, pic_LfrHeal, pic_LfrDps ); bg1Module = new DTModule( lbl_BG1Status, lbl_Bg1Wait, lbl_Bg1QueuedTime ); bg2Module = new DTModule( lbl_BG2Status, lbl_Bg2Wait, lbl_Bg2QueuedTime ); }
private void QueueStatus_IsReady(string queueReadyName, string mapName) { DTModule module = new DTModule(); bool pve = false, pvp = false; queueReady = true; Image img = null; switch (queueReadyName) { case "Dungeon Finder": pve = true; resetLFD = true; module = lfdModule; img = Properties.Resources.dungeon_finder_icon; break; case "Raid Finder": pve = true; resetLFR = true; module = lfrModule; img = Properties.Resources.raid_finder_icon; break; case "Battleground 1": pvp = true; module = bg1Module; img = Properties.Resources.pvp_finder_icon; break; case "Battleground 2": pvp = true; module = bg2Module; img = Properties.Resources.pvp_finder_icon; break; case "Random Dungeon": pve = true; resetLFD = true; module = lfdModule; img = Properties.Resources.dungeon_finder_icon; break; } Helper.setReady(module, mapName); timerAntiAFK.Stop(); if (settings.BalloonTips) { notifyIcon1.BalloonTipText = String.Format("{0} queue is ready!", queueReadyName); notifyIcon1.ShowBalloonTip(500); } if (settings.Sound) { ready.Play(); } if (settings.AutoJoin) { if (pve) { WoWCommand.sendSlashCommand(hWnd_wow, "/click LFGDungeonReadyDialogEnterDungeonButton"); } if (pvp) { WoWCommand.sendSlashCommand(hWnd_wow, "/click StaticPopup1Button1"); } } if (!settings.TrayOnly) { this.Show(); this.WindowState = FormWindowState.Normal; } if (settings.BringToFront) { SetForegroundWindow(hWnd_wow); ShowWindow(hWnd_wow, SW_RESTORE); } if (settings.UseMQTT) { try { MQTT.send(queueReadyName + " - " + mapName); } catch (Exception ex) { MessageBox.Show(String.Format("Unexpected MQTT error : {0}", ex.InnerException), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } if (settings.DesktopNotification) { if (!notification.Visible) { DialogResult result = notification.ShowDialog(new DesktopNotification.costumArguments(img, queueReadyName, mapName)); if (result == DialogResult.OK) { SetForegroundWindow(hWnd_wow); ShowWindow(hWnd_wow, SW_RESTORE); } } } if (settings.PushProider != 0) { Notification.sendPushNotification(settings.PushProider, settings.PushKey, "Queue ready!", String.Format("Your {0} queue is now ready!", queueReadyName)); } if (settings.MailNotification) { Notification.sendMail(settings.MailAddress, "Queue ready", String.Format("Your {0} queue is now ready!", queueReadyName)); } }