private void confirmAndExit() { if (exitConfirmed) { return; } exitConfirmed = true; game?.PerformFromScreen(menu => menu.Exit()); }
private void load(Storage storage, OsuConfigManager config, OsuGame game) { Add(new SettingsEnumDropdown <ReleaseStream> { LabelText = Properties.strings.ReleaseStream, Current = config.GetBindable <ReleaseStream>(OsuSetting.ReleaseStream), }); if (updateManager?.CanCheckForUpdate == true) { Add(checkForUpdatesButton = new SettingsButton { Text = "Check for updates", Action = () => { checkForUpdatesButton.Enabled.Value = false; Task.Run(updateManager.CheckForUpdateAsync).ContinueWith(t => Schedule(() => { if (!t.Result) { notifications?.Post(new SimpleNotification { Text = $"You are running the latest release ({game.Version})", Icon = FontAwesome.Solid.CheckCircle, }); } checkForUpdatesButton.Enabled.Value = true; })); } }); } if (RuntimeInfo.IsDesktop) { Add(new SettingsButton { Text = Properties.strings.OpenFolder, Action = storage.OpenInNativeExplorer, }); Add(new SettingsButton { Text = Properties.strings.ChangeFolder, Action = () => game?.PerformFromScreen(menu => menu.Push(new MigrationSelectScreen())) }); } }
private void load(FrameworkDebugConfigManager config, FrameworkConfigManager frameworkConfig, OsuGame game) { Children = new Drawable[] { new SettingsCheckbox { LabelText = "Show log overlay", Current = frameworkConfig.GetBindable <bool>(FrameworkSetting.ShowLogOverlay) }, new SettingsCheckbox { LabelText = "Bypass front-to-back render pass", Current = config.GetBindable <bool>(DebugSetting.BypassFrontToBackPass) } }; Add(new SettingsButton { Text = "Import files", Action = () => game?.PerformFromScreen(menu => menu.Push(new FileImportScreen())) }); }
private void load(FrameworkDebugConfigManager config, FrameworkConfigManager frameworkConfig, OsuGame game) { Children = new Drawable[] { new SettingsCheckbox { LabelText = "顯示日誌圖層", Current = frameworkConfig.GetBindable <bool>(FrameworkSetting.ShowLogOverlay) }, new SettingsCheckbox { LabelText = "不使用\"前到後\"渲染設定", Current = config.GetBindable <bool>(DebugSetting.BypassFrontToBackPass) } }; Add(new SettingsButton { Text = "匯入檔案...", Action = () => game?.PerformFromScreen(menu => menu.Push(new FileImportScreen())) }); }
private void load(Storage storage, OsuConfigManager config, OsuGame game) { Add(new SettingsEnumDropdown <ReleaseStream> { LabelText = "Release stream", Bindable = config.GetBindable <ReleaseStream>(OsuSetting.ReleaseStream), }); if (RuntimeInfo.IsDesktop) { Add(new SettingsButton { Text = "Open osu! folder", Action = storage.OpenInNativeExplorer, }); Add(new SettingsButton { Text = "Change folder location...", Action = () => game?.PerformFromScreen(menu => menu.Push(new MigrationSelectScreen())) }); } }
private void load(Storage storage, OsuConfigManager config, OsuGame game) { Add(new SettingsEnumDropdown <ReleaseStream> { LabelText = "Release stream", Bindable = config.GetBindable <ReleaseStream>(OsuSetting.ReleaseStream), }); if (updateManager?.CanCheckForUpdate == true) { Add(checkForUpdatesButton = new SettingsButton { Text = "Check for updates", Action = () => { checkForUpdatesButton.Enabled.Value = false; Task.Run(updateManager.CheckForUpdateAsync).ContinueWith(t => Schedule(() => checkForUpdatesButton.Enabled.Value = true)); } }); } if (RuntimeInfo.IsDesktop) { Add(new SettingsButton { Text = "Open osu! folder", Action = storage.OpenInNativeExplorer, }); Add(new SettingsButton { Text = "Change folder location...", Action = () => game?.PerformFromScreen(menu => menu.Push(new MigrationSelectScreen())) }); } }
private void load(Storage storage, DialogOverlay dialog, OsuGame game) { var config = Config as GamebosuConfigManager; lockClockRate = config.GetBindable <bool>(GamebosuSetting.LockClockRate); Children = new Drawable[] { clockRate = new SettingsSlider <double> { LabelText = "Gameboy Clock rate", Current = config.GetBindable <double>(GamebosuSetting.ClockRate) }, new SettingsCheckbox { LabelText = "Lock gameboy clock rate", Current = lockClockRate }, new SettingsCheckbox { LabelText = "Prefer Gameboy Color mode when launching original gameboy ROMs", Current = config.GetBindable <bool>(GamebosuSetting.PreferGBCMode) }, new SettingsSlider <float> { LabelText = "Gameboy Scale", Current = config.GetBindable <float>(GamebosuSetting.GameboyScale) }, new SettingsButton { Text = "Open ROMs folder", Action = () => storage.GetStorageForDirectory("roms")?.PresentExternally() }, new DangerousSettingsButton { Text = "Delete ROM save data", Action = () => { Action deleteAction = delegate { var saves = storage.GetStorageForDirectory("roms/saves"); var files = saves.GetFiles("."); try { files.ForEach(file => saves.Delete(file)); } catch (Exception) { dialog.Push(new DeleteDataErrorDialog { BodyText = $"Couldn't delete ROM save data (save data may be used by the currently loaded ROM). Try deleting save data from the main menu" }); } }; dialog.Push(new DeleteDataDialog(deleteAction)); } }, new SettingsCheckbox { LabelText = "Enable Sound Playback (VERY EXPERIMENTAL)", Current = config.GetBindable <bool>(GamebosuSetting.EnableSoundPlayback) }, new SettingsCheckbox { LabelText = "Disable that annoying disclaimer when launching gamebosu!", Current = config.GetBindable <bool>(GamebosuSetting.DisableDisplayingThatAnnoyingDisclaimer) }, new YellowSettingsButton { Text = "Open ROM listing", Action = () => game?.PerformFromScreen(scr => scr.Push(new GamebosuMainScreen(ruleset))) }, }; lockClockRate.BindValueChanged(e => clockRate.Current.Disabled = e.NewValue, true); }