mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 22:37:21 +08:00
Applied suggested changes
This commit is contained in:
parent
aec46a57c8
commit
667e6a2d6b
@ -298,20 +298,21 @@ namespace osu.Game
|
||||
|
||||
private Container overlayContent;
|
||||
|
||||
private OsuScreen currentScreen;
|
||||
private FrameworkConfigManager frameworkConfig;
|
||||
|
||||
private void screenChanged(Screen newScreen)
|
||||
{
|
||||
CurrentScreen.Value = newScreen as OsuScreen;
|
||||
currentScreen = newScreen as OsuScreen;
|
||||
|
||||
if (CurrentScreen.Value == null)
|
||||
if (currentScreen == null)
|
||||
{
|
||||
Exit();
|
||||
return;
|
||||
}
|
||||
|
||||
//central game screen change logic.
|
||||
if (!CurrentScreen.Value.ShowOverlays)
|
||||
if (!currentScreen.ShowOverlays)
|
||||
{
|
||||
settings.State = Visibility.Hidden;
|
||||
Toolbar.State = Visibility.Hidden;
|
||||
@ -326,6 +327,8 @@ namespace osu.Game
|
||||
}
|
||||
|
||||
ScreenChanged?.Invoke(newScreen);
|
||||
|
||||
musicController.AllowBeatmapChange = currentScreen.AllowBeatmapChange;
|
||||
}
|
||||
|
||||
protected override bool OnExiting()
|
||||
@ -361,7 +364,7 @@ namespace osu.Game
|
||||
|
||||
mainContent.Padding = new MarginPadding { Top = Toolbar.Position.Y + Toolbar.DrawHeight };
|
||||
|
||||
Cursor.State = CurrentScreen.Value?.HasLocalCursorDisplayed == false ? Visibility.Visible : Visibility.Hidden;
|
||||
Cursor.State = currentScreen?.HasLocalCursorDisplayed == false ? Visibility.Visible : Visibility.Hidden;
|
||||
}
|
||||
|
||||
private void screenAdded(Screen newScreen)
|
||||
|
@ -46,8 +46,6 @@ namespace osu.Game
|
||||
|
||||
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
public readonly Bindable<OsuScreen> CurrentScreen = new Bindable<OsuScreen>();
|
||||
|
||||
private Bindable<bool> fpsDisplayVisible;
|
||||
|
||||
protected AssemblyName AssemblyName => Assembly.GetEntryAssembly()?.GetName() ?? new AssemblyName { Version = new Version() };
|
||||
|
@ -36,13 +36,11 @@ namespace osu.Game.Overlays.Music
|
||||
|
||||
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
|
||||
|
||||
private readonly Bindable<OsuScreen> currentScreenBacking = new Bindable<OsuScreen>();
|
||||
public bool AllowBeatmapChange = true;
|
||||
|
||||
public IEnumerable<BeatmapSetInfo> BeatmapSets;
|
||||
private InputManager inputManager;
|
||||
|
||||
private bool canBeatmapChange => currentScreenBacking.Value?.CanBeatmapChange != false;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase game, BeatmapDatabase beatmaps, OsuColour colours, UserInputManager inputManager)
|
||||
{
|
||||
@ -91,7 +89,6 @@ namespace osu.Game.Overlays.Music
|
||||
list.BeatmapSets = BeatmapSets = beatmaps.GetAllWithChildren<BeatmapSetInfo>().ToList();
|
||||
|
||||
beatmapBacking.BindTo(game.Beatmap);
|
||||
currentScreenBacking.BindTo(game.CurrentScreen);
|
||||
|
||||
filter.Search.OnCommit = (sender, newText) => {
|
||||
var beatmap = list.FirstVisibleSet?.Beatmaps?.FirstOrDefault();
|
||||
@ -158,7 +155,7 @@ namespace osu.Game.Overlays.Music
|
||||
|
||||
private void playSpecified(BeatmapInfo info)
|
||||
{
|
||||
if (!canBeatmapChange)
|
||||
if (!AllowBeatmapChange)
|
||||
{
|
||||
beatmapBacking.Value?.Track?.Seek(0);
|
||||
return;
|
||||
|
@ -53,6 +53,21 @@ namespace osu.Game.Overlays
|
||||
private Container dragContainer;
|
||||
private Container playerContainer;
|
||||
|
||||
private bool allowBeatmapChange = true;
|
||||
|
||||
public bool AllowBeatmapChange
|
||||
{
|
||||
get
|
||||
{
|
||||
return allowBeatmapChange;
|
||||
}
|
||||
set
|
||||
{
|
||||
allowBeatmapChange = value;
|
||||
playlist.AllowBeatmapChange = value;
|
||||
}
|
||||
}
|
||||
|
||||
public MusicController()
|
||||
{
|
||||
Width = 400;
|
||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Screens
|
||||
|
||||
internal virtual bool AllowRulesetChange => true;
|
||||
|
||||
internal virtual bool CanBeatmapChange => true;
|
||||
internal virtual bool AllowBeatmapChange => true;
|
||||
|
||||
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
internal override bool ShowOverlays => false;
|
||||
|
||||
internal override bool CanBeatmapChange => false;
|
||||
internal override bool AllowBeatmapChange => false;
|
||||
|
||||
internal override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && HitRenderer.ProvidingUserCursor;
|
||||
|
||||
|
@ -280,6 +280,6 @@ namespace osu.Game.Screens.Ranking
|
||||
modeChangeButtons.Current.TriggerChange();
|
||||
}
|
||||
|
||||
internal override bool CanBeatmapChange => false;
|
||||
internal override bool AllowBeatmapChange => false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user