From 45c2327509911032984c863acb912406c44075fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 29 Apr 2024 13:00:22 +0200 Subject: [PATCH 1/5] Apply adjustments after framework-side `FriendlyGameName` changes --- osu.Desktop/Program.cs | 6 +++++- osu.Game/OsuGameBase.cs | 12 +++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 29b05a402f..d8364fc6e6 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -107,7 +107,11 @@ namespace osu.Desktop } } - using (DesktopGameHost host = Host.GetSuitableDesktopHost(gameName, new HostOptions { IPCPort = !tournamentClient ? OsuGame.IPC_PORT : null })) + using (DesktopGameHost host = Host.GetSuitableDesktopHost(gameName, new HostOptions + { + IPCPort = !tournamentClient ? OsuGame.IPC_PORT : null, + FriendlyGameName = OsuGameBase.GAME_NAME, + })) { if (!host.IsPrimaryInstance) { diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 0122afb239..5533ee8337 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -75,6 +75,12 @@ namespace osu.Game { public static readonly string[] VIDEO_EXTENSIONS = { ".mp4", ".mov", ".avi", ".flv", ".mpg", ".wmv", ".m4v" }; +#if DEBUG + public const string GAME_NAME = "osu! (development)"; +#else + public const string GAME_NAME = "osu!"; +#endif + public const string OSU_PROTOCOL = "osu://"; public const string CLIENT_STREAM_NAME = @"lazer"; @@ -241,11 +247,7 @@ namespace osu.Game public OsuGameBase() { - Name = @"osu!"; - -#if DEBUG - Name += " (development)"; -#endif + Name = GAME_NAME; allowableExceptions = UnhandledExceptionsBeforeCrash; } From 9fc56f1cc7e916a7c41f7073be25b47642860df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 29 Apr 2024 13:07:36 +0200 Subject: [PATCH 2/5] Apply adjustments after migration of android to SDL3 --- osu.Android/AndroidJoystickSettings.cs | 76 -------------------- osu.Android/AndroidMouseSettings.cs | 97 -------------------------- osu.Android/OsuGameAndroid.cs | 22 ------ 3 files changed, 195 deletions(-) delete mode 100644 osu.Android/AndroidJoystickSettings.cs delete mode 100644 osu.Android/AndroidMouseSettings.cs diff --git a/osu.Android/AndroidJoystickSettings.cs b/osu.Android/AndroidJoystickSettings.cs deleted file mode 100644 index bf69461f0d..0000000000 --- a/osu.Android/AndroidJoystickSettings.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Allocation; -using osu.Framework.Android.Input; -using osu.Framework.Bindables; -using osu.Framework.Graphics; -using osu.Framework.Localisation; -using osu.Game.Localisation; -using osu.Game.Overlays.Settings; - -namespace osu.Android -{ - public partial class AndroidJoystickSettings : SettingsSubsection - { - protected override LocalisableString Header => JoystickSettingsStrings.JoystickGamepad; - - private readonly AndroidJoystickHandler joystickHandler; - - private readonly Bindable enabled = new BindableBool(true); - - private SettingsSlider deadzoneSlider = null!; - - private Bindable handlerDeadzone = null!; - - private Bindable localDeadzone = null!; - - public AndroidJoystickSettings(AndroidJoystickHandler joystickHandler) - { - this.joystickHandler = joystickHandler; - } - - [BackgroundDependencyLoader] - private void load() - { - // use local bindable to avoid changing enabled state of game host's bindable. - handlerDeadzone = joystickHandler.DeadzoneThreshold.GetBoundCopy(); - localDeadzone = handlerDeadzone.GetUnboundCopy(); - - Children = new Drawable[] - { - new SettingsCheckbox - { - LabelText = CommonStrings.Enabled, - Current = enabled - }, - deadzoneSlider = new SettingsSlider - { - LabelText = JoystickSettingsStrings.DeadzoneThreshold, - KeyboardStep = 0.01f, - DisplayAsPercentage = true, - Current = localDeadzone, - }, - }; - } - - protected override void LoadComplete() - { - base.LoadComplete(); - - enabled.BindTo(joystickHandler.Enabled); - enabled.BindValueChanged(e => deadzoneSlider.Current.Disabled = !e.NewValue, true); - - handlerDeadzone.BindValueChanged(val => - { - bool disabled = localDeadzone.Disabled; - - localDeadzone.Disabled = false; - localDeadzone.Value = val.NewValue; - localDeadzone.Disabled = disabled; - }, true); - - localDeadzone.BindValueChanged(val => handlerDeadzone.Value = val.NewValue); - } - } -} diff --git a/osu.Android/AndroidMouseSettings.cs b/osu.Android/AndroidMouseSettings.cs deleted file mode 100644 index fd01b11164..0000000000 --- a/osu.Android/AndroidMouseSettings.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using Android.OS; -using osu.Framework.Allocation; -using osu.Framework.Android.Input; -using osu.Framework.Bindables; -using osu.Framework.Graphics; -using osu.Framework.Localisation; -using osu.Game.Configuration; -using osu.Game.Localisation; -using osu.Game.Overlays.Settings; -using osu.Game.Overlays.Settings.Sections.Input; - -namespace osu.Android -{ - public partial class AndroidMouseSettings : SettingsSubsection - { - private readonly AndroidMouseHandler mouseHandler; - - protected override LocalisableString Header => MouseSettingsStrings.Mouse; - - private Bindable handlerSensitivity = null!; - - private Bindable localSensitivity = null!; - - private Bindable relativeMode = null!; - - public AndroidMouseSettings(AndroidMouseHandler mouseHandler) - { - this.mouseHandler = mouseHandler; - } - - [BackgroundDependencyLoader] - private void load(OsuConfigManager osuConfig) - { - // use local bindable to avoid changing enabled state of game host's bindable. - handlerSensitivity = mouseHandler.Sensitivity.GetBoundCopy(); - localSensitivity = handlerSensitivity.GetUnboundCopy(); - - relativeMode = mouseHandler.UseRelativeMode.GetBoundCopy(); - - // High precision/pointer capture is only available on Android 8.0 and up - if (Build.VERSION.SdkInt >= BuildVersionCodes.O) - { - AddRange(new Drawable[] - { - new SettingsCheckbox - { - LabelText = MouseSettingsStrings.HighPrecisionMouse, - TooltipText = MouseSettingsStrings.HighPrecisionMouseTooltip, - Current = relativeMode, - Keywords = new[] { @"raw", @"input", @"relative", @"cursor", @"captured", @"pointer" }, - }, - new MouseSettings.SensitivitySetting - { - LabelText = MouseSettingsStrings.CursorSensitivity, - Current = localSensitivity, - }, - }); - } - - AddRange(new Drawable[] - { - new SettingsCheckbox - { - LabelText = MouseSettingsStrings.DisableMouseWheelVolumeAdjust, - TooltipText = MouseSettingsStrings.DisableMouseWheelVolumeAdjustTooltip, - Current = osuConfig.GetBindable(OsuSetting.MouseDisableWheel), - }, - new SettingsCheckbox - { - LabelText = MouseSettingsStrings.DisableClicksDuringGameplay, - Current = osuConfig.GetBindable(OsuSetting.MouseDisableButtons), - }, - }); - } - - protected override void LoadComplete() - { - base.LoadComplete(); - - relativeMode.BindValueChanged(relative => localSensitivity.Disabled = !relative.NewValue, true); - - handlerSensitivity.BindValueChanged(val => - { - bool disabled = localSensitivity.Disabled; - - localSensitivity.Disabled = false; - localSensitivity.Value = val.NewValue; - localSensitivity.Disabled = disabled; - }, true); - - localSensitivity.BindValueChanged(val => handlerSensitivity.Value = val.NewValue); - } - } -} diff --git a/osu.Android/OsuGameAndroid.cs b/osu.Android/OsuGameAndroid.cs index 52cfb67f42..a235913ef3 100644 --- a/osu.Android/OsuGameAndroid.cs +++ b/osu.Android/OsuGameAndroid.cs @@ -5,13 +5,9 @@ using System; using Android.App; using Microsoft.Maui.Devices; using osu.Framework.Allocation; -using osu.Framework.Android.Input; using osu.Framework.Extensions.ObjectExtensions; -using osu.Framework.Input.Handlers; using osu.Framework.Platform; using osu.Game; -using osu.Game.Overlays.Settings; -using osu.Game.Overlays.Settings.Sections.Input; using osu.Game.Updater; using osu.Game.Utils; @@ -88,24 +84,6 @@ namespace osu.Android protected override BatteryInfo CreateBatteryInfo() => new AndroidBatteryInfo(); - public override SettingsSubsection CreateSettingsSubsectionFor(InputHandler handler) - { - switch (handler) - { - case AndroidMouseHandler mh: - return new AndroidMouseSettings(mh); - - case AndroidJoystickHandler jh: - return new AndroidJoystickSettings(jh); - - case AndroidTouchHandler th: - return new TouchSettings(th); - - default: - return base.CreateSettingsSubsectionFor(handler); - } - } - private class AndroidBatteryInfo : BatteryInfo { public override double? ChargeLevel => Battery.ChargeLevel; From 3b8b56cbcbdb0365a03231aa151efb0050c12ebf Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 9 May 2024 20:18:53 +0900 Subject: [PATCH 3/5] Apply required changes after framework masking updates --- .../Sliders/Components/PathControlPointVisualiser.cs | 2 +- osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 3 +-- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 3 +-- osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs | 2 +- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 3 +-- osu.Game/Rulesets/UI/FrameStabilityContainer.cs | 2 +- .../Edit/Compose/Components/Timeline/TimelineTickDisplay.cs | 3 +-- 7 files changed, 7 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs index 836d348ff4..afc2d407e9 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs @@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components } // Generally all the control points are within the visible area all the time. - public override bool UpdateSubTreeMasking(Drawable source, RectangleF maskingBounds) => true; + public override bool UpdateSubTreeMasking() => true; /// /// Handles correction of invalid path types. diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 4933eb4041..93c3450904 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -8,7 +8,6 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; @@ -37,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.UI // For osu! gameplay, everything is always on screen. // Skipping masking calculations improves performance in intense beatmaps (ie. https://osu.ppy.sh/beatmapsets/150945#osu/372245) - public override bool UpdateSubTreeMasking(Drawable source, RectangleF maskingBounds) => false; + public override bool UpdateSubTreeMasking() => false; public SmokeContainer Smoke { get; } public FollowPointRenderer FollowPoints { get; } diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 0510f08068..bdcb341fb4 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -7,7 +7,6 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Game.Graphics; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Judgements; @@ -345,7 +344,7 @@ namespace osu.Game.Rulesets.Taiko.UI { public void Add(Drawable proxy) => AddInternal(proxy); - public override bool UpdateSubTreeMasking(Drawable source, RectangleF maskingBounds) + public override bool UpdateSubTreeMasking() { // DrawableHitObject disables masking. // Hitobject content is proxied and unproxied based on hit status and the IsMaskedAway value could get stuck because of this. diff --git a/osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs b/osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs index 3a2db4fc71..111dede815 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs @@ -22,7 +22,7 @@ namespace osu.Game.Tournament.Screens.Ladder protected override bool ComputeIsMaskedAway(RectangleF maskingBounds) => false; - public override bool UpdateSubTreeMasking(Drawable source, RectangleF maskingBounds) => false; + public override bool UpdateSubTreeMasking() => false; protected override void OnDrag(DragEvent e) { diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index de05219212..3ce6cc3cef 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -15,7 +15,6 @@ using osu.Framework.Extensions.ListExtensions; using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Lists; using osu.Framework.Threading; using osu.Framework.Utils; @@ -632,7 +631,7 @@ namespace osu.Game.Rulesets.Objects.Drawables #endregion - public override bool UpdateSubTreeMasking(Drawable source, RectangleF maskingBounds) => false; + public override bool UpdateSubTreeMasking() => false; protected override void UpdateAfterChildren() { diff --git a/osu.Game/Rulesets/UI/FrameStabilityContainer.cs b/osu.Game/Rulesets/UI/FrameStabilityContainer.cs index b49924762e..c4feb249f4 100644 --- a/osu.Game/Rulesets/UI/FrameStabilityContainer.cs +++ b/osu.Game/Rulesets/UI/FrameStabilityContainer.cs @@ -119,7 +119,7 @@ namespace osu.Game.Rulesets.UI break; base.UpdateSubTree(); - UpdateSubTreeMasking(this, ScreenSpaceDrawQuad.AABBFloat); + UpdateSubTreeMasking(); } while (state == PlaybackState.RequiresCatchUp && stopwatch.ElapsedMilliseconds < max_catchup_milliseconds); return true; diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineTickDisplay.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineTickDisplay.cs index c3adb43032..e16c8519e5 100644 --- a/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineTickDisplay.cs +++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineTickDisplay.cs @@ -7,7 +7,6 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Caching; using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Logging; using osu.Game.Beatmaps; using osu.Game.Graphics; @@ -20,7 +19,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline public partial class TimelineTickDisplay : TimelinePart { // With current implementation every tick in the sub-tree should be visible, no need to check whether they are masked away. - public override bool UpdateSubTreeMasking(Drawable source, RectangleF maskingBounds) => false; + public override bool UpdateSubTreeMasking() => false; [Resolved] private EditorBeatmap beatmap { get; set; } = null!; From c4d6318c0d0026bb5b581fb198aded74376de775 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 May 2024 22:12:09 +0800 Subject: [PATCH 4/5] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index 97dfe5d9f7..e20ac2e0b7 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -10,7 +10,7 @@ true - + diff --git a/osu.iOS.props b/osu.iOS.props index 66347acdf0..103ef50e0c 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -23,6 +23,6 @@ iossimulator-x64 - + From de05998421b2c04d669bf08897e6fd82e49d1815 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 May 2024 22:17:00 +0800 Subject: [PATCH 5/5] Avoid weird codestyle rules --- osu.Desktop/Program.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index d8364fc6e6..23e56cdce9 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -107,11 +107,13 @@ namespace osu.Desktop } } - using (DesktopGameHost host = Host.GetSuitableDesktopHost(gameName, new HostOptions - { - IPCPort = !tournamentClient ? OsuGame.IPC_PORT : null, - FriendlyGameName = OsuGameBase.GAME_NAME, - })) + var hostOptions = new HostOptions + { + IPCPort = !tournamentClient ? OsuGame.IPC_PORT : null, + FriendlyGameName = OsuGameBase.GAME_NAME, + }; + + using (DesktopGameHost host = Host.GetSuitableDesktopHost(gameName, hostOptions)) { if (!host.IsPrimaryInstance) {