mirror of
https://github.com/osukey/osukey.git
synced 2025-05-11 16:47:19 +09:00
Make OsuGameModes self-aware of if they want a toolbar or not.
This commit is contained in:
parent
9d1d5a5cea
commit
fdb83bed79
@ -26,6 +26,8 @@ namespace osu.Game.GameModes.Menu
|
|||||||
private AudioSample welcome;
|
private AudioSample welcome;
|
||||||
private AudioTrack bgm;
|
private AudioTrack bgm;
|
||||||
|
|
||||||
|
internal override bool ShowToolbar => (ParentGameMode as OsuGameMode)?.ShowToolbar ?? false;
|
||||||
|
|
||||||
protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty();
|
protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty();
|
||||||
|
|
||||||
public Intro()
|
public Intro()
|
||||||
|
@ -25,6 +25,8 @@ namespace osu.Game.GameModes.Menu
|
|||||||
private ButtonSystem buttons;
|
private ButtonSystem buttons;
|
||||||
public override string Name => @"Main Menu";
|
public override string Name => @"Main Menu";
|
||||||
|
|
||||||
|
internal override bool ShowToolbar => true;
|
||||||
|
|
||||||
private BackgroundMode background;
|
private BackgroundMode background;
|
||||||
|
|
||||||
protected override BackgroundMode CreateBackground() => background;
|
protected override BackgroundMode CreateBackground() => background;
|
||||||
|
@ -26,6 +26,12 @@ namespace osu.Game.GameModes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual BackgroundMode CreateBackground() => null;
|
protected virtual BackgroundMode CreateBackground() => null;
|
||||||
|
|
||||||
|
internal virtual bool ShowToolbar => true;
|
||||||
|
|
||||||
|
protected new OsuGame Game => base.Game as OsuGame;
|
||||||
|
|
||||||
|
protected float ToolbarPadding => ShowToolbar ? Game.Toolbar.DrawHeight : 0;
|
||||||
|
|
||||||
private bool boundToBeatmap;
|
private bool boundToBeatmap;
|
||||||
private Bindable<WorkingBeatmap> beatmap;
|
private Bindable<WorkingBeatmap> beatmap;
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ namespace osu.Game.GameModes.Play
|
|||||||
playMode = osuGame.PlayMode;
|
playMode = osuGame.PlayMode;
|
||||||
playMode.ValueChanged += playMode_ValueChanged;
|
playMode.ValueChanged += playMode_ValueChanged;
|
||||||
// Temporary:
|
// Temporary:
|
||||||
scrollContainer.Padding = new MarginPadding { Top = osuGame.Toolbar.Height };
|
scrollContainer.Padding = new MarginPadding { Top = ToolbarPadding };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (database == null)
|
if (database == null)
|
||||||
|
@ -22,6 +22,8 @@ namespace osu.Game.GameModes.Play
|
|||||||
|
|
||||||
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
|
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
|
||||||
|
|
||||||
|
internal override bool ShowToolbar => false;
|
||||||
|
|
||||||
public BeatmapInfo BeatmapInfo;
|
public BeatmapInfo BeatmapInfo;
|
||||||
|
|
||||||
public PlayMode PreferredPlayMode;
|
public PlayMode PreferredPlayMode;
|
||||||
|
@ -155,10 +155,10 @@ namespace osu.Game
|
|||||||
// - Frame limiter changes
|
// - Frame limiter changes
|
||||||
|
|
||||||
//central game mode change logic.
|
//central game mode change logic.
|
||||||
if (newMode is Player || newMode is Intro)
|
if ((newMode as OsuGameMode)?.ShowToolbar != true)
|
||||||
{
|
{
|
||||||
Toolbar.State = Visibility.Hidden;
|
Toolbar.State = Visibility.Hidden;
|
||||||
Chat.State = Visibility.Hidden;
|
chat.State = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user