mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Apply changes in line with framework NRT updates
This commit is contained in:
parent
95908ec023
commit
06ce8130c2
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
public class DrawableTaikoMascot : BeatSyncedContainer
|
||||
{
|
||||
public readonly Bindable<TaikoMascotAnimationState> State;
|
||||
public readonly Bindable<JudgementResult> LastResult;
|
||||
public readonly Bindable<JudgementResult?> LastResult;
|
||||
|
||||
private readonly Dictionary<TaikoMascotAnimationState, TaikoMascotAnimation> animations;
|
||||
|
||||
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
Origin = Anchor = Anchor.BottomLeft;
|
||||
|
||||
State = new Bindable<TaikoMascotAnimationState>(startingState);
|
||||
LastResult = new Bindable<JudgementResult>();
|
||||
LastResult = new Bindable<JudgementResult?>();
|
||||
|
||||
animations = new Dictionary<TaikoMascotAnimationState, TaikoMascotAnimation>();
|
||||
}
|
||||
@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
LastResult.BindValueChanged(onNewResult);
|
||||
}
|
||||
|
||||
private void onNewResult(ValueChangedEvent<JudgementResult> resultChangedEvent)
|
||||
private void onNewResult(ValueChangedEvent<JudgementResult?> resultChangedEvent)
|
||||
{
|
||||
var result = resultChangedEvent.NewValue;
|
||||
if (result == null)
|
||||
|
@ -6,6 +6,7 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
@ -100,7 +101,7 @@ namespace osu.Game.Collections
|
||||
private void selectionChanged(ValueChangedEvent<CollectionFilterMenuItem> filter)
|
||||
{
|
||||
// May be null during .Clear().
|
||||
if (filter.NewValue == null)
|
||||
if (filter.NewValue.IsNull())
|
||||
return;
|
||||
|
||||
// Never select the manage collection filter - rollback to the previous filter.
|
||||
@ -112,7 +113,7 @@ namespace osu.Game.Collections
|
||||
return;
|
||||
}
|
||||
|
||||
var newCollection = filter.NewValue?.Collection;
|
||||
var newCollection = filter.NewValue.Collection;
|
||||
|
||||
// This dropdown be weird.
|
||||
// We only care about filtering if the actual collection has changed.
|
||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Overlays
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Pink);
|
||||
|
||||
[Cached]
|
||||
private readonly Bindable<Channel> currentChannel = new Bindable<Channel>();
|
||||
private readonly Bindable<Channel?> currentChannel = new Bindable<Channel?>();
|
||||
|
||||
private readonly IBindableList<Channel> availableChannels = new BindableList<Channel>();
|
||||
private readonly IBindableList<Channel> joinedChannels = new BindableList<Channel>();
|
||||
@ -293,7 +293,7 @@ namespace osu.Game.Overlays
|
||||
base.OnFocus(e);
|
||||
}
|
||||
|
||||
private void currentChannelChanged(ValueChangedEvent<Channel> channel)
|
||||
private void currentChannelChanged(ValueChangedEvent<Channel?> channel)
|
||||
{
|
||||
Channel? newChannel = channel.NewValue;
|
||||
|
||||
@ -402,7 +402,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
List<Channel> overlayChannels = channelList.Channels.ToList();
|
||||
|
||||
if (overlayChannels.Count < 2)
|
||||
if (overlayChannels.Count < 2 || currentChannel.Value == null)
|
||||
return;
|
||||
|
||||
int currentIndex = overlayChannels.IndexOf(currentChannel.Value);
|
||||
|
@ -188,7 +188,7 @@ namespace osu.Game.Overlays.FirstRunSetup
|
||||
|
||||
public IEnumerable<string> HandledExtensions { get; } = new[] { string.Empty };
|
||||
|
||||
private readonly Bindable<DirectoryInfo> currentDirectory = new Bindable<DirectoryInfo>();
|
||||
private readonly Bindable<DirectoryInfo?> currentDirectory = new Bindable<DirectoryInfo?>();
|
||||
|
||||
[Resolved(canBeNull: true)] // Can't really be null but required to handle potential of disposal before DI completes.
|
||||
private OsuGameBase? game { get; set; }
|
||||
@ -206,7 +206,7 @@ namespace osu.Game.Overlays.FirstRunSetup
|
||||
currentDirectory.Value = new DirectoryInfo(fullPath);
|
||||
}
|
||||
|
||||
private void onDirectorySelected(ValueChangedEvent<DirectoryInfo> directory)
|
||||
private void onDirectorySelected(ValueChangedEvent<DirectoryInfo?> directory)
|
||||
{
|
||||
if (directory.NewValue == null)
|
||||
{
|
||||
@ -247,7 +247,7 @@ namespace osu.Game.Overlays.FirstRunSetup
|
||||
|
||||
private class DirectoryChooserPopover : OsuPopover
|
||||
{
|
||||
public DirectoryChooserPopover(Bindable<DirectoryInfo> currentDirectory)
|
||||
public DirectoryChooserPopover(Bindable<DirectoryInfo?> currentDirectory)
|
||||
{
|
||||
Child = new Container
|
||||
{
|
||||
|
@ -5,13 +5,12 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Screens.OnlinePlay.Components;
|
||||
using PlaylistItem = osu.Game.Online.Rooms.PlaylistItem;
|
||||
|
||||
namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
{
|
||||
public class LoungeBackgroundScreen : OnlinePlayBackgroundScreen
|
||||
{
|
||||
public readonly Bindable<Room> SelectedRoom = new Bindable<Room>();
|
||||
public readonly Bindable<Room?> SelectedRoom = new Bindable<Room?>();
|
||||
private readonly BindableList<PlaylistItem> playlist = new BindableList<PlaylistItem>();
|
||||
|
||||
public LoungeBackgroundScreen()
|
||||
@ -20,7 +19,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
playlist.BindCollectionChanged((_, _) => PlaylistItem = playlist.GetCurrentItem());
|
||||
}
|
||||
|
||||
private void onSelectedRoomChanged(ValueChangedEvent<Room> room)
|
||||
private void onSelectedRoomChanged(ValueChangedEvent<Room?> room)
|
||||
{
|
||||
if (room.OldValue != null)
|
||||
playlist.UnbindFrom(room.OldValue.Playlist);
|
||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
{
|
||||
public class BeatmapOffsetControl : CompositeDrawable
|
||||
{
|
||||
public Bindable<ScoreInfo> ReferenceScore { get; } = new Bindable<ScoreInfo>();
|
||||
public Bindable<ScoreInfo?> ReferenceScore { get; } = new Bindable<ScoreInfo?>();
|
||||
|
||||
public BindableDouble Current { get; } = new BindableDouble
|
||||
{
|
||||
@ -176,7 +176,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
}
|
||||
}
|
||||
|
||||
private void scoreChanged(ValueChangedEvent<ScoreInfo> score)
|
||||
private void scoreChanged(ValueChangedEvent<ScoreInfo?> score)
|
||||
{
|
||||
referenceScoreContainer.Clear();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user