protected override void Init() { base.Init(); Game.Exited += (sender, e) => { WorkerTimer.Stop(); ProcessFinder.ProcessClose(); }; // Need smallImage. it will shown character, or difficulty. Presence.Assets.LargeImageText = SubTitle; }
public MainForm() { InitializeComponent(); this.Icon = TrayIcon.Icon = Properties.Resources.Icon; ProcessFinder.SetText = text => this.Invoke(new Action(() => CMT_CurrentGame.Text = text)); Shown += (sender, e) => { this.Hide(); ProcessFinder.SearchProcess(); }; }
protected virtual void ElapsedFunc(object sender, EventArgs e) { try { if (IsInGame) { if (!IsPlaying) { IsPlaying = true; Presence.Details = StatusString + " " + CharSpellString; Presence.Timestamps.Start = PlayTime = DateTime.UtcNow; return; } Presence.State = DiffChap; bool isPause = IsPause; if (!WasPause && isPause) { WasPause = true; Presence.Details = "Pausing " + CharSpellString; Presence.Timestamps.Start = DateTime.UtcNow; } else if (WasPause && !isPause) { WasPause = false; Presence.Details = StatusString + " " + CharSpellString; Presence.Timestamps.Start = (PlayTime += DateTime.UtcNow - Presence.Timestamps.Start); } } else { IsPlaying = false; Presence.Details = "In Main Menu"; Presence.Timestamps.Start = PlayTime = null; Presence.State = null; } UpdatePresence(); } catch (Win32Exception) { ProcessFinder.ProcessClose(); } }