mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Update with framework bindable changes
This commit is contained in:
@ -108,7 +108,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
},
|
||||
};
|
||||
|
||||
CurrentItem.BindValueChanged(i => modDisplay.Current.Value = i?.RequiredMods, true);
|
||||
CurrentItem.BindValueChanged(e => modDisplay.Current.Value = e.NewValue?.RequiredMods, true);
|
||||
|
||||
beatmapButton.Action = () => RequestBeatmapSelection?.Invoke();
|
||||
}
|
||||
@ -126,7 +126,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
roomId.BindValueChanged(v => this.FadeTo(v.HasValue ? 0 : 1), true);
|
||||
roomId.BindValueChanged(e => this.FadeTo(e.NewValue.HasValue ? 0 : 1), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
}
|
||||
};
|
||||
|
||||
Host.BindValueChanged(updateHost);
|
||||
Host.BindValueChanged(e => updateHost(e.NewValue));
|
||||
}
|
||||
|
||||
private void updateHost(User host)
|
||||
|
@ -92,10 +92,10 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
},
|
||||
};
|
||||
|
||||
CurrentItem.BindValueChanged(item =>
|
||||
CurrentItem.BindValueChanged(e =>
|
||||
{
|
||||
viewBeatmapButton.Beatmap.Value = item?.Beatmap;
|
||||
readyButton.Beatmap.Value = item?.Beatmap;
|
||||
viewBeatmapButton.Beatmap.Value = e.NewValue?.Beatmap;
|
||||
readyButton.Beatmap.Value = e.NewValue?.Beatmap;
|
||||
}, true);
|
||||
|
||||
hostInfo.Host.BindTo(Host);
|
||||
|
@ -28,13 +28,13 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
roomId.BindValueChanged(v => updateChannel(), true);
|
||||
roomId.BindValueChanged(e => updateChannel(), true);
|
||||
}
|
||||
|
||||
private void updateChannel()
|
||||
{
|
||||
if (roomId.Value != null)
|
||||
Channel.Value = channelManager?.JoinChannel(new Channel { Id = channelId, Type = ChannelType.Multiplayer, Name = $"#mp_{roomId.Value}" });
|
||||
Channel.Value = channelManager?.JoinChannel(new Channel { Id = channelId.Value, Type = ChannelType.Multiplayer, Name = $"#mp_{roomId.Value}" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,9 +23,9 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
roomId.BindValueChanged(id =>
|
||||
roomId.BindValueChanged(e =>
|
||||
{
|
||||
if (id == null)
|
||||
if (e.NewValue == null)
|
||||
return;
|
||||
|
||||
Scores = null;
|
||||
|
@ -264,12 +264,12 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
processingOverlay = new ProcessingOverlay { Alpha = 0 }
|
||||
};
|
||||
|
||||
TypePicker.Current.BindValueChanged(t => typeLabel.Text = t?.Name ?? string.Empty, true);
|
||||
Name.BindValueChanged(n => NameField.Text = n, true);
|
||||
Availability.BindValueChanged(a => AvailabilityPicker.Current.Value = a, true);
|
||||
Type.BindValueChanged(t => TypePicker.Current.Value = t, true);
|
||||
MaxParticipants.BindValueChanged(m => MaxParticipantsField.Text = m?.ToString(), true);
|
||||
Duration.BindValueChanged(d => DurationField.Current.Value = d, true);
|
||||
TypePicker.Current.BindValueChanged(e => typeLabel.Text = e.NewValue?.Name ?? string.Empty, true);
|
||||
Name.BindValueChanged(e => NameField.Text = e.NewValue, true);
|
||||
Availability.BindValueChanged(e => AvailabilityPicker.Current.Value = e.NewValue, true);
|
||||
Type.BindValueChanged(e => TypePicker.Current.Value = e.NewValue, true);
|
||||
MaxParticipants.BindValueChanged(e => MaxParticipantsField.Text = e.NewValue?.ToString(), true);
|
||||
Duration.BindValueChanged(e => DurationField.Current.Value = e.NewValue, true);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
@ -296,7 +296,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
|
||||
Duration.Value = DurationField.Current.Value;
|
||||
|
||||
manager?.CreateRoom(currentRoom, onSuccess, onError);
|
||||
manager?.CreateRoom(currentRoom.Value, onSuccess, onError);
|
||||
|
||||
processingOverlay.Show();
|
||||
}
|
||||
|
@ -26,9 +26,9 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
roomId.BindValueChanged(v =>
|
||||
roomId.BindValueChanged(e =>
|
||||
{
|
||||
if (v.HasValue)
|
||||
if (e.NewValue.HasValue)
|
||||
{
|
||||
Items.ForEach(t => t.Enabled.Value = !(t is SettingsMatchPage));
|
||||
Current.Value = new RoomMatchPage();
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
: base(value)
|
||||
{
|
||||
enabled.BindTo(value.Enabled);
|
||||
enabled.BindValueChanged(v => Colour = v ? Color4.White : Color4.Gray);
|
||||
enabled.BindValueChanged(e => Colour = e.NewValue ? Color4.White : Color4.Gray);
|
||||
}
|
||||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
|
@ -50,9 +50,9 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
},
|
||||
};
|
||||
|
||||
Participants.BindValueChanged(v =>
|
||||
Participants.BindValueChanged(e =>
|
||||
{
|
||||
usersFlow.Children = v.Select(u => new UserPanel(u)
|
||||
usersFlow.Children = e.NewValue.Select(u => new UserPanel(u)
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
{
|
||||
beatmaps.ItemAdded += beatmapAdded;
|
||||
|
||||
Beatmap.BindValueChanged(updateBeatmap, true);
|
||||
Beatmap.BindValueChanged(e => updateBeatmap(e.NewValue), true);
|
||||
}
|
||||
|
||||
private void updateBeatmap(BeatmapInfo beatmap)
|
||||
@ -77,7 +77,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
return;
|
||||
}
|
||||
|
||||
bool hasEnoughTime = DateTimeOffset.UtcNow.AddSeconds(30).AddMilliseconds(gameBeatmap.Value.Track.Length) < endDate;
|
||||
bool hasEnoughTime = DateTimeOffset.UtcNow.AddSeconds(30).AddMilliseconds(gameBeatmap.Value.Track.Length) < endDate.Value;
|
||||
|
||||
Enabled.Value = hasBeatmap && hasEnoughTime;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
private void load()
|
||||
{
|
||||
if (osuGame != null)
|
||||
Beatmap.BindValueChanged(updateAction, true);
|
||||
Beatmap.BindValueChanged(e => updateAction(e.NewValue), true);
|
||||
}
|
||||
|
||||
private void updateAction(BeatmapInfo beatmap)
|
||||
|
Reference in New Issue
Block a user