From 97de73b99c47b2c0787ece0efa8431272df49c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 16 May 2024 08:21:52 +0200 Subject: [PATCH 1/6] Do not change mania column width on mobile platforms - Closes https://github.com/ppy/osu/issues/25852 - Reverts https://github.com/ppy/osu/pull/25336 / https://github.com/ppy/osu/pull/25777 With the columns not being directly touchable anymore after https://github.com/ppy/osu/pull/28173 I see very little point to this continuing to exist. --- osu.Game.Rulesets.Mania/UI/ColumnFlow.cs | 36 ------------------------ 1 file changed, 36 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs index 1593e8e76f..f444448797 100644 --- a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs +++ b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs @@ -3,15 +3,12 @@ #nullable disable -using System; -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Skinning; using osu.Game.Skinning; -using osuTK; namespace osu.Game.Rulesets.Mania.UI { @@ -62,12 +59,6 @@ namespace osu.Game.Rulesets.Mania.UI onSkinChanged(); } - protected override void LoadComplete() - { - base.LoadComplete(); - updateMobileSizing(); - } - private void onSkinChanged() { for (int i = 0; i < stageDefinition.Columns; i++) @@ -92,8 +83,6 @@ namespace osu.Game.Rulesets.Mania.UI columns[i].Width = width.Value; } - - updateMobileSizing(); } /// @@ -106,31 +95,6 @@ namespace osu.Game.Rulesets.Mania.UI Content[column] = columns[column].Child = content; } - private void updateMobileSizing() - { - if (!IsLoaded || !RuntimeInfo.IsMobile) - return; - - // GridContainer+CellContainer containing this stage (gets split up for dual stages). - Vector2? containingCell = this.FindClosestParent()?.Parent?.DrawSize; - - // Will be null in tests. - if (containingCell == null) - return; - - float aspectRatio = containingCell.Value.X / containingCell.Value.Y; - - // 2.83 is a mostly arbitrary scale-up (170 / 60, based on original implementation for argon) - float mobileAdjust = 2.83f * Math.Min(1, 7f / stageDefinition.Columns); - // 1.92 is a "reference" mobile screen aspect ratio for phones. - // We should scale it back for cases like tablets which aren't so extreme. - mobileAdjust *= aspectRatio / 1.92f; - - // Best effort until we have better mobile support. - for (int i = 0; i < stageDefinition.Columns; i++) - columns[i].Width *= mobileAdjust; - } - protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); From 5dd64a7c86bae98bc991386ba92faff97d6a205d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 16 May 2024 14:49:56 +0200 Subject: [PATCH 2/6] Fix duplicated localisation key in `DeleteConfiormationContentStrings` Noticed via `osu-resources` build warnings. There are also a few other warnings about https://github.com/ppy/osu/pull/27472. Seems something in crowdin innards may still be exporting those strings even though they have been fixed already. Not sure how to address that. Probably need these to be detected via static analysis at this point since it's happened again. Might look into the feasibility of making that happen. --- osu.Game/Localisation/DeleteConfirmationContentStrings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Localisation/DeleteConfirmationContentStrings.cs b/osu.Game/Localisation/DeleteConfirmationContentStrings.cs index 563fbf5654..d781fadbce 100644 --- a/osu.Game/Localisation/DeleteConfirmationContentStrings.cs +++ b/osu.Game/Localisation/DeleteConfirmationContentStrings.cs @@ -32,7 +32,7 @@ namespace osu.Game.Localisation /// /// "Are you sure you want to delete all scores? This cannot be undone!" /// - public static LocalisableString Scores => new TranslatableString(getKey(@"collections"), @"Are you sure you want to delete all scores? This cannot be undone!"); + public static LocalisableString Scores => new TranslatableString(getKey(@"scores"), @"Are you sure you want to delete all scores? This cannot be undone!"); /// /// "Are you sure you want to delete all mod presets?" From f2f03f08cb0dd79de4587a2ec63da97f3cb375da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 16 May 2024 17:36:19 +0200 Subject: [PATCH 3/6] Fix xmldoc mismatches in localisation files This is enforced by the localisation analyser after https://github.com/ppy/osu-localisation-analyser/pull/62, but it appears the analyser was never actually bumped game-side after that change and I'm not super sure why, as there does not appear to be a reason to _not_ do that. So this commit does it. --- .../FirstRunOverlayImportFromStableScreenStrings.cs | 2 +- osu.Game/Localisation/NotificationsStrings.cs | 2 +- osu.Game/osu.Game.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs b/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs index 04fecab3df..521a77fe20 100644 --- a/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs +++ b/osu.Game/Localisation/FirstRunOverlayImportFromStableScreenStrings.cs @@ -47,7 +47,7 @@ namespace osu.Game.Localisation public static LocalisableString Calculating => new TranslatableString(getKey(@"calculating"), @"calculating..."); /// - /// "{0} items" + /// "{0} item(s)" /// public static LocalisableString Items(int arg0) => new TranslatableString(getKey(@"items"), @"{0} item(s)", arg0); diff --git a/osu.Game/Localisation/NotificationsStrings.cs b/osu.Game/Localisation/NotificationsStrings.cs index 3188ca5533..698fe230b2 100644 --- a/osu.Game/Localisation/NotificationsStrings.cs +++ b/osu.Game/Localisation/NotificationsStrings.cs @@ -114,7 +114,7 @@ Please try changing your audio device to a working setting."); public static LocalisableString MismatchingBeatmapForReplay => new TranslatableString(getKey(@"mismatching_beatmap_for_replay"), @"Your local copy of the beatmap for this replay appears to be different than expected. You may need to update or re-download it."); /// - /// "You are now running osu! {version}. + /// "You are now running osu! {0}. /// Click to see what's new!" /// public static LocalisableString GameVersionAfterUpdate(string version) => new TranslatableString(getKey(@"game_version_after_update"), @"You are now running osu! {0}. diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 5452a648d1..7588b2b3c8 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -30,7 +30,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From a3dfd99f7d5895fb0bf5f0c8398245a42b6d2848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 16 May 2024 18:23:19 +0200 Subject: [PATCH 4/6] Fix discord arbitrarily refusing to work on "too short" strings Closes https://github.com/ppy/osu/issues/28192. --- osu.Desktop/DiscordRichPresence.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/osu.Desktop/DiscordRichPresence.cs b/osu.Desktop/DiscordRichPresence.cs index 74ebd38f2c..3e0a9099cb 100644 --- a/osu.Desktop/DiscordRichPresence.cs +++ b/osu.Desktop/DiscordRichPresence.cs @@ -164,8 +164,8 @@ namespace osu.Desktop // user activity if (activity.Value != null) { - presence.State = truncate(activity.Value.GetStatus(hideIdentifiableInformation)); - presence.Details = truncate(activity.Value.GetDetails(hideIdentifiableInformation) ?? string.Empty); + presence.State = clampLength(activity.Value.GetStatus(hideIdentifiableInformation)); + presence.Details = clampLength(activity.Value.GetDetails(hideIdentifiableInformation) ?? string.Empty); if (getBeatmapID(activity.Value) is int beatmapId && beatmapId > 0) { @@ -271,8 +271,15 @@ namespace osu.Desktop private static readonly int ellipsis_length = Encoding.UTF8.GetByteCount(new[] { '…' }); - private static string truncate(string str) + private static string clampLength(string str) { + // For whatever reason, discord decides that strings shorter than 2 characters cannot possibly be valid input, because... reasons? + // And yes, that is two *characters*, or *codepoints*, not *bytes* as further down below (as determined by empirical testing). + // That seems very questionable, and isn't even documented anywhere. So to *make it* accept such valid input, + // just tack on enough of U+200B ZERO WIDTH SPACEs at the end. + if (str.Length < 2) + return str.PadRight(2, '\u200B'); + if (Encoding.UTF8.GetByteCount(str) <= 128) return str; From 2f9d74286dd5401450f071659323415c3329d3b7 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 17 May 2024 11:15:17 +0900 Subject: [PATCH 5/6] Bump once more --- .config/dotnet-tools.json | 2 +- osu.Game/osu.Game.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 99906f0895..ace7db82f8 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "ppy.localisationanalyser.tools": { - "version": "2023.1117.0", + "version": "2024.517.0", "commands": [ "localisation" ] diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7588b2b3c8..f91995feff 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -30,7 +30,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 2027d481eecdd433f91f23a498ca7c7ee81dfa6c Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sat, 18 May 2024 06:38:25 +0300 Subject: [PATCH 6/6] Remove `TreatWarningsAsErrors` flags from local builds for developer convenience --- Directory.Build.props | 1 - 1 file changed, 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 2d289d0f22..5ba12b845b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,6 @@ 12.0 - true enable