Skip to content

Commit

Permalink
Add ability to disable that annoying disclaimer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Game4all committed May 28, 2021
1 parent ee4802f commit 110ddd0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand All @@ -31,5 +32,6 @@ public enum GamebosuSetting
GameboyScale,
PreferGBCMode,
EnableSoundPlayback,
DisableDisplayingThatAnnoyingDisclaimer,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ private void load(Storage storage, DialogOverlay dialog)
{
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)
}
};

Expand Down
21 changes: 17 additions & 4 deletions osu.Game.Rulesets.Gamebosu/UI/GamebosuPlayfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -14,6 +14,9 @@ public class GamebosuPlayfield : Playfield
{
private GamebosuScreenStack stack;

[Resolved]
private GamebosuConfigManager gamebosuConfig { get; set; }

[BackgroundDependencyLoader]
private void load()
{
Expand All @@ -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<bool>(GamebosuSetting.DisableDisplayingThatAnnoyingDisclaimer))
{
Complete = (sc) => sc.Push(new RomSelectionScreen())
});
stack.Push(new DisclaimerScreen
{
Complete = displaySelection
});
}
else
{
displaySelection();
}

base.LoadComplete();
}
}
Expand Down
7 changes: 4 additions & 3 deletions osu.Game.Rulesets.Gamebosu/UI/Screens/DisclaimerScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ public class DisclaimerScreen : GamebosuScreen, IKeyBindingHandler<GamebosuActio
"Try pressing Page-up or Page-down to change the ROM emulation speed!",
"You can customize the gameboy screen scale from the settings overlay, try searching for 'gameboy scale'!",
"You can open the ROM folder from the settings overlay, try searching for 'open rom folder'!",
"You can enable audio playback of the gameboy speaker in the settings, but don't do for the time being. It currently sounds more like noise."
"You can enable audio playback of the gameboy speaker in the settings, but don't do for the time being. It currently sounds more like noise.",
"You can disable this disclaimer in the settings, try searching for 'disable that annoying startup disclaimer'!"
};

/// <summary>
/// Called when the disclaimer finished displaying.
/// </summary>
public Action<GamebosuScreen> Complete;
public Action Complete;

public DisclaimerScreen()
{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 110ddd0

Please sign in to comment.