Compare commits
3 Commits
70f7f09a83
...
2025.825.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 6cb99c13c2 | |||
| 96008e06ab | |||
| 590b0a8028 |
@@ -8,6 +8,7 @@ using osu.Framework.Configuration;
|
||||
using osu.Framework.Configuration.Tracking;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Extensions.LocalisationExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Beatmaps.Drawables.Cards;
|
||||
@@ -41,6 +42,8 @@ namespace osu.Game.Configuration
|
||||
SetDefault(OsuSetting.Ruleset, string.Empty);
|
||||
SetDefault(OsuSetting.Skin, SkinInfo.ARGON_SKIN.ToString());
|
||||
|
||||
SetDefault(OsuSetting.MenuCookieColor, Colour4.FromHex(@"ff66ba"));
|
||||
|
||||
SetDefault(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Local);
|
||||
SetDefault(OsuSetting.BeatmapLeaderboardSortMode, LeaderboardSortMode.Score);
|
||||
SetDefault(OsuSetting.BeatmapDetailModsFilter, false);
|
||||
@@ -65,6 +68,7 @@ namespace osu.Game.Configuration
|
||||
|
||||
SetDefault(OsuSetting.ToolbarClockDisplayMode, ToolbarClockDisplayMode.Full);
|
||||
|
||||
SetDefault(OsuSetting.ForceLegacySongSelect, false);
|
||||
SetDefault(OsuSetting.SongSelectBackgroundBlur, false);
|
||||
|
||||
// Online settings
|
||||
@@ -405,6 +409,7 @@ namespace osu.Game.Configuration
|
||||
ChatDisplayHeight,
|
||||
BeatmapListingCardSize,
|
||||
ToolbarClockDisplayMode,
|
||||
ForceLegacySongSelect,
|
||||
SongSelectBackgroundBlur,
|
||||
Version,
|
||||
ShowFirstRunSetup,
|
||||
@@ -412,6 +417,7 @@ namespace osu.Game.Configuration
|
||||
Skin,
|
||||
ScreenshotFormat,
|
||||
ScreenshotCaptureMenuCursor,
|
||||
MenuCookieColor,
|
||||
BeatmapSkins,
|
||||
BeatmapColours,
|
||||
BeatmapHitsounds,
|
||||
|
||||
@@ -184,6 +184,11 @@ namespace osu.Game.Localisation
|
||||
/// </summary>
|
||||
public static LocalisableString SelectedMods => new TranslatableString(getKey(@"selected_mods"), @"Selected Mods");
|
||||
|
||||
/// <summary>
|
||||
/// "Use legacy song select (SelectV1)"
|
||||
/// </summary>
|
||||
public static LocalisableString ForceLegacySongSelect => new TranslatableString(getKey(@"force_select_v1"), @"Use legacy song select (SelectV1)");
|
||||
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
@@ -104,6 +106,12 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
|
||||
backgroundToggle,
|
||||
categoryDropdown,
|
||||
refreshButton,
|
||||
new SettingsColour
|
||||
{
|
||||
LabelText = @"osu! logo colour",
|
||||
Current = config.GetBindable<Colour4>(OsuSetting.MenuCookieColor),
|
||||
ClassicDefault = Colour4.FromHex(@"ff66ba"),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,12 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = UserInterfaceStrings.ForceLegacySongSelect,
|
||||
Current = config.GetBindable<bool>(OsuSetting.ForceLegacySongSelect),
|
||||
ClassicDefault = false
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = UserInterfaceStrings.ShowConvertedBeatmaps,
|
||||
|
||||
@@ -39,6 +39,7 @@ using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.OnlinePlay.DailyChallenge;
|
||||
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
||||
using osu.Game.Screens.OnlinePlay.Playlists;
|
||||
using osu.Game.Screens.Select;
|
||||
using osu.Game.Screens.SelectV2;
|
||||
using osu.Game.Seasonal;
|
||||
using osuTK;
|
||||
@@ -118,12 +119,15 @@ namespace osu.Game.Screens.Menu
|
||||
[CanBeNull]
|
||||
private IDisposable logoProxy;
|
||||
|
||||
private Bindable<bool> forceSSV1;
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics, AudioManager audio)
|
||||
{
|
||||
holdDelay = config.GetBindable<double>(OsuSetting.UIHoldActivationDelay);
|
||||
loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed);
|
||||
showMobileDisclaimer = config.GetBindable<bool>(OsuSetting.ShowMobileDisclaimer);
|
||||
forceSSV1 = config.GetBindable<bool>(OsuSetting.ForceLegacySongSelect);
|
||||
|
||||
if (host.CanExit)
|
||||
{
|
||||
@@ -479,7 +483,7 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
}
|
||||
|
||||
private void loadSongSelect() => this.Push(new SoloSongSelect());
|
||||
private void loadSongSelect() => this.Push(forceSSV1.Value ? new PlaySongSelect() : new SoloSongSelect());
|
||||
|
||||
private partial class MobileDisclaimerDialog : PopupDialog
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
@@ -20,6 +21,7 @@ using osu.Framework.Input.Events;
|
||||
using osu.Framework.Input.StateChanges;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Overlays;
|
||||
@@ -63,7 +65,10 @@ namespace osu.Game.Screens.Menu
|
||||
protected Sample SampleDownbeat;
|
||||
|
||||
private readonly Container colourAndTriangles;
|
||||
private readonly TrianglesV2 triangles;
|
||||
private Box colourBox;
|
||||
private TrianglesV2 triangles;
|
||||
|
||||
private Bindable<Colour4> logoColour;
|
||||
|
||||
/// <summary>
|
||||
/// Return value decides whether the logo should play its own sample for the click action.
|
||||
@@ -186,10 +191,13 @@ namespace osu.Game.Screens.Menu
|
||||
Origin = Anchor.Centre,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
colourBox = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = ColourInfo.GradientVertical(Color4Extensions.FromHex(@"ff66ab"), Color4Extensions.FromHex(@"cc5289")),
|
||||
Colour = ColourInfo.GradientVertical(
|
||||
Color4Extensions.FromHex(@"ff66ba"), // original osu! cookie pink
|
||||
Color4Extensions.Darken(Color4Extensions.FromHex(@"ff66ba"), 1.0f)
|
||||
),
|
||||
},
|
||||
triangles = new TrianglesV2
|
||||
{
|
||||
@@ -198,7 +206,10 @@ namespace osu.Game.Screens.Menu
|
||||
Thickness = 0.009f,
|
||||
ScaleAdjust = 3,
|
||||
SpawnRatio = 1.4f,
|
||||
Colour = ColourInfo.GradientVertical(Color4Extensions.FromHex(@"ff66ab"), Color4Extensions.FromHex(@"b6346f")),
|
||||
Colour = ColourInfo.GradientVertical(
|
||||
Color4Extensions.FromHex(@"ff66ba"),
|
||||
Color4Extensions.Darken(Color4Extensions.FromHex(@"ff66ba"), 2.5f)
|
||||
),
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
}
|
||||
@@ -249,6 +260,21 @@ namespace osu.Game.Screens.Menu
|
||||
};
|
||||
}
|
||||
|
||||
public void UpdateColour() {
|
||||
if (triangles == null || colourBox == null)
|
||||
return; // we're still loading
|
||||
|
||||
triangles.Colour = ColourInfo.GradientVertical(
|
||||
logoColour.Value,
|
||||
Color4Extensions.Darken(logoColour.Value, 1.0f)
|
||||
);
|
||||
|
||||
colourBox.Colour = ColourInfo.GradientVertical(
|
||||
logoColour.Value,
|
||||
Color4Extensions.Darken(logoColour.Value, 2.5f)
|
||||
);
|
||||
}
|
||||
|
||||
public Container LogoElements { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -276,7 +302,7 @@ namespace osu.Game.Screens.Menu
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures, AudioManager audio)
|
||||
private void load(TextureStore textures, AudioManager audio, OsuConfigManager config)
|
||||
{
|
||||
sampleClick = audio.Samples.Get(@"Menu/osu-logo-select");
|
||||
|
||||
@@ -285,6 +311,8 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
logo.Texture = textures.Get(@"Menu/logo");
|
||||
ripple.Texture = textures.Get(@"Menu/logo");
|
||||
|
||||
logoColour = config.GetBindable<Colour4>(OsuSetting.MenuCookieColor);
|
||||
}
|
||||
|
||||
private int lastBeatIndex;
|
||||
@@ -365,6 +393,7 @@ namespace osu.Game.Screens.Menu
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
UpdateColour();
|
||||
|
||||
const float scale_adjust_cutoff = 0.4f;
|
||||
|
||||
|
||||
166
osu.Game/Screens/Select/PlaySongSelect.cs
Normal file
166
osu.Game/Screens/Select/PlaySongSelect.cs
Normal file
@@ -0,0 +1,166 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.LocalisationExtensions;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Utils;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
public partial class PlaySongSelect : SongSelect
|
||||
{
|
||||
private OsuScreen? playerLoader;
|
||||
|
||||
[Resolved]
|
||||
private INotificationOverlay? notifications { get; set; }
|
||||
|
||||
public override bool AllowExternalScreenChange => true;
|
||||
|
||||
public override MenuItem[] CreateForwardNavigationMenuItemsForBeatmap(Func<BeatmapInfo> getBeatmap) => new MenuItem[]
|
||||
{
|
||||
new OsuMenuItem(ButtonSystemStrings.Play.ToSentence(), MenuItemType.Highlighted, () => FinaliseSelection(getBeatmap())),
|
||||
new OsuMenuItem(ButtonSystemStrings.Edit.ToSentence(), MenuItemType.Standard, () => Edit(getBeatmap()))
|
||||
};
|
||||
|
||||
protected override UserActivity InitialActivity => new UserActivity.ChoosingBeatmap();
|
||||
|
||||
private PlayBeatmapDetailArea playBeatmapDetailArea = null!;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
BeatmapOptions.AddButton(ButtonSystemStrings.Edit.ToSentence(), @"beatmap", FontAwesome.Solid.PencilAlt, colours.Yellow, () => Edit());
|
||||
|
||||
AddInternal(new SongSelectTouchInputDetector());
|
||||
}
|
||||
|
||||
protected void PresentScore(ScoreInfo score) =>
|
||||
FinaliseSelection(score.BeatmapInfo, score.Ruleset, () => this.Push(new SoloResultsScreen(score)));
|
||||
|
||||
protected override BeatmapDetailArea CreateBeatmapDetailArea()
|
||||
{
|
||||
playBeatmapDetailArea = new PlayBeatmapDetailArea
|
||||
{
|
||||
Leaderboard =
|
||||
{
|
||||
ScoreSelected = PresentScore
|
||||
}
|
||||
};
|
||||
|
||||
return playBeatmapDetailArea;
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
{
|
||||
switch (e.Key)
|
||||
{
|
||||
case Key.Enter:
|
||||
case Key.KeypadEnter:
|
||||
// this is a special hard-coded case; we can't rely on OnPressed (of SongSelect) as GlobalActionContainer is
|
||||
// matching with exact modifier consideration (so Ctrl+Enter would be ignored).
|
||||
FinaliseSelection();
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnKeyDown(e);
|
||||
}
|
||||
|
||||
private IReadOnlyList<Mod>? modsAtGameplayStart;
|
||||
|
||||
private ModAutoplay? getAutoplayMod() => Ruleset.Value.CreateInstance().GetAutoplayMod();
|
||||
|
||||
protected override bool OnStart()
|
||||
{
|
||||
if (playerLoader != null) return false;
|
||||
|
||||
modsAtGameplayStart = Mods.Value.Select(m => m.DeepClone()).ToArray();
|
||||
|
||||
// Ctrl+Enter should start map with autoplay enabled.
|
||||
if (GetContainingInputManager()?.CurrentState?.Keyboard.ControlPressed == true)
|
||||
{
|
||||
var autoInstance = getAutoplayMod();
|
||||
|
||||
if (autoInstance == null)
|
||||
{
|
||||
notifications?.Post(new SimpleNotification
|
||||
{
|
||||
Text = NotificationsStrings.NoAutoplayMod
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
var mods = Mods.Value.Append(autoInstance).ToArray();
|
||||
|
||||
if (!ModUtils.CheckCompatibleSet(mods, out var invalid))
|
||||
mods = mods.Except(invalid).Append(autoInstance).ToArray();
|
||||
|
||||
Mods.Value = mods;
|
||||
}
|
||||
|
||||
SampleConfirm?.Play();
|
||||
|
||||
this.Push(playerLoader = new PlayerLoader(createPlayer));
|
||||
return true;
|
||||
|
||||
Player createPlayer()
|
||||
{
|
||||
Player player;
|
||||
|
||||
var replayGeneratingMod = Mods.Value.OfType<ICreateReplayData>().FirstOrDefault();
|
||||
|
||||
if (replayGeneratingMod != null)
|
||||
{
|
||||
player = new ReplayPlayer((beatmap, mods) => replayGeneratingMod.CreateScoreFromReplayData(beatmap, mods));
|
||||
}
|
||||
else
|
||||
{
|
||||
player = new SoloPlayer();
|
||||
}
|
||||
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResuming(ScreenTransitionEvent e)
|
||||
{
|
||||
base.OnResuming(e);
|
||||
revertMods();
|
||||
}
|
||||
|
||||
public override bool OnExiting(ScreenExitEvent e)
|
||||
{
|
||||
if (base.OnExiting(e))
|
||||
return true;
|
||||
|
||||
revertMods();
|
||||
return false;
|
||||
}
|
||||
|
||||
private void revertMods()
|
||||
{
|
||||
if (playerLoader == null) return;
|
||||
|
||||
Mods.Value = modsAtGameplayStart;
|
||||
playerLoader = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user