public async Task SubmitSettings() { SaveSettings(); if (RPC == false) { discordRPC.Deinitialize(); } else { discordRPC.Initialize(); logger.Info("Discord RPC Initialized."); } await events.PublishOnUIThreadAsync(new InstanceSettingsEvent { CurrentInstance = InstanceName, LauncherOpen = LauncherOpen, Arguments = Arguments, GameWidth = Width, GameHeight = Height }); logger.Info("Event InstanceSettingsEvent sent."); await TryCloseAsync(); }
public ShellViewModel(IDiscordRPCManager discordRPC, ILog logger) { this.discordRPC = discordRPC; this.logger = logger; logger.Info("Betacraft Launcher Legacy started!"); ActivateItemAsync(IoC.Get <LauncherViewModel>(), new CancellationToken()); if (Properties.Settings.Default.discordRPC) { discordRPC.Initialize(); } }