diff --git a/osu-framework b/osu-framework index 30ff0e1a99..3629521379 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 30ff0e1a99a10e735611bb3ffa35352061f52d8a +Subproject commit 3629521379bea5d79cd41e35ad6c6dfe21b4f9e7 diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 05438bc470..65e7045445 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -97,7 +97,6 @@ public override void Load(BaseGame game) OnHome = delegate { MainMenu?.MakeCurrent(); }, OnSettings = Options.ToggleVisibility, OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; }, - Alpha = 0.001f, }, Chat = new ChatConsole(API), new VolumeControl @@ -112,12 +111,6 @@ public override void Load(BaseGame game) } }); - Toolbar.State = Visibility.Hidden; - Toolbar.Flush(); - - Chat.State = Visibility.Hidden; - Chat.Flush(); - intro.ModePushed += modeAdded; intro.Exited += modeRemoved; diff --git a/osu.Game/Overlays/Overlay.cs b/osu.Game/Overlays/Overlay.cs index 31e4c10d2a..648a78c248 100644 --- a/osu.Game/Overlays/Overlay.cs +++ b/osu.Game/Overlays/Overlay.cs @@ -3,8 +3,20 @@ namespace osu.Game.Overlays { + /// + /// An element which starts hidden and can be toggled to visible. + /// public abstract class Overlay : Container, IStateful { + public override void Load(BaseGame game) + { + base.Load(game); + + //TODO: init code using Alpha or IsVisible override to ensure we don't call Load on children before we first get unhidden. + PopOut(); + Flush(); + } + private Visibility state; public Visibility State { @@ -30,9 +42,9 @@ public Visibility State protected abstract void PopOut(); - public void ToggleVisibility() - => State = (State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible); + public void ToggleVisibility() => State = (State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible); } + public enum Visibility { Hidden,