diff --git a/osu.Game.Rulesets.Gamebosu/Configuration/GamebosuConfigManager.cs b/osu.Game.Rulesets.Gamebosu/Configuration/GamebosuConfigManager.cs index b4f0d15..4caa052 100644 --- a/osu.Game.Rulesets.Gamebosu/Configuration/GamebosuConfigManager.cs +++ b/osu.Game.Rulesets.Gamebosu/Configuration/GamebosuConfigManager.cs @@ -20,6 +20,7 @@ protected override void InitialiseDefaults() SetDefault(GamebosuSetting.PreferGBCMode, true); SetDefault(GamebosuSetting.GameboyScale, 2f, 1f, 4.5f, 0.1f); SetDefault(GamebosuSetting.EnableSoundPlayback, false); //Disable the audio playback by default since it is very experimental. + SetDefault(GamebosuSetting.DisableDisplayingThatAnnoyingDisclaimer, false); base.InitialiseDefaults(); } } @@ -31,5 +32,6 @@ public enum GamebosuSetting GameboyScale, PreferGBCMode, EnableSoundPlayback, + DisableDisplayingThatAnnoyingDisclaimer, } } \ No newline at end of file diff --git a/osu.Game.Rulesets.Gamebosu/UI/Configuration/GamebosuSettingsSubsection.cs b/osu.Game.Rulesets.Gamebosu/UI/Configuration/GamebosuSettingsSubsection.cs index f338d26..98a15e7 100644 --- a/osu.Game.Rulesets.Gamebosu/UI/Configuration/GamebosuSettingsSubsection.cs +++ b/osu.Game.Rulesets.Gamebosu/UI/Configuration/GamebosuSettingsSubsection.cs @@ -87,6 +87,11 @@ private void load(Storage storage, DialogOverlay dialog) { LabelText = "Enable Sound Playback (VERY EXPERIMENTAL)", Current = config.GetBindable(GamebosuSetting.EnableSoundPlayback) + }, + new SettingsCheckbox + { + LabelText = "Disable that annoying disclaimer when launching gamebosu!", + Current = config.GetBindable(GamebosuSetting.DisableDisplayingThatAnnoyingDisclaimer) } }; diff --git a/osu.Game.Rulesets.Gamebosu/UI/GamebosuPlayfield.cs b/osu.Game.Rulesets.Gamebosu/UI/GamebosuPlayfield.cs index cf2425a..279ccdc 100644 --- a/osu.Game.Rulesets.Gamebosu/UI/GamebosuPlayfield.cs +++ b/osu.Game.Rulesets.Gamebosu/UI/GamebosuPlayfield.cs @@ -3,7 +3,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Screens; +using osu.Game.Rulesets.Gamebosu.Configuration; using osu.Game.Rulesets.Gamebosu.UI.Screens; using osu.Game.Rulesets.UI; @@ -14,6 +14,9 @@ public class GamebosuPlayfield : Playfield { private GamebosuScreenStack stack; + [Resolved] + private GamebosuConfigManager gamebosuConfig { get; set; } + [BackgroundDependencyLoader] private void load() { @@ -24,12 +27,22 @@ private void load() }); } + private void displaySelection() => stack.Push(new RomSelectionScreen()); + protected override void LoadComplete() { - stack?.Push(new DisclaimerScreen + if (!gamebosuConfig.Get(GamebosuSetting.DisableDisplayingThatAnnoyingDisclaimer)) { - Complete = (sc) => sc.Push(new RomSelectionScreen()) - }); + stack.Push(new DisclaimerScreen + { + Complete = displaySelection + }); + } + else + { + displaySelection(); + } + base.LoadComplete(); } } diff --git a/osu.Game.Rulesets.Gamebosu/UI/Screens/DisclaimerScreen.cs b/osu.Game.Rulesets.Gamebosu/UI/Screens/DisclaimerScreen.cs index 460f886..ffa7cd7 100644 --- a/osu.Game.Rulesets.Gamebosu/UI/Screens/DisclaimerScreen.cs +++ b/osu.Game.Rulesets.Gamebosu/UI/Screens/DisclaimerScreen.cs @@ -23,13 +23,14 @@ public class DisclaimerScreen : GamebosuScreen, IKeyBindingHandler /// Called when the disclaimer finished displaying. /// - public Action Complete; + public Action Complete; public DisclaimerScreen() { @@ -94,7 +95,7 @@ private void schedulePush() { Content.ScaleTo(0.25f, 300, Easing.OutQuint) .FadeOut(300, Easing.Out) - .OnComplete(t => Complete?.Invoke(this)); + .OnComplete(t => Complete?.Invoke()); } public void OnReleased(GamebosuAction action)