mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:33:21 +08:00
Make Room.AutoSkip
non-bindable
This commit is contained in:
parent
ec5be6dbc3
commit
f001cce24a
@ -848,7 +848,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
APIRoom.QueueMode = Room.Settings.QueueMode;
|
APIRoom.QueueMode = Room.Settings.QueueMode;
|
||||||
APIRoom.AutoStartDuration.Value = Room.Settings.AutoStartDuration;
|
APIRoom.AutoStartDuration.Value = Room.Settings.AutoStartDuration;
|
||||||
APIRoom.CurrentPlaylistItem = APIRoom.Playlist.Single(item => item.ID == settings.PlaylistItemId);
|
APIRoom.CurrentPlaylistItem = APIRoom.Playlist.Single(item => item.ID == settings.PlaylistItemId);
|
||||||
APIRoom.AutoSkip.Value = Room.Settings.AutoSkip;
|
APIRoom.AutoSkip = Room.Settings.AutoSkip;
|
||||||
|
|
||||||
RoomUpdated?.Invoke();
|
RoomUpdated?.Invoke();
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,15 @@ namespace osu.Game.Online.Rooms
|
|||||||
set => SetField(ref queueMode, value);
|
set => SetField(ref queueMode, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether to automatically skip map intros. Only valid for multiplayer rooms.
|
||||||
|
/// </summary>
|
||||||
|
public bool AutoSkip
|
||||||
|
{
|
||||||
|
get => autoSkip;
|
||||||
|
set => SetField(ref autoSkip, value);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the current item selected within the room.
|
/// Represents the current item selected within the room.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -134,7 +143,6 @@ namespace osu.Game.Online.Rooms
|
|||||||
set => SetField(ref availability, value);
|
set => SetField(ref availability, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
private long? roomId;
|
private long? roomId;
|
||||||
|
|
||||||
@ -162,6 +170,9 @@ namespace osu.Game.Online.Rooms
|
|||||||
[JsonProperty("queue_mode")]
|
[JsonProperty("queue_mode")]
|
||||||
private QueueMode queueMode;
|
private QueueMode queueMode;
|
||||||
|
|
||||||
|
[JsonProperty("auto_skip")]
|
||||||
|
private bool autoSkip;
|
||||||
|
|
||||||
[JsonProperty("current_playlist_item")]
|
[JsonProperty("current_playlist_item")]
|
||||||
private PlaylistItem? currentPlaylistItem;
|
private PlaylistItem? currentPlaylistItem;
|
||||||
|
|
||||||
@ -253,10 +264,6 @@ namespace osu.Game.Online.Rooms
|
|||||||
set => MaxAttempts.Value = value;
|
set => MaxAttempts.Value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Cached]
|
|
||||||
[JsonProperty("auto_skip")]
|
|
||||||
public readonly Bindable<bool> AutoSkip = new Bindable<bool>();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Copies values from another <see cref="Room"/> into this one.
|
/// Copies values from another <see cref="Room"/> into this one.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -288,7 +295,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
DifficultyRange.Value = other.DifficultyRange.Value;
|
DifficultyRange.Value = other.DifficultyRange.Value;
|
||||||
PlaylistItemStats.Value = other.PlaylistItemStats.Value;
|
PlaylistItemStats.Value = other.PlaylistItemStats.Value;
|
||||||
CurrentPlaylistItem = other.CurrentPlaylistItem;
|
CurrentPlaylistItem = other.CurrentPlaylistItem;
|
||||||
AutoSkip.Value = other.AutoSkip.Value;
|
AutoSkip = other.AutoSkip;
|
||||||
|
|
||||||
other.RemoveExpiredPlaylistItems();
|
other.RemoveExpiredPlaylistItems();
|
||||||
|
|
||||||
|
@ -352,7 +352,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
TypePicker.Current.BindValueChanged(type => typeLabel.Text = type.NewValue.GetLocalisableDescription(), true);
|
TypePicker.Current.BindValueChanged(type => typeLabel.Text = type.NewValue.GetLocalisableDescription(), true);
|
||||||
MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true);
|
MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true);
|
||||||
AutoStartDuration.BindValueChanged(duration => startModeDropdown.Current.Value = (StartMode)(int)duration.NewValue.TotalSeconds, true);
|
AutoStartDuration.BindValueChanged(duration => startModeDropdown.Current.Value = (StartMode)(int)duration.NewValue.TotalSeconds, true);
|
||||||
AutoSkip.BindValueChanged(autoSkip => AutoSkipCheckbox.Current.Value = autoSkip.NewValue, true);
|
|
||||||
|
|
||||||
operationInProgress.BindTo(ongoingOperationTracker.InProgress);
|
operationInProgress.BindTo(ongoingOperationTracker.InProgress);
|
||||||
operationInProgress.BindValueChanged(v =>
|
operationInProgress.BindValueChanged(v =>
|
||||||
@ -377,6 +376,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
updateRoomType();
|
updateRoomType();
|
||||||
updateRoomQueueMode();
|
updateRoomQueueMode();
|
||||||
updateRoomPassword();
|
updateRoomPassword();
|
||||||
|
updateRoomAutoSkip();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onRoomPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
private void onRoomPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
||||||
@ -398,6 +398,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
case nameof(Room.Password):
|
case nameof(Room.Password):
|
||||||
updateRoomPassword();
|
updateRoomPassword();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case nameof(Room.AutoSkip):
|
||||||
|
updateRoomAutoSkip();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,6 +417,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
private void updateRoomPassword()
|
private void updateRoomPassword()
|
||||||
=> PasswordTextBox.Text = room.Password ?? string.Empty;
|
=> PasswordTextBox.Text = room.Password ?? string.Empty;
|
||||||
|
|
||||||
|
private void updateRoomAutoSkip()
|
||||||
|
=> AutoSkipCheckbox.Current.Value = room.AutoSkip;
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
@ -459,7 +466,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
|||||||
room.Password = PasswordTextBox.Current.Value;
|
room.Password = PasswordTextBox.Current.Value;
|
||||||
room.QueueMode = QueueModeDropdown.Current.Value;
|
room.QueueMode = QueueModeDropdown.Current.Value;
|
||||||
room.AutoStartDuration.Value = autoStartDuration;
|
room.AutoStartDuration.Value = autoStartDuration;
|
||||||
room.AutoSkip.Value = AutoSkipCheckbox.Current.Value;
|
room.AutoSkip = AutoSkipCheckbox.Current.Value;
|
||||||
|
|
||||||
if (int.TryParse(MaxParticipantsField.Text, out int max))
|
if (int.TryParse(MaxParticipantsField.Text, out int max))
|
||||||
room.MaxParticipants.Value = max;
|
room.MaxParticipants.Value = max;
|
||||||
|
@ -50,8 +50,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
AllowPause = false,
|
AllowPause = false,
|
||||||
AllowRestart = false,
|
AllowRestart = false,
|
||||||
AllowFailAnimation = false,
|
AllowFailAnimation = false,
|
||||||
AllowSkipping = room.AutoSkip.Value,
|
AllowSkipping = room.AutoSkip,
|
||||||
AutomaticallySkipIntro = room.AutoSkip.Value,
|
AutomaticallySkipIntro = room.AutoSkip,
|
||||||
AlwaysShowLeaderboard = true,
|
AlwaysShowLeaderboard = true,
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
|
@ -50,8 +50,5 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
|
|
||||||
[Resolved(typeof(Room))]
|
[Resolved(typeof(Room))]
|
||||||
protected Bindable<TimeSpan> AutoStartDuration { get; private set; } = null!;
|
protected Bindable<TimeSpan> AutoStartDuration { get; private set; } = null!;
|
||||||
|
|
||||||
[Resolved(typeof(Room))]
|
|
||||||
protected Bindable<bool> AutoSkip { get; private set; } = null!;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user