mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 08:33:55 +09:00
Fix regressions caused by overlay class.
This commit is contained in:
@ -97,7 +97,6 @@ namespace osu.Game
|
|||||||
OnHome = delegate { MainMenu?.MakeCurrent(); },
|
OnHome = delegate { MainMenu?.MakeCurrent(); },
|
||||||
OnSettings = Options.ToggleVisibility,
|
OnSettings = Options.ToggleVisibility,
|
||||||
OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; },
|
OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; },
|
||||||
Alpha = 0.001f,
|
|
||||||
},
|
},
|
||||||
Chat = new ChatConsole(API),
|
Chat = new ChatConsole(API),
|
||||||
new VolumeControl
|
new VolumeControl
|
||||||
@ -112,12 +111,6 @@ namespace osu.Game
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Toolbar.State = Visibility.Hidden;
|
|
||||||
Toolbar.Flush();
|
|
||||||
|
|
||||||
Chat.State = Visibility.Hidden;
|
|
||||||
Chat.Flush();
|
|
||||||
|
|
||||||
intro.ModePushed += modeAdded;
|
intro.ModePushed += modeAdded;
|
||||||
intro.Exited += modeRemoved;
|
intro.Exited += modeRemoved;
|
||||||
|
|
||||||
|
@ -3,8 +3,20 @@ using osu.Framework.Graphics.Containers;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An element which starts hidden and can be toggled to visible.
|
||||||
|
/// </summary>
|
||||||
public abstract class Overlay : Container, IStateful<Visibility>
|
public abstract class Overlay : Container, IStateful<Visibility>
|
||||||
{
|
{
|
||||||
|
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;
|
private Visibility state;
|
||||||
public Visibility State
|
public Visibility State
|
||||||
{
|
{
|
||||||
@ -30,9 +42,9 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected abstract void PopOut();
|
protected abstract void PopOut();
|
||||||
|
|
||||||
public void ToggleVisibility()
|
public void ToggleVisibility() => State = (State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible);
|
||||||
=> State = (State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Visibility
|
public enum Visibility
|
||||||
{
|
{
|
||||||
Hidden,
|
Hidden,
|
||||||
|
Reference in New Issue
Block a user