mirror of
https://github.com/ppy/osu.git
synced 2025-02-08 13:05:27 +08:00
Standardise naming to use "Freestyle" not "FreeStyle"
This commit is contained in:
parent
bc930e8fd3
commit
444e0970d6
@ -60,7 +60,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
/// Indicates whether participants in the room are able to pick their own choice of beatmap difficulty and ruleset.
|
/// Indicates whether participants in the room are able to pick their own choice of beatmap difficulty and ruleset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Key(11)]
|
[Key(11)]
|
||||||
public bool FreeStyle { get; set; }
|
public bool Freestyle { get; set; }
|
||||||
|
|
||||||
[SerializationConstructor]
|
[SerializationConstructor]
|
||||||
public MultiplayerPlaylistItem()
|
public MultiplayerPlaylistItem()
|
||||||
|
@ -71,7 +71,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
/// Indicates whether participants in the room are able to pick their own choice of beatmap difficulty and ruleset.
|
/// Indicates whether participants in the room are able to pick their own choice of beatmap difficulty and ruleset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("freestyle")]
|
[JsonProperty("freestyle")]
|
||||||
public bool FreeStyle { get; set; }
|
public bool Freestyle { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A beatmap representing this playlist item.
|
/// A beatmap representing this playlist item.
|
||||||
@ -107,7 +107,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
PlayedAt = item.PlayedAt;
|
PlayedAt = item.PlayedAt;
|
||||||
RequiredMods = item.RequiredMods.ToArray();
|
RequiredMods = item.RequiredMods.ToArray();
|
||||||
AllowedMods = item.AllowedMods.ToArray();
|
AllowedMods = item.AllowedMods.ToArray();
|
||||||
FreeStyle = item.FreeStyle;
|
Freestyle = item.Freestyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MarkInvalid() => valid.Value = false;
|
public void MarkInvalid() => valid.Value = false;
|
||||||
@ -139,7 +139,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
PlayedAt = PlayedAt,
|
PlayedAt = PlayedAt,
|
||||||
AllowedMods = AllowedMods,
|
AllowedMods = AllowedMods,
|
||||||
RequiredMods = RequiredMods,
|
RequiredMods = RequiredMods,
|
||||||
FreeStyle = FreeStyle,
|
Freestyle = Freestyle,
|
||||||
valid = { Value = Valid.Value },
|
valid = { Value = Valid.Value },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -152,6 +152,6 @@ namespace osu.Game.Online.Rooms
|
|||||||
&& PlaylistOrder == other.PlaylistOrder
|
&& PlaylistOrder == other.PlaylistOrder
|
||||||
&& AllowedMods.SequenceEqual(other.AllowedMods)
|
&& AllowedMods.SequenceEqual(other.AllowedMods)
|
||||||
&& RequiredMods.SequenceEqual(other.RequiredMods)
|
&& RequiredMods.SequenceEqual(other.RequiredMods)
|
||||||
&& FreeStyle == other.FreeStyle;
|
&& Freestyle == other.Freestyle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ using osu.Game.Localisation;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.OnlinePlay
|
namespace osu.Game.Screens.OnlinePlay
|
||||||
{
|
{
|
||||||
public partial class FooterButtonFreeStyle : FooterButton, IHasCurrentValue<bool>
|
public partial class FooterButtonFreestyle : FooterButton, IHasCurrentValue<bool>
|
||||||
{
|
{
|
||||||
private readonly BindableWithCurrent<bool> current = new BindableWithCurrent<bool>();
|
private readonly BindableWithCurrent<bool> current = new BindableWithCurrent<bool>();
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; } = null!;
|
private OsuColour colours { get; set; } = null!;
|
||||||
|
|
||||||
public FooterButtonFreeStyle()
|
public FooterButtonFreestyle()
|
||||||
{
|
{
|
||||||
// Overwrite any external behaviour as we delegate the main toggle action to a sub-button.
|
// Overwrite any external behaviour as we delegate the main toggle action to a sub-button.
|
||||||
base.Action = () => current.Value = !current.Value;
|
base.Action = () => current.Value = !current.Value;
|
@ -169,7 +169,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft
|
Origin = Anchor.CentreLeft
|
||||||
},
|
},
|
||||||
new FreeStyleStatusPill(Room)
|
new FreestyleStatusPill(Room)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft
|
Origin = Anchor.CentreLeft
|
||||||
|
@ -10,7 +10,7 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||||
{
|
{
|
||||||
public partial class FreeStyleStatusPill : OnlinePlayPill
|
public partial class FreestyleStatusPill : OnlinePlayPill
|
||||||
{
|
{
|
||||||
private readonly Room room;
|
private readonly Room room;
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|||||||
|
|
||||||
protected override FontUsage Font => base.Font.With(weight: FontWeight.SemiBold);
|
protected override FontUsage Font => base.Font.With(weight: FontWeight.SemiBold);
|
||||||
|
|
||||||
public FreeStyleStatusPill(Room room)
|
public FreestyleStatusPill(Room room)
|
||||||
{
|
{
|
||||||
this.room = room;
|
this.room = room;
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|||||||
TextFlow.Colour = Color4.Black;
|
TextFlow.Colour = Color4.Black;
|
||||||
|
|
||||||
room.PropertyChanged += onRoomPropertyChanged;
|
room.PropertyChanged += onRoomPropertyChanged;
|
||||||
updateFreeStyleStatus();
|
updateFreestyleStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onRoomPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
private void onRoomPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
||||||
@ -44,15 +44,15 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|||||||
{
|
{
|
||||||
case nameof(Room.CurrentPlaylistItem):
|
case nameof(Room.CurrentPlaylistItem):
|
||||||
case nameof(Room.Playlist):
|
case nameof(Room.Playlist):
|
||||||
updateFreeStyleStatus();
|
updateFreestyleStatus();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateFreeStyleStatus()
|
private void updateFreestyleStatus()
|
||||||
{
|
{
|
||||||
PlaylistItem? currentItem = room.Playlist.GetCurrentItem() ?? room.CurrentPlaylistItem;
|
PlaylistItem? currentItem = room.Playlist.GetCurrentItem() ?? room.CurrentPlaylistItem;
|
||||||
Alpha = currentItem?.FreeStyle == true ? 1 : 0;
|
Alpha = currentItem?.Freestyle == true ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
@ -450,11 +450,11 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
|||||||
Ruleset.Value = GetGameplayRuleset();
|
Ruleset.Value = GetGameplayRuleset();
|
||||||
|
|
||||||
bool freeMod = item.AllowedMods.Any();
|
bool freeMod = item.AllowedMods.Any();
|
||||||
bool freeStyle = item.FreeStyle;
|
bool freestyle = item.Freestyle;
|
||||||
|
|
||||||
// For now, the game can never be in a state where freemod and freestyle are on at the same time.
|
// For now, the game can never be in a state where freemod and freestyle are on at the same time.
|
||||||
// This will change, but due to the current implementation if this was to occur drawables will overlap so let's assert.
|
// This will change, but due to the current implementation if this was to occur drawables will overlap so let's assert.
|
||||||
Debug.Assert(!freeMod || !freeStyle);
|
Debug.Assert(!freeMod || !freestyle);
|
||||||
|
|
||||||
if (freeMod)
|
if (freeMod)
|
||||||
{
|
{
|
||||||
@ -468,7 +468,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
|||||||
UserModsSelectOverlay.IsValidMod = _ => false;
|
UserModsSelectOverlay.IsValidMod = _ => false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (freeStyle)
|
if (freestyle)
|
||||||
{
|
{
|
||||||
UserStyleSection.Show();
|
UserStyleSection.Show();
|
||||||
|
|
||||||
@ -481,7 +481,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
|||||||
UserStyleDisplayContainer.Child = new DrawableRoomPlaylistItem(gameplayItem, true)
|
UserStyleDisplayContainer.Child = new DrawableRoomPlaylistItem(gameplayItem, true)
|
||||||
{
|
{
|
||||||
AllowReordering = false,
|
AllowReordering = false,
|
||||||
AllowEditing = freeStyle,
|
AllowEditing = freestyle,
|
||||||
RequestEdit = _ => OpenStyleSelection()
|
RequestEdit = _ => OpenStyleSelection()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
RulesetID = item.RulesetID,
|
RulesetID = item.RulesetID,
|
||||||
RequiredMods = item.RequiredMods.ToArray(),
|
RequiredMods = item.RequiredMods.ToArray(),
|
||||||
AllowedMods = item.AllowedMods.ToArray(),
|
AllowedMods = item.AllowedMods.ToArray(),
|
||||||
FreeStyle = item.FreeStyle
|
Freestyle = item.Freestyle
|
||||||
};
|
};
|
||||||
|
|
||||||
Task task = itemToEdit != null ? client.EditPlaylistItem(multiplayerItem) : client.AddPlaylistItem(multiplayerItem);
|
Task task = itemToEdit != null ? client.EditPlaylistItem(multiplayerItem) : client.AddPlaylistItem(multiplayerItem);
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
protected override UserActivity InitialActivity => new UserActivity.InLobby(room);
|
protected override UserActivity InitialActivity => new UserActivity.InLobby(room);
|
||||||
|
|
||||||
protected readonly Bindable<IReadOnlyList<Mod>> FreeMods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
|
protected readonly Bindable<IReadOnlyList<Mod>> FreeMods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
|
||||||
protected readonly Bindable<bool> FreeStyle = new Bindable<bool>();
|
protected readonly Bindable<bool> Freestyle = new Bindable<bool>();
|
||||||
|
|
||||||
private readonly Room room;
|
private readonly Room room;
|
||||||
private readonly PlaylistItem? initialItem;
|
private readonly PlaylistItem? initialItem;
|
||||||
@ -112,17 +112,17 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
FreeMods.Value = initialItem.AllowedMods.Select(m => m.ToMod(rulesetInstance)).ToArray();
|
FreeMods.Value = initialItem.AllowedMods.Select(m => m.ToMod(rulesetInstance)).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeStyle.Value = initialItem.FreeStyle;
|
Freestyle.Value = initialItem.Freestyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mods.BindValueChanged(onModsChanged);
|
Mods.BindValueChanged(onModsChanged);
|
||||||
Ruleset.BindValueChanged(onRulesetChanged);
|
Ruleset.BindValueChanged(onRulesetChanged);
|
||||||
FreeStyle.BindValueChanged(onFreeStyleChanged, true);
|
Freestyle.BindValueChanged(onFreestyleChanged, true);
|
||||||
|
|
||||||
freeModSelectOverlayRegistration = OverlayManager?.RegisterBlockingOverlay(freeModSelect);
|
freeModSelectOverlayRegistration = OverlayManager?.RegisterBlockingOverlay(freeModSelect);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onFreeStyleChanged(ValueChangedEvent<bool> enabled)
|
private void onFreestyleChanged(ValueChangedEvent<bool> enabled)
|
||||||
{
|
{
|
||||||
if (enabled.NewValue)
|
if (enabled.NewValue)
|
||||||
{
|
{
|
||||||
@ -162,7 +162,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
RulesetID = Ruleset.Value.OnlineID,
|
RulesetID = Ruleset.Value.OnlineID,
|
||||||
RequiredMods = Mods.Value.Select(m => new APIMod(m)).ToArray(),
|
RequiredMods = Mods.Value.Select(m => new APIMod(m)).ToArray(),
|
||||||
AllowedMods = FreeMods.Value.Select(m => new APIMod(m)).ToArray(),
|
AllowedMods = FreeMods.Value.Select(m => new APIMod(m)).ToArray(),
|
||||||
FreeStyle = FreeStyle.Value
|
Freestyle = Freestyle.Value
|
||||||
};
|
};
|
||||||
|
|
||||||
return SelectItem(item);
|
return SelectItem(item);
|
||||||
@ -204,12 +204,12 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
baseButtons.Single(i => i.button is FooterButtonMods).button.TooltipText = MultiplayerMatchStrings.RequiredModsButtonTooltip;
|
baseButtons.Single(i => i.button is FooterButtonMods).button.TooltipText = MultiplayerMatchStrings.RequiredModsButtonTooltip;
|
||||||
|
|
||||||
freeModsFooterButton = new FooterButtonFreeMods(freeModSelect) { Current = FreeMods };
|
freeModsFooterButton = new FooterButtonFreeMods(freeModSelect) { Current = FreeMods };
|
||||||
var freeStyleButton = new FooterButtonFreeStyle { Current = FreeStyle };
|
var freestyleButton = new FooterButtonFreestyle { Current = Freestyle };
|
||||||
|
|
||||||
baseButtons.InsertRange(baseButtons.FindIndex(b => b.button is FooterButtonMods) + 1, new (FooterButton, OverlayContainer?)[]
|
baseButtons.InsertRange(baseButtons.FindIndex(b => b.button is FooterButtonMods) + 1, new (FooterButton, OverlayContainer?)[]
|
||||||
{
|
{
|
||||||
(freeModsFooterButton, null),
|
(freeModsFooterButton, null),
|
||||||
(freeStyleButton, null)
|
(freestyleButton, null)
|
||||||
});
|
});
|
||||||
|
|
||||||
return baseButtons;
|
return baseButtons;
|
||||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
RulesetID = Ruleset.Value.OnlineID,
|
RulesetID = Ruleset.Value.OnlineID,
|
||||||
RequiredMods = Mods.Value.Select(m => new APIMod(m)).ToArray(),
|
RequiredMods = Mods.Value.Select(m => new APIMod(m)).ToArray(),
|
||||||
AllowedMods = FreeMods.Value.Select(m => new APIMod(m)).ToArray(),
|
AllowedMods = FreeMods.Value.Select(m => new APIMod(m)).ToArray(),
|
||||||
FreeStyle = FreeStyle.Value
|
Freestyle = Freestyle.Value
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user