1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 11:43:22 +08:00

Adjust namings

This commit is contained in:
Dan Balasescu 2024-12-24 19:05:50 +09:00
parent 40486c4f38
commit 971ccb6a4e
No known key found for this signature in database
3 changed files with 11 additions and 11 deletions

View File

@ -15,7 +15,7 @@ using osu.Game.Screens.Select;
namespace osu.Game.Screens.OnlinePlay
{
public class FooterButtonFreePlay : FooterButton, IHasCurrentValue<bool>
public class FooterButtonFreeStyle : FooterButton, IHasCurrentValue<bool>
{
private readonly BindableWithCurrent<bool> current = new BindableWithCurrent<bool>();
@ -33,7 +33,7 @@ namespace osu.Game.Screens.OnlinePlay
[Resolved]
private OsuColour colours { get; set; } = null!;
public FooterButtonFreePlay()
public FooterButtonFreeStyle()
{
// Overwrite any external behaviour as we delegate the main toggle action to a sub-button.
base.Action = () => current.Value = !current.Value;
@ -71,7 +71,7 @@ namespace osu.Game.Screens.OnlinePlay
SelectedColour = colours.Yellow;
DeselectedColour = SelectedColour.Opacity(0.5f);
Text = @"freeplay";
Text = @"freestyle";
}
protected override void LoadComplete()

View File

@ -41,7 +41,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> FreePlay = 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
}
if (initialItem.BeatmapSetId != null)
FreePlay.Value = true;
FreeStyle.Value = true;
}
Mods.BindValueChanged(onModsChanged);
Ruleset.BindValueChanged(onRulesetChanged);
FreePlay.BindValueChanged(onFreePlayChanged, true);
FreeStyle.BindValueChanged(onFreeStyleChanged, true);
freeModSelectOverlayRegistration = OverlayManager?.RegisterBlockingOverlay(freeModSelect);
}
private void onFreePlayChanged(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(),
BeatmapSetId = FreePlay.Value ? Beatmap.Value.BeatmapSetInfo.OnlineID : null
BeatmapSetId = FreeStyle.Value ? Beatmap.Value.BeatmapSetInfo.OnlineID : null
};
return SelectItem(item);
@ -202,12 +202,12 @@ namespace osu.Game.Screens.OnlinePlay
var baseButtons = base.CreateSongSelectFooterButtons().ToList();
freeModsFooterButton = new FooterButtonFreeMods(freeModSelect) { Current = FreeMods };
var freePlayButton = new FooterButtonFreePlay { Current = FreePlay };
var freeStyleButton = new FooterButtonFreeStyle { Current = FreeStyle };
baseButtons.InsertRange(baseButtons.FindIndex(b => b.Item1 is FooterButtonMods) + 1, new (FooterButton, OverlayContainer?)[]
{
(freeModsFooterButton, freeModSelect),
(freePlayButton, null)
(freeStyleButton, null)
});
return baseButtons;

View File

@ -37,7 +37,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
private PlaylistItem createNewItem() => new PlaylistItem(Beatmap.Value.BeatmapInfo)
{
ID = room.Playlist.Count == 0 ? 0 : room.Playlist.Max(p => p.ID) + 1,
BeatmapSetId = FreePlay.Value ? Beatmap.Value.BeatmapSetInfo.OnlineID : null,
BeatmapSetId = FreeStyle.Value ? Beatmap.Value.BeatmapSetInfo.OnlineID : null,
RulesetID = Ruleset.Value.OnlineID,
RequiredMods = Mods.Value.Select(m => new APIMod(m)).ToArray(),
AllowedMods = FreeMods.Value.Select(m => new APIMod(m)).ToArray(),