1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-08 07:02:54 +08:00

Standardise naming to use "Freestyle" not "FreeStyle"

This commit is contained in:
Dean Herbert 2025-02-03 18:54:18 +09:00
parent bc930e8fd3
commit 444e0970d6
No known key found for this signature in database
9 changed files with 27 additions and 27 deletions

View File

@ -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.
/// </summary>
[Key(11)]
public bool FreeStyle { get; set; }
public bool Freestyle { get; set; }
[SerializationConstructor]
public MultiplayerPlaylistItem()

View File

@ -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.
/// </summary>
[JsonProperty("freestyle")]
public bool FreeStyle { get; set; }
public bool Freestyle { get; set; }
/// <summary>
/// A beatmap representing this playlist item.
@ -107,7 +107,7 @@ namespace osu.Game.Online.Rooms
PlayedAt = item.PlayedAt;
RequiredMods = item.RequiredMods.ToArray();
AllowedMods = item.AllowedMods.ToArray();
FreeStyle = item.FreeStyle;
Freestyle = item.Freestyle;
}
public void MarkInvalid() => valid.Value = false;
@ -139,7 +139,7 @@ namespace osu.Game.Online.Rooms
PlayedAt = PlayedAt,
AllowedMods = AllowedMods,
RequiredMods = RequiredMods,
FreeStyle = FreeStyle,
Freestyle = Freestyle,
valid = { Value = Valid.Value },
};
}
@ -152,6 +152,6 @@ namespace osu.Game.Online.Rooms
&& PlaylistOrder == other.PlaylistOrder
&& AllowedMods.SequenceEqual(other.AllowedMods)
&& RequiredMods.SequenceEqual(other.RequiredMods)
&& FreeStyle == other.FreeStyle;
&& Freestyle == other.Freestyle;
}
}

View File

@ -16,7 +16,7 @@ using osu.Game.Localisation;
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>();
@ -34,7 +34,7 @@ namespace osu.Game.Screens.OnlinePlay
[Resolved]
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.
base.Action = () => current.Value = !current.Value;

View File

@ -169,7 +169,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft
},
new FreeStyleStatusPill(Room)
new FreestyleStatusPill(Room)
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft

View File

@ -10,7 +10,7 @@ using osuTK.Graphics;
namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{
public partial class FreeStyleStatusPill : OnlinePlayPill
public partial class FreestyleStatusPill : OnlinePlayPill
{
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);
public FreeStyleStatusPill(Room room)
public FreestyleStatusPill(Room room)
{
this.room = room;
}
@ -35,7 +35,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
TextFlow.Colour = Color4.Black;
room.PropertyChanged += onRoomPropertyChanged;
updateFreeStyleStatus();
updateFreestyleStatus();
}
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.Playlist):
updateFreeStyleStatus();
updateFreestyleStatus();
break;
}
}
private void updateFreeStyleStatus()
private void updateFreestyleStatus()
{
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)

View File

@ -450,11 +450,11 @@ namespace osu.Game.Screens.OnlinePlay.Match
Ruleset.Value = GetGameplayRuleset();
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.
// 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)
{
@ -468,7 +468,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
UserModsSelectOverlay.IsValidMod = _ => false;
}
if (freeStyle)
if (freestyle)
{
UserStyleSection.Show();
@ -481,7 +481,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
UserStyleDisplayContainer.Child = new DrawableRoomPlaylistItem(gameplayItem, true)
{
AllowReordering = false,
AllowEditing = freeStyle,
AllowEditing = freestyle,
RequestEdit = _ => OpenStyleSelection()
};
}

View File

@ -87,7 +87,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
RulesetID = item.RulesetID,
RequiredMods = item.RequiredMods.ToArray(),
AllowedMods = item.AllowedMods.ToArray(),
FreeStyle = item.FreeStyle
Freestyle = item.Freestyle
};
Task task = itemToEdit != null ? client.EditPlaylistItem(multiplayerItem) : client.AddPlaylistItem(multiplayerItem);

View File

@ -42,7 +42,7 @@ namespace osu.Game.Screens.OnlinePlay
protected override UserActivity InitialActivity => new UserActivity.InLobby(room);
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 PlaylistItem? initialItem;
@ -112,17 +112,17 @@ namespace osu.Game.Screens.OnlinePlay
FreeMods.Value = initialItem.AllowedMods.Select(m => m.ToMod(rulesetInstance)).ToArray();
}
FreeStyle.Value = initialItem.FreeStyle;
Freestyle.Value = initialItem.Freestyle;
}
Mods.BindValueChanged(onModsChanged);
Ruleset.BindValueChanged(onRulesetChanged);
FreeStyle.BindValueChanged(onFreeStyleChanged, true);
Freestyle.BindValueChanged(onFreestyleChanged, true);
freeModSelectOverlayRegistration = OverlayManager?.RegisterBlockingOverlay(freeModSelect);
}
private void onFreeStyleChanged(ValueChangedEvent<bool> enabled)
private void onFreestyleChanged(ValueChangedEvent<bool> enabled)
{
if (enabled.NewValue)
{
@ -162,7 +162,7 @@ namespace osu.Game.Screens.OnlinePlay
RulesetID = Ruleset.Value.OnlineID,
RequiredMods = Mods.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);
@ -204,12 +204,12 @@ namespace osu.Game.Screens.OnlinePlay
baseButtons.Single(i => i.button is FooterButtonMods).button.TooltipText = MultiplayerMatchStrings.RequiredModsButtonTooltip;
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?)[]
{
(freeModsFooterButton, null),
(freeStyleButton, null)
(freestyleButton, null)
});
return baseButtons;

View File

@ -40,7 +40,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
RulesetID = Ruleset.Value.OnlineID,
RequiredMods = Mods.Value.Select(m => new APIMod(m)).ToArray(),
AllowedMods = FreeMods.Value.Select(m => new APIMod(m)).ToArray(),
FreeStyle = FreeStyle.Value
Freestyle = Freestyle.Value
};
}
}