From 83b8d8ad8cb8cb00cf58ba148fb427b0bde86e94 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sun, 1 Jan 2023 16:48:47 -0800 Subject: [PATCH 01/43] Add failing replay player mouse middle pause test --- .../Visual/Gameplay/TestSceneReplayPlayer.cs | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayPlayer.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayPlayer.cs index e0a6a60ff2..601fe445f0 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayPlayer.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayPlayer.cs @@ -4,6 +4,7 @@ #nullable disable using NUnit.Framework; +using osu.Framework.Screens; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu; using osuTK.Input; @@ -23,14 +24,29 @@ namespace osu.Game.Tests.Visual.Gameplay AddUntilStep("player loaded", () => Player.IsLoaded); } - [Test] - public void TestPause() + [TestCase("space")] + [TestCase("mouse middle")] + public void TestPause(string action) { double? lastTime = null; AddUntilStep("wait for first hit", () => Player.ScoreProcessor.TotalScore.Value > 0); - AddStep("Pause playback", () => InputManager.Key(Key.Space)); + AddStep("Pause playback", () => + { + switch (action) + { + case "space": + InputManager.Key(Key.Space); + break; + + case "mouse middle": + InputManager.Click(MouseButton.Middle); + break; + } + }); + + AddAssert("player not exited", () => Player.IsCurrentScreen()); AddUntilStep("Time stopped progressing", () => { From d79ee29f29c64a1922bf32c2f1de34be6b5e8e68 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sun, 1 Jan 2023 18:00:39 -0800 Subject: [PATCH 02/43] Make replays pause with middle mouse button instead of exiting --- .../Screens/Play/HUD/HoldForMenuButton.cs | 19 ++++++++++++++++++- osu.Game/Screens/Play/Player.cs | 3 ++- osu.Game/Screens/Play/ReplayPlayer.cs | 1 + 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/HoldForMenuButton.cs b/osu.Game/Screens/Play/HUD/HoldForMenuButton.cs index f902e0903d..0921a9f18a 100644 --- a/osu.Game/Screens/Play/HUD/HoldForMenuButton.cs +++ b/osu.Game/Screens/Play/HUD/HoldForMenuButton.cs @@ -31,6 +31,8 @@ namespace osu.Game.Screens.Play.HUD public readonly Bindable IsPaused = new Bindable(); + public readonly Bindable ReplayLoaded = new Bindable(); + private HoldButton button; public Action Action { get; set; } @@ -60,6 +62,7 @@ namespace osu.Game.Screens.Play.HUD HoverGained = () => text.FadeIn(500, Easing.OutQuint), HoverLost = () => text.FadeOut(500, Easing.OutQuint), IsPaused = { BindTarget = IsPaused }, + ReplayLoaded = { BindTarget = ReplayLoaded }, Action = () => Action(), } }; @@ -110,6 +113,8 @@ namespace osu.Game.Screens.Play.HUD public readonly Bindable IsPaused = new Bindable(); + public readonly Bindable ReplayLoaded = new Bindable(); + protected override bool AllowMultipleFires => true; public Action HoverGained; @@ -251,7 +256,14 @@ namespace osu.Game.Screens.Play.HUD switch (e.Action) { case GlobalAction.Back: - case GlobalAction.PauseGameplay: // in the future this behaviour will differ for replays etc. + if (!pendingAnimation) + BeginConfirm(); + return true; + + case GlobalAction.PauseGameplay: + // handled by replay player + if (ReplayLoaded.Value) return false; + if (!pendingAnimation) BeginConfirm(); return true; @@ -265,7 +277,12 @@ namespace osu.Game.Screens.Play.HUD switch (e.Action) { case GlobalAction.Back: + AbortConfirm(); + break; + case GlobalAction.PauseGameplay: + if (ReplayLoaded.Value) return; + AbortConfirm(); break; } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 05133fba35..7fe81987c8 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -433,7 +433,8 @@ namespace osu.Game.Screens.Play HoldToQuit = { Action = () => PerformExit(true), - IsPaused = { BindTarget = GameplayClockContainer.IsPaused } + IsPaused = { BindTarget = GameplayClockContainer.IsPaused }, + ReplayLoaded = { BindTarget = DrawableRuleset.HasReplayLoaded }, }, KeyCounter = { diff --git a/osu.Game/Screens/Play/ReplayPlayer.cs b/osu.Game/Screens/Play/ReplayPlayer.cs index c5ef6b1585..77ee7bc113 100644 --- a/osu.Game/Screens/Play/ReplayPlayer.cs +++ b/osu.Game/Screens/Play/ReplayPlayer.cs @@ -81,6 +81,7 @@ namespace osu.Game.Screens.Play return true; case GlobalAction.TogglePauseReplay: + case GlobalAction.PauseGameplay: if (GameplayClockContainer.IsPaused.Value) GameplayClockContainer.Start(); else From 93a57b6871a98d94f898cfa6afbf5504ab9932c9 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sat, 7 Jan 2023 11:28:09 -0800 Subject: [PATCH 03/43] Separate pausing test instead of using test cases --- .../Visual/Gameplay/TestSceneReplayPlayer.cs | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayPlayer.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayPlayer.cs index 601fe445f0..334d01f915 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayPlayer.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayPlayer.cs @@ -24,28 +24,40 @@ namespace osu.Game.Tests.Visual.Gameplay AddUntilStep("player loaded", () => Player.IsLoaded); } - [TestCase("space")] - [TestCase("mouse middle")] - public void TestPause(string action) + [Test] + public void TestPauseViaSpace() { double? lastTime = null; AddUntilStep("wait for first hit", () => Player.ScoreProcessor.TotalScore.Value > 0); - AddStep("Pause playback", () => - { - switch (action) - { - case "space": - InputManager.Key(Key.Space); - break; + AddStep("Pause playback with space", () => InputManager.Key(Key.Space)); - case "mouse middle": - InputManager.Click(MouseButton.Middle); - break; - } + AddAssert("player not exited", () => Player.IsCurrentScreen()); + + AddUntilStep("Time stopped progressing", () => + { + double current = Player.GameplayClockContainer.CurrentTime; + bool changed = lastTime != current; + lastTime = current; + + return !changed; }); + AddWaitStep("wait some", 10); + + AddAssert("Time still stopped", () => lastTime == Player.GameplayClockContainer.CurrentTime); + } + + [Test] + public void TestPauseViaMiddleMouse() + { + double? lastTime = null; + + AddUntilStep("wait for first hit", () => Player.ScoreProcessor.TotalScore.Value > 0); + + AddStep("Pause playback with middle mouse", () => InputManager.Click(MouseButton.Middle)); + AddAssert("player not exited", () => Player.IsCurrentScreen()); AddUntilStep("Time stopped progressing", () => From 45bae5d42470b12cb4900ccb24f1cf79ad05204f Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Thu, 5 Jan 2023 13:05:20 -0800 Subject: [PATCH 04/43] Add middle mouse to toggle pause replay instead of using pause gameplay keybinds --- osu.Game/Input/Bindings/GlobalActionContainer.cs | 1 + osu.Game/Screens/Play/ReplayPlayer.cs | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Input/Bindings/GlobalActionContainer.cs b/osu.Game/Input/Bindings/GlobalActionContainer.cs index 07cef50dec..3826139716 100644 --- a/osu.Game/Input/Bindings/GlobalActionContainer.cs +++ b/osu.Game/Input/Bindings/GlobalActionContainer.cs @@ -113,6 +113,7 @@ namespace osu.Game.Input.Bindings new KeyBinding(new[] { InputKey.Shift, InputKey.Tab }, GlobalAction.ToggleInGameInterface), new KeyBinding(InputKey.MouseMiddle, GlobalAction.PauseGameplay), new KeyBinding(InputKey.Space, GlobalAction.TogglePauseReplay), + new KeyBinding(InputKey.MouseMiddle, GlobalAction.TogglePauseReplay), new KeyBinding(InputKey.Left, GlobalAction.SeekReplayBackward), new KeyBinding(InputKey.Right, GlobalAction.SeekReplayForward), new KeyBinding(InputKey.Control, GlobalAction.HoldForHUD), diff --git a/osu.Game/Screens/Play/ReplayPlayer.cs b/osu.Game/Screens/Play/ReplayPlayer.cs index 77ee7bc113..c5ef6b1585 100644 --- a/osu.Game/Screens/Play/ReplayPlayer.cs +++ b/osu.Game/Screens/Play/ReplayPlayer.cs @@ -81,7 +81,6 @@ namespace osu.Game.Screens.Play return true; case GlobalAction.TogglePauseReplay: - case GlobalAction.PauseGameplay: if (GameplayClockContainer.IsPaused.Value) GameplayClockContainer.Start(); else From e5eab72aeb493dd870c243c1d7fec184bc2f97e7 Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Thu, 19 Jan 2023 00:37:36 +0900 Subject: [PATCH 05/43] add check for preview time setting --- osu.Game/Rulesets/Edit/BeatmapVerifier.cs | 3 + .../Rulesets/Edit/Checks/CheckPreviewTime.cs | 64 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs diff --git a/osu.Game/Rulesets/Edit/BeatmapVerifier.cs b/osu.Game/Rulesets/Edit/BeatmapVerifier.cs index a89a0e76a9..5f5aba26bb 100644 --- a/osu.Game/Rulesets/Edit/BeatmapVerifier.cs +++ b/osu.Game/Rulesets/Edit/BeatmapVerifier.cs @@ -36,6 +36,9 @@ namespace osu.Game.Rulesets.Edit new CheckUnsnappedObjects(), new CheckConcurrentObjects(), new CheckZeroLengthObjects(), + + // Timing + new CheckPreviewTime(), }; public IEnumerable Run(BeatmapVerifierContext context) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs new file mode 100644 index 0000000000..4fad8c0af6 --- /dev/null +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -0,0 +1,64 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Edit.Checks.Components; + +namespace osu.Game.Rulesets.Edit.Checks +{ + public class CheckPreviewTime : ICheck + { + public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Timing, "Check Preview Time Consistency"); + + public IEnumerable PossibleTemplates => new IssueTemplate[] + { + new IssueTemplatePreviewTimeConflict(this), + new IssueTemplateHasNoPreviewTime(this), + }; + + public IEnumerable Run(BeatmapVerifierContext context) + { + var diffList = context.Beatmap.BeatmapInfo.BeatmapSet?.Beatmaps ?? new List(); + int previewTime = context.Beatmap.BeatmapInfo.Metadata.PreviewTime; + + if (previewTime == -1) + { + yield return new IssueTemplateHasNoPreviewTime(this).Create(); + } + + foreach (var diff in diffList) + { + if (diff.Equals(context.Beatmap.BeatmapInfo)) + { + continue; + } + + if (diff.Metadata.PreviewTime != previewTime) + { + yield return new IssueTemplatePreviewTimeConflict(this).Create(diff.DifficultyName); + } + } + } + + public class IssueTemplatePreviewTimeConflict : IssueTemplate + { + public IssueTemplatePreviewTimeConflict(ICheck check) + : base(check, IssueType.Warning, "Audio preview time conflicts with {0} diff") + { + } + + public Issue Create(string diffName) => new Issue(this, diffName); + } + + public class IssueTemplateHasNoPreviewTime : IssueTemplate + { + public IssueTemplateHasNoPreviewTime(ICheck check) + : base(check, IssueType.Warning, "A preview point for this map is not set. Consider settings one from the Timing menu") + { + } + + public Issue Create() => new Issue(this); + } + } +} From 997a1a8b02d0b99ba77a4dbe629ea5f2d8f46a9f Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Thu, 19 Jan 2023 01:00:02 +0900 Subject: [PATCH 06/43] add test for CheckPreviewTime --- .../Editing/Checks/CheckPreviewTimeTest.cs | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs diff --git a/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs new file mode 100644 index 0000000000..59ff8d4923 --- /dev/null +++ b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs @@ -0,0 +1,108 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Edit; +using osu.Game.Rulesets.Edit.Checks; +using osu.Game.Rulesets.Objects; +using osu.Game.Tests.Beatmaps; + +namespace osu.Game.Tests.Editing.Checks +{ + public class CheckPreviewTimeTest + { + private CheckPreviewTime check = null!; + + private IBeatmap beatmap = null!; + + [SetUp] + public void Setup() + { + check = new CheckPreviewTime(); + beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + Metadata = new BeatmapMetadata { PreviewTime = -1 }, + BeatmapSet = new BeatmapSetInfo(new List + { + new BeatmapInfo + { + DifficultyName = "Test1", + Metadata = new BeatmapMetadata { PreviewTime = 5 }, + }, + new BeatmapInfo + { + DifficultyName = "Test2", + Metadata = new BeatmapMetadata { PreviewTime = 10 }, + }, + }) + } + }; + } + + [Test] + public void TestPreviewTimeNotSet() + { + setNoPreviewTimeBeatmap(); + var content = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap)); + + var issues = check.Run(content).ToList(); + + Assert.That(issues, Has.Count.EqualTo(1)); + Assert.That(issues.Single().Template is CheckPreviewTime.IssueTemplateHasNoPreviewTime); + } + + [Test] + public void TestPreviewTimeconflict() + { + setPreviewTimeConflictBeatmap(); + + var content = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap)); + + var issues = check.Run(content).ToList(); + + Assert.That(issues, Has.Count.EqualTo(1)); + Assert.That(issues.Single().Template is CheckPreviewTime.IssueTemplatePreviewTimeConflict); + Assert.That(issues.Single().Arguments.Single().ToString() == "Test1"); + } + + private void setNoPreviewTimeBeatmap() + { + beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + Metadata = new BeatmapMetadata { PreviewTime = -1 }, + } + }; + } + + private void setPreviewTimeConflictBeatmap() + { + beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + Metadata = new BeatmapMetadata { PreviewTime = 10 }, + BeatmapSet = new BeatmapSetInfo(new List + { + new BeatmapInfo + { + DifficultyName = "Test1", + Metadata = new BeatmapMetadata { PreviewTime = 5 }, + }, + new BeatmapInfo + { + DifficultyName = "Test2", + Metadata = new BeatmapMetadata { PreviewTime = 10 }, + }, + }) + } + }; + } + } +} From f8537c1cbe98bc38f0423e8eabdc2332a21d22ab Mon Sep 17 00:00:00 2001 From: Susko3 Date: Sun, 22 Jan 2023 22:19:04 +0100 Subject: [PATCH 07/43] Delegate file deletion to `ImportTask` to allow overriding it --- osu.Game/Database/ImportTask.cs | 9 +++++++++ osu.Game/Database/RealmArchiveModelImporter.cs | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/osu.Game/Database/ImportTask.cs b/osu.Game/Database/ImportTask.cs index e7f599d85f..def20bc1fb 100644 --- a/osu.Game/Database/ImportTask.cs +++ b/osu.Game/Database/ImportTask.cs @@ -51,6 +51,15 @@ namespace osu.Game.Database : getReaderFrom(Path); } + /// + /// Deletes the file that is encapsulated by this . + /// + public virtual void DeleteFile() + { + if (File.Exists(Path)) + File.Delete(Path); + } + /// /// Creates an from a stream. /// diff --git a/osu.Game/Database/RealmArchiveModelImporter.cs b/osu.Game/Database/RealmArchiveModelImporter.cs index db8861c281..9d06c14b4b 100644 --- a/osu.Game/Database/RealmArchiveModelImporter.cs +++ b/osu.Game/Database/RealmArchiveModelImporter.cs @@ -201,8 +201,8 @@ namespace osu.Game.Database // TODO: Add a check to prevent files from storage to be deleted. try { - if (import != null && File.Exists(task.Path) && ShouldDeleteArchive(task.Path)) - File.Delete(task.Path); + if (import != null && ShouldDeleteArchive(task.Path)) + task.DeleteFile(); } catch (Exception e) { From de21864bd133e1d63c534b4c9406d5948e7938da Mon Sep 17 00:00:00 2001 From: Susko3 Date: Sun, 22 Jan 2023 22:47:16 +0100 Subject: [PATCH 08/43] Move logic to `AndroidImportTask` and add delete mechanism --- osu.Android/AndroidImportTask.cs | 57 ++++++++++++++++++++++++++++++++ osu.Android/OsuGameActivity.cs | 28 ++++------------ 2 files changed, 63 insertions(+), 22 deletions(-) create mode 100644 osu.Android/AndroidImportTask.cs diff --git a/osu.Android/AndroidImportTask.cs b/osu.Android/AndroidImportTask.cs new file mode 100644 index 0000000000..ec946f71f3 --- /dev/null +++ b/osu.Android/AndroidImportTask.cs @@ -0,0 +1,57 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.IO; +using System.Threading.Tasks; +using Android.Content; +using Android.Net; +using Android.Provider; +using osu.Game.Database; + +namespace osu.Android +{ + public class AndroidImportTask : ImportTask + { + private readonly ContentResolver contentResolver; + + private readonly Uri uri; + + private AndroidImportTask(Stream stream, string filename, ContentResolver contentResolver, Uri uri) + : base(stream, filename) + { + this.contentResolver = contentResolver; + this.uri = uri; + } + + public override void DeleteFile() + { + contentResolver.Delete(uri, null, null); + } + + public static async Task Create(ContentResolver contentResolver, Uri uri) + { + // there are more performant overloads of this method, but this one is the most backwards-compatible + // (dates back to API 1). + + var cursor = contentResolver.Query(uri, null, null, null, null); + + if (cursor == null) + return null; + + cursor.MoveToFirst(); + + int filenameColumn = cursor.GetColumnIndex(IOpenableColumns.DisplayName); + string filename = cursor.GetString(filenameColumn); + + // SharpCompress requires archive streams to be seekable, which the stream opened by + // OpenInputStream() seems to not necessarily be. + // copy to an arbitrary-access memory stream to be able to proceed with the import. + var copy = new MemoryStream(); + + using (var stream = contentResolver.OpenInputStream(uri)) + await stream.CopyToAsync(copy).ConfigureAwait(false); + + return new AndroidImportTask(copy, filename, contentResolver, uri); + } + } +} diff --git a/osu.Android/OsuGameActivity.cs b/osu.Android/OsuGameActivity.cs index ca3d628447..f0a6e4733c 100644 --- a/osu.Android/OsuGameActivity.cs +++ b/osu.Android/OsuGameActivity.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Reflection; using System.Threading.Tasks; @@ -14,7 +13,6 @@ using Android.Content; using Android.Content.PM; using Android.Graphics; using Android.OS; -using Android.Provider; using Android.Views; using osu.Framework.Android; using osu.Game.Database; @@ -131,28 +129,14 @@ namespace osu.Android await Task.WhenAll(uris.Select(async uri => { - // there are more performant overloads of this method, but this one is the most backwards-compatible - // (dates back to API 1). - var cursor = ContentResolver?.Query(uri, null, null, null, null); + var task = await AndroidImportTask.Create(ContentResolver!, uri).ConfigureAwait(false); - if (cursor == null) - return; - - cursor.MoveToFirst(); - - int filenameColumn = cursor.GetColumnIndex(IOpenableColumns.DisplayName); - string filename = cursor.GetString(filenameColumn); - - // SharpCompress requires archive streams to be seekable, which the stream opened by - // OpenInputStream() seems to not necessarily be. - // copy to an arbitrary-access memory stream to be able to proceed with the import. - var copy = new MemoryStream(); - using (var stream = ContentResolver.OpenInputStream(uri)) - await stream.CopyToAsync(copy).ConfigureAwait(false); - - lock (tasks) + if (task != null) { - tasks.Add(new ImportTask(copy, filename)); + lock (tasks) + { + tasks.Add(task); + } } })).ConfigureAwait(false); From e16105d0593411dbb84e9b0cc5949fbb8d9e1737 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Sun, 22 Jan 2023 23:11:50 +0100 Subject: [PATCH 09/43] Fix NRT and add more safety --- osu.Android/AndroidImportTask.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Android/AndroidImportTask.cs b/osu.Android/AndroidImportTask.cs index ec946f71f3..7273a6da5c 100644 --- a/osu.Android/AndroidImportTask.cs +++ b/osu.Android/AndroidImportTask.cs @@ -38,10 +38,11 @@ namespace osu.Android if (cursor == null) return null; - cursor.MoveToFirst(); + if (!cursor.MoveToFirst()) + return null; int filenameColumn = cursor.GetColumnIndex(IOpenableColumns.DisplayName); - string filename = cursor.GetString(filenameColumn); + string filename = cursor.GetString(filenameColumn) ?? uri.Path ?? string.Empty; // SharpCompress requires archive streams to be seekable, which the stream opened by // OpenInputStream() seems to not necessarily be. @@ -49,7 +50,12 @@ namespace osu.Android var copy = new MemoryStream(); using (var stream = contentResolver.OpenInputStream(uri)) + { + if (stream == null) + return null; + await stream.CopyToAsync(copy).ConfigureAwait(false); + } return new AndroidImportTask(copy, filename, contentResolver, uri); } From 5afb733fb2e8dbf4350880699350be590bd726f6 Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Mon, 23 Jan 2023 15:26:28 +0900 Subject: [PATCH 10/43] change IssueTemplatePreviewTimeConflict's text --- osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs | 2 +- osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs index 59ff8d4923..2b7d37dc81 100644 --- a/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs +++ b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs @@ -67,7 +67,7 @@ namespace osu.Game.Tests.Editing.Checks Assert.That(issues, Has.Count.EqualTo(1)); Assert.That(issues.Single().Template is CheckPreviewTime.IssueTemplatePreviewTimeConflict); - Assert.That(issues.Single().Arguments.Single().ToString() == "Test1"); + Assert.That(issues.Single().Arguments.FirstOrDefault()?.ToString() == "Test1"); } private void setNoPreviewTimeBeatmap() diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs index 4fad8c0af6..05e49eba84 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Edit.Checks if (diff.Metadata.PreviewTime != previewTime) { - yield return new IssueTemplatePreviewTimeConflict(this).Create(diff.DifficultyName); + yield return new IssueTemplatePreviewTimeConflict(this).Create(diff.DifficultyName, previewTime, diff.Metadata.PreviewTime); } } } @@ -44,11 +44,15 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplatePreviewTimeConflict : IssueTemplate { public IssueTemplatePreviewTimeConflict(ICheck check) - : base(check, IssueType.Warning, "Audio preview time conflicts with {0} diff") + : base(check, IssueType.Warning, "Audio preview time {1} doesn't match \"{0}\"'s preview time {2}") { } - public Issue Create(string diffName) => new Issue(this, diffName); + public Issue Create(string diffName, int originalTime, int conflictTime) => + // preview time should show (not set) when it is not set. + new Issue(this, diffName, + originalTime != -1 ? $"({originalTime:N0})" : "(not set)", + conflictTime != -1 ? $"({conflictTime:N0})" : "(not set)"); } public class IssueTemplateHasNoPreviewTime : IssueTemplate From a4a94cb96e418cbd6adaffd0e7be75c08636616c Mon Sep 17 00:00:00 2001 From: EXtremeExploit Date: Wed, 25 Jan 2023 14:34:00 -0300 Subject: [PATCH 11/43] Add movement to misses in osu ruleset --- osu.Game/Skinning/LegacyJudgementPieceNew.cs | 5 ++--- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 2430e511c4..7fece3e896 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -104,9 +104,8 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); - //todo: this only applies to osu! ruleset apparently. - this.MoveTo(new Vector2(0, -2)); - this.MoveToOffset(new Vector2(0, 20), fade_out_delay + fade_out_length, Easing.In); + this.MoveTo(new Vector2(0, -5)); + this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); float rotation = RNG.NextSingle(-8.6f, 8.6f); diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 796080f4f5..291b28991d 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -10,6 +10,8 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Utils; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; +using osuTK; + namespace osu.Game.Skinning { @@ -55,6 +57,9 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); + this.MoveTo(new Vector2(0, -5)); + this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); + float rotation = RNG.NextSingle(-8.6f, 8.6f); this.RotateTo(0); From fc968d1d89887474093ef017c2346777252b4d6c Mon Sep 17 00:00:00 2001 From: EXtremeExploit Date: Wed, 25 Jan 2023 14:38:02 -0300 Subject: [PATCH 12/43] del extra newline --- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 291b28991d..749edf80db 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -12,7 +12,6 @@ using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; - namespace osu.Game.Skinning { public partial class LegacyJudgementPieceOld : CompositeDrawable, IAnimatableJudgement From a6fc3ce477e400ef30298ef00cd21330d0849b6c Mon Sep 17 00:00:00 2001 From: EXtremeExploit Date: Wed, 25 Jan 2023 20:38:55 -0300 Subject: [PATCH 13/43] bring comment back --- osu.Game/Skinning/LegacyJudgementPieceNew.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 7fece3e896..6be310c419 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -104,6 +104,7 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); + //todo: this only applies to osu! ruleset apparently. this.MoveTo(new Vector2(0, -5)); this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); From bcecc49092d08b0f1a775e8fe0a092f382edc491 Mon Sep 17 00:00:00 2001 From: EXtremeExploit Date: Wed, 25 Jan 2023 23:05:11 -0300 Subject: [PATCH 14/43] Only do misses animations on modern skins --- osu.Game/Skinning/LegacyJudgementPieceNew.cs | 21 ++++---------------- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 11 +++++++--- osu.Game/Skinning/LegacySkin.cs | 4 ++-- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 6be310c419..5e2bba9ccd 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -17,6 +17,7 @@ namespace osu.Game.Skinning public partial class LegacyJudgementPieceNew : CompositeDrawable, IAnimatableJudgement { private readonly HitResult result; + private readonly decimal? version; private readonly LegacyJudgementPieceOld? temporaryOldStyle; @@ -24,9 +25,10 @@ namespace osu.Game.Skinning private readonly ParticleExplosion? particles; - public LegacyJudgementPieceNew(HitResult result, Func createMainDrawable, Texture? particleTexture) + public LegacyJudgementPieceNew(HitResult result, decimal? version, Func createMainDrawable, Texture? particleTexture) { this.result = result; + this.version = version; AutoSizeAxes = Axes.Both; Origin = Anchor.Centre; @@ -54,7 +56,7 @@ namespace osu.Game.Skinning if (result != HitResult.Miss) { //new judgement shows old as a temporary effect - AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f, true) + AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, this.version, createMainDrawable, 1.05f, true) { Blending = BlendingParameters.Additive, Anchor = Anchor.Centre, @@ -100,21 +102,6 @@ namespace osu.Game.Skinning switch (result) { - case HitResult.Miss: - this.ScaleTo(1.6f); - this.ScaleTo(1, 100, Easing.In); - - //todo: this only applies to osu! ruleset apparently. - this.MoveTo(new Vector2(0, -5)); - this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); - - float rotation = RNG.NextSingle(-8.6f, 8.6f); - - this.RotateTo(0); - this.RotateTo(rotation, fade_in_length) - .Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In); - break; - default: mainPiece.ScaleTo(0.9f); mainPiece.ScaleTo(1.05f, fade_out_delay + fade_out_length); diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 749edf80db..e427e19a6b 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -17,13 +17,15 @@ namespace osu.Game.Skinning public partial class LegacyJudgementPieceOld : CompositeDrawable, IAnimatableJudgement { private readonly HitResult result; + private readonly decimal? version; private readonly float finalScale; private readonly bool forceTransforms; - public LegacyJudgementPieceOld(HitResult result, Func createMainDrawable, float finalScale = 1f, bool forceTransforms = false) + public LegacyJudgementPieceOld(HitResult result, decimal? version, Func createMainDrawable, float finalScale = 1f, bool forceTransforms = false) { this.result = result; + this.version = version; this.finalScale = finalScale; this.forceTransforms = forceTransforms; @@ -56,8 +58,11 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); - this.MoveTo(new Vector2(0, -5)); - this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); + if (this.version > 1) + { + this.MoveTo(new Vector2(0, -5)); + this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); + } float rotation = RNG.NextSingle(-8.6f, 8.6f); diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 5f12d2ce23..0942966b1c 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -390,9 +390,9 @@ namespace osu.Game.Skinning var particle = getParticleTexture(resultComponent.Component); if (particle != null) - return new LegacyJudgementPieceNew(resultComponent.Component, createDrawable, particle); + return new LegacyJudgementPieceNew(resultComponent.Component, this.Configuration.LegacyVersion, createDrawable, particle); - return new LegacyJudgementPieceOld(resultComponent.Component, createDrawable); + return new LegacyJudgementPieceOld(resultComponent.Component, this.Configuration.LegacyVersion, createDrawable); } return null; From f3c92749bf280c10f5a9ed971bb92f55b7848b48 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 26 Jan 2023 15:43:03 +0900 Subject: [PATCH 15/43] Fix code quality issues --- osu.Game/Skinning/LegacyJudgementPieceNew.cs | 5 +---- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 2 +- osu.Game/Skinning/LegacySkin.cs | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 5e2bba9ccd..2f3a308b57 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Animations; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Textures; -using osu.Framework.Utils; using osu.Game.Graphics; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; @@ -17,7 +16,6 @@ namespace osu.Game.Skinning public partial class LegacyJudgementPieceNew : CompositeDrawable, IAnimatableJudgement { private readonly HitResult result; - private readonly decimal? version; private readonly LegacyJudgementPieceOld? temporaryOldStyle; @@ -28,7 +26,6 @@ namespace osu.Game.Skinning public LegacyJudgementPieceNew(HitResult result, decimal? version, Func createMainDrawable, Texture? particleTexture) { this.result = result; - this.version = version; AutoSizeAxes = Axes.Both; Origin = Anchor.Centre; @@ -56,7 +53,7 @@ namespace osu.Game.Skinning if (result != HitResult.Miss) { //new judgement shows old as a temporary effect - AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, this.version, createMainDrawable, 1.05f, true) + AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, version, createMainDrawable, 1.05f, true) { Blending = BlendingParameters.Additive, Anchor = Anchor.Centre, diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index e427e19a6b..ed3a88219e 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -58,7 +58,7 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); - if (this.version > 1) + if (version > 1) { this.MoveTo(new Vector2(0, -5)); this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 0942966b1c..04bb551668 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -390,9 +390,9 @@ namespace osu.Game.Skinning var particle = getParticleTexture(resultComponent.Component); if (particle != null) - return new LegacyJudgementPieceNew(resultComponent.Component, this.Configuration.LegacyVersion, createDrawable, particle); + return new LegacyJudgementPieceNew(resultComponent.Component, Configuration.LegacyVersion, createDrawable, particle); - return new LegacyJudgementPieceOld(resultComponent.Component, this.Configuration.LegacyVersion, createDrawable); + return new LegacyJudgementPieceOld(resultComponent.Component, Configuration.LegacyVersion, createDrawable); } return null; From 758b4c8cfcc7b1ecbb91e64ea8230d211bd6de8f Mon Sep 17 00:00:00 2001 From: EXtremeExploit Date: Thu, 26 Jan 2023 10:01:33 -0300 Subject: [PATCH 16/43] Do the thing aka fix the if --- osu.Game/Skinning/LegacyJudgementPieceNew.cs | 4 ++-- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 12 ++++++++---- osu.Game/Skinning/LegacySkin.cs | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 2f3a308b57..9b1ff9b22f 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -23,7 +23,7 @@ namespace osu.Game.Skinning private readonly ParticleExplosion? particles; - public LegacyJudgementPieceNew(HitResult result, decimal? version, Func createMainDrawable, Texture? particleTexture) + public LegacyJudgementPieceNew(HitResult result, Func createMainDrawable, Texture? particleTexture) { this.result = result; @@ -53,7 +53,7 @@ namespace osu.Game.Skinning if (result != HitResult.Miss) { //new judgement shows old as a temporary effect - AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, version, createMainDrawable, 1.05f, true) + AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f, true) { Blending = BlendingParameters.Additive, Anchor = Anchor.Centre, diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index ed3a88219e..69d38b06c5 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -4,6 +4,7 @@ #nullable disable using System; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Animations; using osu.Framework.Graphics.Containers; @@ -17,15 +18,16 @@ namespace osu.Game.Skinning public partial class LegacyJudgementPieceOld : CompositeDrawable, IAnimatableJudgement { private readonly HitResult result; - private readonly decimal? version; private readonly float finalScale; private readonly bool forceTransforms; - public LegacyJudgementPieceOld(HitResult result, decimal? version, Func createMainDrawable, float finalScale = 1f, bool forceTransforms = false) + [Resolved] + private ISkinSource skin { get; set; } = null!; + + public LegacyJudgementPieceOld(HitResult result, Func createMainDrawable, float finalScale = 1f, bool forceTransforms = false) { this.result = result; - this.version = version; this.finalScale = finalScale; this.forceTransforms = forceTransforms; @@ -58,7 +60,9 @@ namespace osu.Game.Skinning this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); - if (version > 1) + decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; + + if (legacyVersion > 1) { this.MoveTo(new Vector2(0, -5)); this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 04bb551668..5f12d2ce23 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -390,9 +390,9 @@ namespace osu.Game.Skinning var particle = getParticleTexture(resultComponent.Component); if (particle != null) - return new LegacyJudgementPieceNew(resultComponent.Component, Configuration.LegacyVersion, createDrawable, particle); + return new LegacyJudgementPieceNew(resultComponent.Component, createDrawable, particle); - return new LegacyJudgementPieceOld(resultComponent.Component, Configuration.LegacyVersion, createDrawable); + return new LegacyJudgementPieceOld(resultComponent.Component, createDrawable); } return null; From 76296eb35ad87810ad56c9da0dcaff19209a4119 Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Wed, 1 Feb 2023 11:52:14 +0800 Subject: [PATCH 17/43] Consistent with BeatmapsetVerifier --- osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs index 05e49eba84..918be7ff90 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Edit.Checks { public class CheckPreviewTime : ICheck { - public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Timing, "Check Preview Time Consistency"); + public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Timing, "Inconsistent or unset preview time"); public IEnumerable PossibleTemplates => new IssueTemplate[] { @@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplatePreviewTimeConflict : IssueTemplate { public IssueTemplatePreviewTimeConflict(ICheck check) - : base(check, IssueType.Warning, "Audio preview time {1} doesn't match \"{0}\"'s preview time {2}") + : base(check, IssueType.Problem, "Audio preview time {1} doesn't match \"{0}\"'s preview time. {2}") { } @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplateHasNoPreviewTime : IssueTemplate { public IssueTemplateHasNoPreviewTime(ICheck check) - : base(check, IssueType.Warning, "A preview point for this map is not set. Consider settings one from the Timing menu") + : base(check, IssueType.Problem, "A preview point for this map is not set. Consider settings one from the Timing menu.") { } From 209bc3c1ed87e96485edc9fe179157d6a1b60a92 Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Wed, 1 Feb 2023 11:53:26 +0800 Subject: [PATCH 18/43] remove useless setup --- .../Editing/Checks/CheckPreviewTimeTest.cs | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs index 2b7d37dc81..37b01da6ee 100644 --- a/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs +++ b/osu.Game.Tests/Editing/Checks/CheckPreviewTimeTest.cs @@ -22,26 +22,6 @@ namespace osu.Game.Tests.Editing.Checks public void Setup() { check = new CheckPreviewTime(); - beatmap = new Beatmap - { - BeatmapInfo = new BeatmapInfo - { - Metadata = new BeatmapMetadata { PreviewTime = -1 }, - BeatmapSet = new BeatmapSetInfo(new List - { - new BeatmapInfo - { - DifficultyName = "Test1", - Metadata = new BeatmapMetadata { PreviewTime = 5 }, - }, - new BeatmapInfo - { - DifficultyName = "Test2", - Metadata = new BeatmapMetadata { PreviewTime = 10 }, - }, - }) - } - }; } [Test] From 8645e705fd73e2dde122c4905fb0a78d06f6a336 Mon Sep 17 00:00:00 2001 From: tsrk Date: Wed, 1 Feb 2023 23:44:00 +0000 Subject: [PATCH 19/43] feat: add localisation for Skin editor components --- .../BarHitErrorMeterStrings.cs | 89 +++++++++++++++++++ .../BeatmapAttributeTextStrings.cs | 34 +++++++ .../ColourHitErrorMeterStrings.cs | 54 +++++++++++ .../FontAdjustableSkinComponentStrings.cs | 24 +++++ .../GameplayAccuracyCounterStrings.cs | 39 ++++++++ .../JudgementCounterDisplayStrings.cs | 50 +++++++++++ .../SkinnableSpriteStrings.cs | 24 +++++ .../SongProgressStrings.cs | 24 +++++ .../TextElementStrings.cs | 24 +++++ osu.Game/Localisation/SkinEditorStrings.cs | 5 ++ .../Screens/Play/HUD/ArgonSongProgress.cs | 3 +- .../Screens/Play/HUD/DefaultSongProgress.cs | 3 +- .../Play/HUD/GameplayAccuracyCounter.cs | 11 +-- .../HUD/HitErrorMeters/BarHitErrorMeter.cs | 22 +++-- .../HUD/HitErrorMeters/ColourHitErrorMeter.cs | 11 ++- .../JudgementCounterDisplay.cs | 15 +++- .../Components/BeatmapAttributeText.cs | 5 +- osu.Game/Skinning/Components/TextElement.cs | 3 +- osu.Game/Skinning/Editor/SkinEditor.cs | 4 +- .../Skinning/FontAdjustableSkinComponent.cs | 3 +- osu.Game/Skinning/SkinnableSprite.cs | 3 +- 21 files changed, 424 insertions(+), 26 deletions(-) create mode 100644 osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs create mode 100644 osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs diff --git a/osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs b/osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs new file mode 100644 index 0000000000..ea372a5207 --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs @@ -0,0 +1,89 @@ +// 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.Localisation; + +namespace osu.Game.Localisation.SkinEditorComponents +{ + public static class BarHitErrorMeterStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.BarHitErrorMeter"; + + /// + /// "Judgement line thickness" + /// + public static LocalisableString JudgementLineThickness => new TranslatableString(getKey(@"judgement_line_thickness"), "Judgement line thickness"); + + /// + /// "How thick the individual lines should be." + /// + public static LocalisableString JudgementLineThicknessDescription => new TranslatableString(getKey(@"judgement_line_thickness_description"), "How thick the individual lines should be."); + + /// + /// "Show colour bars" + /// + public static LocalisableString ColourBarVisibility => new TranslatableString(getKey(@"colour_bar_visibility"), "Show colour bars"); + + /// + /// "Show moving average arrow" + /// + public static LocalisableString ShowMovingAverage => new TranslatableString(getKey(@"show_moving_average"), "Show moving average arrow"); + + /// + /// "Whether an arrow should move beneath the bar showing the average error." + /// + public static LocalisableString ShowMovingAverageDescription => new TranslatableString(getKey(@"show_moving_average_description"), "Whether an arrow should move beneath the bar showing the average error."); + + /// + /// "Centre marker style" + /// + public static LocalisableString CentreMarkerStyle => new TranslatableString(getKey(@"centre_marker_style"), "Centre marker style"); + + /// + /// "How to signify the centre of the display" + /// + public static LocalisableString CentreMarkerStyleDescription => new TranslatableString(getKey(@"centre_marker_style_description"), "How to signify the centre of the display"); + + /// + /// "None" + /// + public static LocalisableString CentreMarkerStylesNone => new TranslatableString(getKey(@"centre_marker_styles_none"), "None"); + + /// + /// "Circle" + /// + public static LocalisableString CentreMarkerStylesCircle => new TranslatableString(getKey(@"centre_marker_styles_circle"), "Circle"); + + /// + /// "Line" + /// + public static LocalisableString CentreMarkerStylesLine => new TranslatableString(getKey(@"centre_marker_styles_line"), "Line"); + + /// + /// "Label style" + /// + public static LocalisableString LabelStyle => new TranslatableString(getKey(@"label_style"), "Label style"); + + /// + /// "How to show early/late extremities" + /// + public static LocalisableString LabelStyleDescription => new TranslatableString(getKey(@"label_style_description"), "How to show early/late extremities"); + + /// + /// "None" + /// + public static LocalisableString LabelStylesNone => new TranslatableString(getKey(@"label_styles_none"), "None"); + + /// + /// "Icons" + /// + public static LocalisableString LabelStylesIcons => new TranslatableString(getKey(@"label_styles_icons"), "Icons"); + + /// + /// "Text" + /// + public static LocalisableString LabelStylesText => new TranslatableString(getKey(@"label_styles_text"), "Text"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs b/osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs new file mode 100644 index 0000000000..faafa7e304 --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs @@ -0,0 +1,34 @@ +// 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.Localisation; + +namespace osu.Game.Localisation.SkinEditorComponents +{ + public static class BeatmapAttributeTextStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.BeatmapAttributeText"; + + /// + /// "Attribute" + /// + public static LocalisableString Attribute => new TranslatableString(getKey(@"attribute"), "Attribute"); + + /// + /// "The attribute to be displayed." + /// + public static LocalisableString AttributeDescription => new TranslatableString(getKey(@"attribute_description"), "The attribute to be displayed."); + + /// + /// "Template" + /// + public static LocalisableString Template => new TranslatableString(getKey(@"template"), "Template"); + + /// + /// "Supports {{Label}} and {{Value}}, but also including arbitrary attributes like {{StarRating}} (see attribute list for supported values)." + /// + public static LocalisableString TemplateDescription => new TranslatableString(getKey(@"template_description"), @"Supports {{Label}} and {{Value}}, but also including arbitrary attributes like {{StarRating}} (see attribute list for supported values)."); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs b/osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs new file mode 100644 index 0000000000..fec5781c3d --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs @@ -0,0 +1,54 @@ +// 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.Localisation; + +namespace osu.Game.Localisation.SkinEditorComponents +{ + public static class ColourHitErrorMeterStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.ColourHitError"; + + /// + /// "Judgement count" + /// + public static LocalisableString JudgementCount => new TranslatableString(getKey(@"judgement_count"), "Judgement count"); + + /// + /// "The number of displayed judgements" + /// + public static LocalisableString JudgementCountDescription => new TranslatableString(getKey(@"judgement_count_description"), "The number of displayed judgements"); + + /// + /// "Judgement spacing" + /// + public static LocalisableString JudgementSpacing => new TranslatableString(getKey(@"judgement_spacing"), "Judgement spacing"); + + /// + /// "The space between each displayed judgement" + /// + public static LocalisableString JudgementSpacingDescription => new TranslatableString(getKey(@"judgement_spacing_description"), "The space between each displayed judgement"); + + /// + /// "Judgement shape" + /// + public static LocalisableString JudgementShape => new TranslatableString(getKey(@"judgement_shape"), "Judgement shape"); + + /// + /// "The shape of each displayed judgement" + /// + public static LocalisableString JudgementShapeDescription => new TranslatableString(getKey(@"judgement_shape_description"), "The shape of each displayed judgement"); + + /// + /// "Circle" + /// + public static LocalisableString ShapeStyleCircle => new TranslatableString(getKey(@"shape_style_cricle"), "Circle"); + + /// + /// "Square" + /// + public static LocalisableString ShapeStyleSquare => new TranslatableString(getKey(@"shape_style_square"), "Square"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs b/osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs new file mode 100644 index 0000000000..9b92854faa --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs @@ -0,0 +1,24 @@ +// 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.Localisation; + +namespace osu.Game.Localisation.SkinEditorComponents +{ + public static class FontAdjustableSkinComponentStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.FontAdjustableSkinComponent"; + + /// + /// "Font" + /// + public static LocalisableString Font => new TranslatableString(getKey(@"font"), "Font"); + + /// + /// "The font to use." + /// + public static LocalisableString FontDescription => new TranslatableString(getKey(@"font_description"), "The font to use."); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs b/osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs new file mode 100644 index 0000000000..33a742a95e --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs @@ -0,0 +1,39 @@ +// 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.Localisation; + +namespace osu.Game.Localisation.SkinEditorComponents +{ + public static class GameplayAccuracyCounterStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.GameplayAccuracyCounter"; + + /// + /// "Accuracy display mode" + /// + public static LocalisableString AccuracyDisplay => new TranslatableString(getKey(@"accuracy_display"), "Accuracy display mode"); + + /// + /// "Which accuracy mode should be displayed." + /// + public static LocalisableString AccuracyDisplayDescription => new TranslatableString(getKey(@"accuracy_display_description"), "Which accuracy mode should be displayed."); + + /// + /// "Standard" + /// + public static LocalisableString AccuracyDisplayModeStandard => new TranslatableString(getKey(@"accuracy_display_mode_standard"), "Standard"); + + /// + /// "Maximum achievable" + /// + public static LocalisableString AccuracyDisplayModeMax => new TranslatableString(getKey(@"accuracy_display_mode_max"), "Maximum achievable"); + + /// + /// "Minimum achievable" + /// + public static LocalisableString AccuracyDisplayModeMin => new TranslatableString(getKey(@"accuracy_display_mode_min"), "Minimum achievable"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs b/osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs new file mode 100644 index 0000000000..75f0241e56 --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs @@ -0,0 +1,50 @@ +// 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.Localisation; + +namespace osu.Game.Localisation.SkinEditorComponents +{ + public static class JudgementCounterDisplayStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.JudgementCounterDisplay"; + + /// + /// "Display mode" + /// + public static LocalisableString JudgementDisplayMode => new TranslatableString(getKey(@"judgement_display_mode"), "Display mode"); + + /// + /// "Counter direction" + /// + public static LocalisableString FlowDirection => new TranslatableString(getKey(@"flow_direction"), "Counter direction"); + + /// + /// "Show judgement names" + /// + public static LocalisableString ShowJudgementNames => new TranslatableString(getKey(@"show_judgement_names"), "Show judgement names"); + + /// + /// "Show max judgement" + /// + public static LocalisableString ShowMaxJudgement => new TranslatableString(getKey(@"show_max_judgement"), "Show max judgement"); + + /// + /// "Simple" + /// + public static LocalisableString JudgementDisplayModeSimple => new TranslatableString(getKey(@"judgement_display_mode_simple"), "Simple"); + + /// + /// "Normal" + /// + public static LocalisableString JudgementDisplayModeNormal => new TranslatableString(getKey(@"judgement_display_mode_normal"), "Normal"); + + /// + /// "All" + /// + public static LocalisableString JudgementDisplayModeAll => new TranslatableString(getKey(@"judgement_display_mode_all"), "All"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} + diff --git a/osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs b/osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs new file mode 100644 index 0000000000..f67acb493c --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs @@ -0,0 +1,24 @@ +// 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.Localisation; + +namespace osu.Game.Localisation.SkinEditorComponents +{ + public static class SkinnableSpriteStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.SkinnableSprite"; + + /// + /// "Sprite name" + /// + public static LocalisableString SpriteName => new TranslatableString(getKey(@"sprite_name"), "Sprite name"); + + /// + /// "The filename of the sprite" + /// + public static LocalisableString SpriteNameDescription => new TranslatableString(getKey(@"sprite_name_description"), "The filename of the sprite"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs b/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs new file mode 100644 index 0000000000..9719cdef52 --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs @@ -0,0 +1,24 @@ +// 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.Localisation; + +namespace osu.Game.Localisation.SkinEditorComponents +{ + public static class SongProgressStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.SongProgressStrings"; + + /// + /// "Show difficulty graph" + /// + public static LocalisableString ShowGraph => new TranslatableString(getKey(@"show_graph"), "Show difficulty graph"); + + /// + /// "Whether a graph displaying difficulty throughout the beatmap should be shown" + /// + public static LocalisableString ShowGraphDescription => new TranslatableString(getKey(@"show_graph_description"), "Whether a graph displaying difficulty throughout the beatmap should be shown"); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs b/osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs new file mode 100644 index 0000000000..e969da60bf --- /dev/null +++ b/osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs @@ -0,0 +1,24 @@ +// 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.Localisation; + +namespace osu.Game.Localisation.SkinEditorComponents +{ + public static class TextElementStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.TextElement"; + + /// + /// "Text" + /// + public static LocalisableString TextElementText => new TranslatableString(getKey(@"text_element_text"), "Text"); + + /// + /// "The text to be displayed." + /// + public static LocalisableString TextElementTextDescription => new TranslatableString(getKey(@"text_element_text_description"), "The text to be displayed."); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinEditorStrings.cs b/osu.Game/Localisation/SkinEditorStrings.cs index b2e5f3aeb6..d9744cf6c8 100644 --- a/osu.Game/Localisation/SkinEditorStrings.cs +++ b/osu.Game/Localisation/SkinEditorStrings.cs @@ -39,6 +39,11 @@ namespace osu.Game.Localisation /// public static LocalisableString Settings(string arg0) => new TranslatableString(getKey(@"settings"), @"Settings ({0})", arg0); + /// + /// "Curently editing" + /// + public static LocalisableString CurrentlyEditing => new TranslatableString(getKey(@"currently_editing"), "Curently editing"); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs index bfee6d295e..075e5af163 100644 --- a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Configuration; using osu.Game.Graphics; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Objects; namespace osu.Game.Screens.Play.HUD @@ -21,7 +22,7 @@ namespace osu.Game.Screens.Play.HUD private const float bar_height = 10; - [SettingSource("Show difficulty graph", "Whether a graph displaying difficulty throughout the beatmap should be shown")] + [SettingSource(typeof(SongProgressStrings), nameof(SongProgressStrings.ShowGraph), nameof(SongProgressStrings.ShowGraphDescription))] public Bindable ShowGraph { get; } = new BindableBool(true); [Resolved] diff --git a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs index 91a34fe374..1c051c24ae 100644 --- a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs @@ -7,6 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Objects; using osuTK; @@ -26,7 +27,7 @@ namespace osu.Game.Screens.Play.HUD private readonly DefaultSongProgressGraph graph; private readonly SongProgressInfo info; - [SettingSource("Show difficulty graph", "Whether a graph displaying difficulty throughout the beatmap should be shown")] + [SettingSource(typeof(SongProgressStrings), nameof(SongProgressStrings.ShowGraph), nameof(SongProgressStrings.ShowGraphDescription))] public Bindable ShowGraph { get; } = new BindableBool(true); [Resolved] diff --git a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs index ca7fef8f73..d044b3d98a 100644 --- a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs +++ b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs @@ -1,18 +1,19 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.ComponentModel; using osu.Framework.Allocation; using osu.Framework.Bindables; +using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Play.HUD { public abstract partial class GameplayAccuracyCounter : PercentageCounter { - [SettingSource("Accuracy display mode", "Which accuracy mode should be displayed.")] + [SettingSource(typeof(GameplayAccuracyCounterStrings), nameof(GameplayAccuracyCounterStrings.AccuracyDisplay), nameof(GameplayAccuracyCounterStrings.AccuracyDisplayDescription))] public Bindable AccuracyDisplay { get; } = new Bindable(); [Resolved] @@ -51,13 +52,13 @@ namespace osu.Game.Screens.Play.HUD public enum AccuracyDisplayMode { - [Description("Standard")] + [LocalisableDescription(typeof(GameplayAccuracyCounterStrings), nameof(GameplayAccuracyCounterStrings.AccuracyDisplayModeStandard))] Standard, - [Description("Maximum achievable")] + [LocalisableDescription(typeof(GameplayAccuracyCounterStrings), nameof(GameplayAccuracyCounterStrings.AccuracyDisplayModeMax))] MaximumAchievable, - [Description("Minimum achievable")] + [LocalisableDescription(typeof(GameplayAccuracyCounterStrings), nameof(GameplayAccuracyCounterStrings.AccuracyDisplayModeMin))] MinimumAchievable } } diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs index 0337f66bd9..5d0efe7b77 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs @@ -12,10 +12,12 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; @@ -25,7 +27,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters [Cached] public partial class BarHitErrorMeter : HitErrorMeter { - [SettingSource("Judgement line thickness", "How thick the individual lines should be.")] + [SettingSource(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.JudgementLineThickness), nameof(BarHitErrorMeterStrings.JudgementLineThicknessDescription))] public BindableNumber JudgementLineThickness { get; } = new BindableNumber(4) { MinValue = 1, @@ -33,16 +35,16 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters Precision = 0.1f, }; - [SettingSource("Show colour bars")] + [SettingSource(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.ColourBarVisibility))] public Bindable ColourBarVisibility { get; } = new Bindable(true); - [SettingSource("Show moving average arrow", "Whether an arrow should move beneath the bar showing the average error.")] + [SettingSource(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.ShowMovingAverage), nameof(BarHitErrorMeterStrings.ShowMovingAverageDescription))] public Bindable ShowMovingAverage { get; } = new BindableBool(true); - [SettingSource("Centre marker style", "How to signify the centre of the display")] + [SettingSource(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.CentreMarkerStyle), nameof(BarHitErrorMeterStrings.CentreMarkerStyleDescription))] public Bindable CentreMarkerStyle { get; } = new Bindable(CentreMarkerStyles.Circle); - [SettingSource("Label style", "How to show early/late extremities")] + [SettingSource(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStyle), nameof(BarHitErrorMeterStrings.LabelStyleDescription))] public Bindable LabelStyle { get; } = new Bindable(LabelStyles.Icons); private const int judgement_line_width = 14; @@ -487,15 +489,25 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters public enum CentreMarkerStyles { + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.CentreMarkerStylesNone))] None, + + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.CentreMarkerStylesCircle))] Circle, + + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.CentreMarkerStylesLine))] Line } public enum LabelStyles { + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesNone))] None, + + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesIcons))] Icons, + + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesIcons))] Text } } diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs index ec5dc5f52f..28e2006c2f 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs @@ -9,7 +9,9 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Shapes; +using osu.Framework.Localisation; using osu.Game.Configuration; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; @@ -23,21 +25,21 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters private const int animation_duration = 200; private const int drawable_judgement_size = 8; - [SettingSource("Judgement count", "The number of displayed judgements")] + [SettingSource(typeof(ColourHitErrorMeterStrings), nameof(ColourHitErrorMeterStrings.JudgementCount), nameof(ColourHitErrorMeterStrings.JudgementCountDescription))] public BindableNumber JudgementCount { get; } = new BindableNumber(20) { MinValue = 1, MaxValue = 50, }; - [SettingSource("Judgement spacing", "The space between each displayed judgement")] + [SettingSource(typeof(ColourHitErrorMeterStrings), nameof(ColourHitErrorMeterStrings.JudgementSpacing), nameof(ColourHitErrorMeterStrings.JudgementSpacingDescription))] public BindableNumber JudgementSpacing { get; } = new BindableNumber(2) { MinValue = 0, MaxValue = 10, }; - [SettingSource("Judgement shape", "The shape of each displayed judgement")] + [SettingSource(typeof(ColourHitErrorMeterStrings), nameof(ColourHitErrorMeterStrings.JudgementShape), nameof(ColourHitErrorMeterStrings.JudgementShapeDescription))] public Bindable JudgementShape { get; } = new Bindable(); private readonly JudgementFlow judgementsFlow; @@ -192,7 +194,10 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters public enum ShapeStyle { + [LocalisableDescription(typeof(ColourHitErrorMeterStrings), nameof(ColourHitErrorMeterStrings.ShapeStyleCircle))] Circle, + + [LocalisableDescription(typeof(ColourHitErrorMeterStrings), nameof(ColourHitErrorMeterStrings.ShapeStyleSquare))] Square } } diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs index 82f24c736e..d047b8e5fb 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs @@ -6,7 +6,9 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Localisation; using osu.Game.Configuration; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Rulesets.Scoring; using osu.Game.Skinning; using osuTK; @@ -19,16 +21,16 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter public bool UsesFixedAnchor { get; set; } - [SettingSource("Display mode")] + [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.JudgementDisplayMode))] public Bindable Mode { get; set; } = new Bindable(); - [SettingSource("Counter direction")] + [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.FlowDirection))] public Bindable FlowDirection { get; set; } = new Bindable(); - [SettingSource("Show judgement names")] + [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.ShowJudgementNames))] public BindableBool ShowJudgementNames { get; set; } = new BindableBool(true); - [SettingSource("Show max judgement")] + [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.ShowMaxJudgement))] public BindableBool ShowMaxJudgement { get; set; } = new BindableBool(true); [Resolved] @@ -130,8 +132,13 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter public enum DisplayMode { + [LocalisableDescription(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.JudgementDisplayModeSimple))] Simple, + + [LocalisableDescription(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.JudgementDisplayModeNormal))] Normal, + + [LocalisableDescription(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.JudgementDisplayModeAll))] All } } diff --git a/osu.Game/Skinning/Components/BeatmapAttributeText.cs b/osu.Game/Skinning/Components/BeatmapAttributeText.cs index 68bb1e7ddc..d2e724f760 100644 --- a/osu.Game/Skinning/Components/BeatmapAttributeText.cs +++ b/osu.Game/Skinning/Components/BeatmapAttributeText.cs @@ -18,6 +18,7 @@ using osu.Game.Configuration; using osu.Game.Extensions; using osu.Game.Graphics.Sprites; using osu.Game.Localisation; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Resources.Localisation.Web; namespace osu.Game.Skinning.Components @@ -25,10 +26,10 @@ namespace osu.Game.Skinning.Components [UsedImplicitly] public partial class BeatmapAttributeText : FontAdjustableSkinComponent { - [SettingSource("Attribute", "The attribute to be displayed.")] + [SettingSource(typeof(BeatmapAttributeTextStrings), nameof(BeatmapAttributeTextStrings.Attribute), nameof(BeatmapAttributeTextStrings.AttributeDescription))] public Bindable Attribute { get; } = new Bindable(BeatmapAttribute.StarRating); - [SettingSource("Template", "Supports {Label} and {Value}, but also including arbitrary attributes like {StarRating} (see attribute list for supported values).")] + [SettingSource(typeof(BeatmapAttributeTextStrings), nameof(BeatmapAttributeTextStrings.Template), nameof(BeatmapAttributeTextStrings.TemplateDescription))] public Bindable Template { get; set; } = new Bindable("{Label}: {Value}"); [Resolved] diff --git a/osu.Game/Skinning/Components/TextElement.cs b/osu.Game/Skinning/Components/TextElement.cs index d87fb125bb..9adc065b88 100644 --- a/osu.Game/Skinning/Components/TextElement.cs +++ b/osu.Game/Skinning/Components/TextElement.cs @@ -8,13 +8,14 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Localisation.SkinEditorComponents; namespace osu.Game.Skinning.Components { [UsedImplicitly] public partial class TextElement : FontAdjustableSkinComponent { - [SettingSource("Text", "The text to be displayed.")] + [SettingSource(typeof(TextElementStrings), nameof(TextElementStrings.TextElementText), nameof(TextElementStrings.TextElementTextDescription))] public Bindable Text { get; } = new Bindable("Circles!"); private readonly OsuSpriteText text; diff --git a/osu.Game/Skinning/Editor/SkinEditor.cs b/osu.Game/Skinning/Editor/SkinEditor.cs index 98b4e960dd..74391e5269 100644 --- a/osu.Game/Skinning/Editor/SkinEditor.cs +++ b/osu.Game/Skinning/Editor/SkinEditor.cs @@ -254,13 +254,13 @@ namespace osu.Game.Skinning.Editor headerText.AddParagraph(SkinEditorStrings.SkinEditor, cp => cp.Font = OsuFont.Default.With(size: 16)); headerText.NewParagraph(); - headerText.AddText("Currently editing ", cp => + headerText.AddText(SkinEditorStrings.CurrentlyEditing, cp => { cp.Font = OsuFont.Default.With(size: 12); cp.Colour = colours.Yellow; }); - headerText.AddText($"{currentSkin.Value.SkinInfo}", cp => + headerText.AddText($" {currentSkin.Value.SkinInfo}", cp => { cp.Font = OsuFont.Default.With(size: 12, weight: FontWeight.Bold); cp.Colour = colours.Yellow; diff --git a/osu.Game/Skinning/FontAdjustableSkinComponent.cs b/osu.Game/Skinning/FontAdjustableSkinComponent.cs index ee73417bfe..51d4aa9fee 100644 --- a/osu.Game/Skinning/FontAdjustableSkinComponent.cs +++ b/osu.Game/Skinning/FontAdjustableSkinComponent.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; +using osu.Game.Localisation.SkinEditorComponents; namespace osu.Game.Skinning { @@ -16,7 +17,7 @@ namespace osu.Game.Skinning { public bool UsesFixedAnchor { get; set; } - [SettingSource("Font", "The font to use.")] + [SettingSource(typeof(FontAdjustableSkinComponentStrings), nameof(FontAdjustableSkinComponentStrings.Font), nameof(FontAdjustableSkinComponentStrings.FontDescription))] public Bindable Font { get; } = new Bindable(Typeface.Torus); /// diff --git a/osu.Game/Skinning/SkinnableSprite.cs b/osu.Game/Skinning/SkinnableSprite.cs index a66f3e0549..a5ed2a4b64 100644 --- a/osu.Game/Skinning/SkinnableSprite.cs +++ b/osu.Game/Skinning/SkinnableSprite.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; +using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Overlays.Settings; using osuTK; @@ -27,7 +28,7 @@ namespace osu.Game.Skinning [Resolved] private TextureStore textures { get; set; } = null!; - [SettingSource("Sprite name", "The filename of the sprite", SettingControlType = typeof(SpriteSelectorControl))] + [SettingSource(typeof(SkinnableSpriteStrings), nameof(SkinnableSpriteStrings.SpriteName), nameof(SkinnableSpriteStrings.SpriteNameDescription), SettingControlType = typeof(SpriteSelectorControl))] public Bindable SpriteName { get; } = new Bindable(string.Empty); [Resolved] From ddfa95e6ef280939d8a19d146e8c8a07727ef8b9 Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 2 Feb 2023 00:01:48 +0000 Subject: [PATCH 20/43] refactor: fix typos --- .../Localisation/SkinEditorComponents/SongProgressStrings.cs | 2 +- osu.Game/Localisation/SkinEditorStrings.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs b/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs index 9719cdef52..0e4d7ea34d 100644 --- a/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs +++ b/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs @@ -7,7 +7,7 @@ namespace osu.Game.Localisation.SkinEditorComponents { public static class SongProgressStrings { - private const string prefix = @"osu.Game.Resources.Localisation.SongProgressStrings"; + private const string prefix = @"osu.Game.Resources.Localisation.SongProgress"; /// /// "Show difficulty graph" diff --git a/osu.Game/Localisation/SkinEditorStrings.cs b/osu.Game/Localisation/SkinEditorStrings.cs index d9744cf6c8..5cf2e5b5c5 100644 --- a/osu.Game/Localisation/SkinEditorStrings.cs +++ b/osu.Game/Localisation/SkinEditorStrings.cs @@ -40,9 +40,9 @@ namespace osu.Game.Localisation public static LocalisableString Settings(string arg0) => new TranslatableString(getKey(@"settings"), @"Settings ({0})", arg0); /// - /// "Curently editing" + /// "Currently editing" /// - public static LocalisableString CurrentlyEditing => new TranslatableString(getKey(@"currently_editing"), "Curently editing"); + public static LocalisableString CurrentlyEditing => new TranslatableString(getKey(@"currently_editing"), "Currently editing"); private static string getKey(string key) => $@"{prefix}:{key}"; } From 0fb6a637091235afc715db3c1a3e67544acc00ad Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 2 Feb 2023 00:46:14 +0000 Subject: [PATCH 21/43] refactor: change namespacing to allow osu-localisation-analyzer to process all strings --- .../{SkinEditorComponents => }/BarHitErrorMeterStrings.cs | 2 +- .../{SkinEditorComponents => }/BeatmapAttributeTextStrings.cs | 2 +- .../{SkinEditorComponents => }/ColourHitErrorMeterStrings.cs | 2 +- .../FontAdjustableSkinComponentStrings.cs | 2 +- .../GameplayAccuracyCounterStrings.cs | 2 +- .../JudgementCounterDisplayStrings.cs | 2 +- .../{SkinEditorComponents => }/SkinnableSpriteStrings.cs | 2 +- .../{SkinEditorComponents => }/SongProgressStrings.cs | 2 +- .../{SkinEditorComponents => }/TextElementStrings.cs | 2 +- osu.Game/Screens/Play/HUD/ArgonSongProgress.cs | 2 +- osu.Game/Screens/Play/HUD/DefaultSongProgress.cs | 2 +- osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs | 2 +- osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs | 2 +- osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs | 2 +- .../Play/HUD/JudgementCounter/JudgementCounterDisplay.cs | 2 +- osu.Game/Skinning/Components/BeatmapAttributeText.cs | 1 - osu.Game/Skinning/Components/TextElement.cs | 2 +- osu.Game/Skinning/FontAdjustableSkinComponent.cs | 2 +- osu.Game/Skinning/SkinnableSprite.cs | 2 +- 19 files changed, 18 insertions(+), 19 deletions(-) rename osu.Game/Localisation/{SkinEditorComponents => }/BarHitErrorMeterStrings.cs (98%) rename osu.Game/Localisation/{SkinEditorComponents => }/BeatmapAttributeTextStrings.cs (96%) rename osu.Game/Localisation/{SkinEditorComponents => }/ColourHitErrorMeterStrings.cs (97%) rename osu.Game/Localisation/{SkinEditorComponents => }/FontAdjustableSkinComponentStrings.cs (93%) rename osu.Game/Localisation/{SkinEditorComponents => }/GameplayAccuracyCounterStrings.cs (96%) rename osu.Game/Localisation/{SkinEditorComponents => }/JudgementCounterDisplayStrings.cs (97%) rename osu.Game/Localisation/{SkinEditorComponents => }/SkinnableSpriteStrings.cs (94%) rename osu.Game/Localisation/{SkinEditorComponents => }/SongProgressStrings.cs (94%) rename osu.Game/Localisation/{SkinEditorComponents => }/TextElementStrings.cs (94%) diff --git a/osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs b/osu.Game/Localisation/BarHitErrorMeterStrings.cs similarity index 98% rename from osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs rename to osu.Game/Localisation/BarHitErrorMeterStrings.cs index ea372a5207..171c3e223e 100644 --- a/osu.Game/Localisation/SkinEditorComponents/BarHitErrorMeterStrings.cs +++ b/osu.Game/Localisation/BarHitErrorMeterStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class BarHitErrorMeterStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs b/osu.Game/Localisation/BeatmapAttributeTextStrings.cs similarity index 96% rename from osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs rename to osu.Game/Localisation/BeatmapAttributeTextStrings.cs index faafa7e304..1ceb482cf4 100644 --- a/osu.Game/Localisation/SkinEditorComponents/BeatmapAttributeTextStrings.cs +++ b/osu.Game/Localisation/BeatmapAttributeTextStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class BeatmapAttributeTextStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs b/osu.Game/Localisation/ColourHitErrorMeterStrings.cs similarity index 97% rename from osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs rename to osu.Game/Localisation/ColourHitErrorMeterStrings.cs index fec5781c3d..13682c9c85 100644 --- a/osu.Game/Localisation/SkinEditorComponents/ColourHitErrorMeterStrings.cs +++ b/osu.Game/Localisation/ColourHitErrorMeterStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class ColourHitErrorMeterStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs b/osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs similarity index 93% rename from osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs rename to osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs index 9b92854faa..76f9f2f8b9 100644 --- a/osu.Game/Localisation/SkinEditorComponents/FontAdjustableSkinComponentStrings.cs +++ b/osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class FontAdjustableSkinComponentStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs b/osu.Game/Localisation/GameplayAccuracyCounterStrings.cs similarity index 96% rename from osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs rename to osu.Game/Localisation/GameplayAccuracyCounterStrings.cs index 33a742a95e..c9e936d8af 100644 --- a/osu.Game/Localisation/SkinEditorComponents/GameplayAccuracyCounterStrings.cs +++ b/osu.Game/Localisation/GameplayAccuracyCounterStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class GameplayAccuracyCounterStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs b/osu.Game/Localisation/JudgementCounterDisplayStrings.cs similarity index 97% rename from osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs rename to osu.Game/Localisation/JudgementCounterDisplayStrings.cs index 75f0241e56..fbc22e96fd 100644 --- a/osu.Game/Localisation/SkinEditorComponents/JudgementCounterDisplayStrings.cs +++ b/osu.Game/Localisation/JudgementCounterDisplayStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class JudgementCounterDisplayStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs b/osu.Game/Localisation/SkinnableSpriteStrings.cs similarity index 94% rename from osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs rename to osu.Game/Localisation/SkinnableSpriteStrings.cs index f67acb493c..6192f5e43d 100644 --- a/osu.Game/Localisation/SkinEditorComponents/SkinnableSpriteStrings.cs +++ b/osu.Game/Localisation/SkinnableSpriteStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class SkinnableSpriteStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs b/osu.Game/Localisation/SongProgressStrings.cs similarity index 94% rename from osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs rename to osu.Game/Localisation/SongProgressStrings.cs index 0e4d7ea34d..033560ebb0 100644 --- a/osu.Game/Localisation/SkinEditorComponents/SongProgressStrings.cs +++ b/osu.Game/Localisation/SongProgressStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class SongProgressStrings { diff --git a/osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs b/osu.Game/Localisation/TextElementStrings.cs similarity index 94% rename from osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs rename to osu.Game/Localisation/TextElementStrings.cs index e969da60bf..6257b80d72 100644 --- a/osu.Game/Localisation/SkinEditorComponents/TextElementStrings.cs +++ b/osu.Game/Localisation/TextElementStrings.cs @@ -3,7 +3,7 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation.SkinEditorComponents +namespace osu.Game.Localisation { public static class TextElementStrings { diff --git a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs index 075e5af163..6c5ba52f27 100644 --- a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Objects; namespace osu.Game.Screens.Play.HUD diff --git a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs index 1c051c24ae..fccefd49a4 100644 --- a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs @@ -7,7 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Objects; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs index d044b3d98a..3a7c97632d 100644 --- a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs +++ b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs @@ -6,7 +6,7 @@ using osu.Framework.Bindables; using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Play.HUD diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs index 5d0efe7b77..3507987fe4 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs @@ -17,7 +17,7 @@ using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs index 28e2006c2f..ac49e9ca5e 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs @@ -11,7 +11,7 @@ using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Shapes; using osu.Framework.Localisation; using osu.Game.Configuration; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs index d047b8e5fb..31b0b9ebc5 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Localisation; using osu.Game.Configuration; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Rulesets.Scoring; using osu.Game.Skinning; using osuTK; diff --git a/osu.Game/Skinning/Components/BeatmapAttributeText.cs b/osu.Game/Skinning/Components/BeatmapAttributeText.cs index d2e724f760..e8b2d547a9 100644 --- a/osu.Game/Skinning/Components/BeatmapAttributeText.cs +++ b/osu.Game/Skinning/Components/BeatmapAttributeText.cs @@ -18,7 +18,6 @@ using osu.Game.Configuration; using osu.Game.Extensions; using osu.Game.Graphics.Sprites; using osu.Game.Localisation; -using osu.Game.Localisation.SkinEditorComponents; using osu.Game.Resources.Localisation.Web; namespace osu.Game.Skinning.Components diff --git a/osu.Game/Skinning/Components/TextElement.cs b/osu.Game/Skinning/Components/TextElement.cs index 9adc065b88..c160f3f9d0 100644 --- a/osu.Game/Skinning/Components/TextElement.cs +++ b/osu.Game/Skinning/Components/TextElement.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; namespace osu.Game.Skinning.Components { diff --git a/osu.Game/Skinning/FontAdjustableSkinComponent.cs b/osu.Game/Skinning/FontAdjustableSkinComponent.cs index 51d4aa9fee..9c28621d48 100644 --- a/osu.Game/Skinning/FontAdjustableSkinComponent.cs +++ b/osu.Game/Skinning/FontAdjustableSkinComponent.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; namespace osu.Game.Skinning { diff --git a/osu.Game/Skinning/SkinnableSprite.cs b/osu.Game/Skinning/SkinnableSprite.cs index a5ed2a4b64..3deb264bc8 100644 --- a/osu.Game/Skinning/SkinnableSprite.cs +++ b/osu.Game/Skinning/SkinnableSprite.cs @@ -12,7 +12,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation.SkinEditorComponents; +using osu.Game.Localisation; using osu.Game.Overlays.Settings; using osuTK; From 8dc2e6872e3723cadcf36453f3bf57cc74dba4ad Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 26 Jan 2023 18:21:04 +0900 Subject: [PATCH 22/43] Move skin editor to overlays namespace --- osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditor.cs | 2 +- .../Visual/Gameplay/TestSceneSkinEditorComponentsList.cs | 2 +- .../Visual/Gameplay/TestSceneSkinEditorMultipleSkins.cs | 2 +- osu.Game.Tests/Visual/Navigation/TestSceneEditDefaultSkin.cs | 2 +- .../Visual/Navigation/TestSceneSkinEditorNavigation.cs | 2 +- osu.Game/OsuGame.cs | 2 +- osu.Game/Overlays/Settings/Sections/SkinSection.cs | 2 +- .../Editor => Overlays/SkinEditor}/SkinBlueprint.cs | 3 ++- .../Editor => Overlays/SkinEditor}/SkinBlueprintContainer.cs | 5 +++-- .../Editor => Overlays/SkinEditor}/SkinComponentToolbox.cs | 4 ++-- .../{Skinning/Editor => Overlays/SkinEditor}/SkinEditor.cs | 4 ++-- .../Editor => Overlays/SkinEditor}/SkinEditorOverlay.cs | 2 +- .../Editor => Overlays/SkinEditor}/SkinEditorSceneLibrary.cs | 3 +-- .../Editor => Overlays/SkinEditor}/SkinSelectionHandler.cs | 3 ++- .../Editor => Overlays/SkinEditor}/SkinSettingsToolbox.cs | 2 +- 15 files changed, 21 insertions(+), 19 deletions(-) rename osu.Game/{Skinning/Editor => Overlays/SkinEditor}/SkinBlueprint.cs (98%) rename osu.Game/{Skinning/Editor => Overlays/SkinEditor}/SkinBlueprintContainer.cs (98%) rename osu.Game/{Skinning/Editor => Overlays/SkinEditor}/SkinComponentToolbox.cs (99%) rename osu.Game/{Skinning/Editor => Overlays/SkinEditor}/SkinEditor.cs (99%) rename osu.Game/{Skinning/Editor => Overlays/SkinEditor}/SkinEditorOverlay.cs (99%) rename osu.Game/{Skinning/Editor => Overlays/SkinEditor}/SkinEditorSceneLibrary.cs (98%) rename osu.Game/{Skinning/Editor => Overlays/SkinEditor}/SkinSelectionHandler.cs (99%) rename osu.Game/{Skinning/Editor => Overlays/SkinEditor}/SkinSettingsToolbox.cs (96%) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditor.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditor.cs index 48dbda9da6..86d97b4999 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditor.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditor.cs @@ -9,11 +9,11 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Testing; using osu.Game.Overlays; using osu.Game.Overlays.Settings; +using osu.Game.Overlays.SkinEditor; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu; using osu.Game.Screens.Play.HUD.HitErrorMeters; using osu.Game.Skinning; -using osu.Game.Skinning.Editor; using osuTK.Input; namespace osu.Game.Tests.Visual.Gameplay diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorComponentsList.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorComponentsList.cs index 05a550a24d..2ae5e6f998 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorComponentsList.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorComponentsList.cs @@ -7,9 +7,9 @@ using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Overlays; +using osu.Game.Overlays.SkinEditor; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu; -using osu.Game.Skinning.Editor; namespace osu.Game.Tests.Visual.Gameplay { diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorMultipleSkins.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorMultipleSkins.cs index ad3911f50b..d5b6ac38cb 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorMultipleSkins.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorMultipleSkins.cs @@ -8,11 +8,11 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Testing; using osu.Framework.Timing; +using osu.Game.Overlays.SkinEditor; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Play; -using osu.Game.Skinning.Editor; using osu.Game.Tests.Gameplay; using osuTK.Input; diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneEditDefaultSkin.cs b/osu.Game.Tests/Visual/Navigation/TestSceneEditDefaultSkin.cs index 7d39d48378..bd75825da2 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneEditDefaultSkin.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneEditDefaultSkin.cs @@ -8,8 +8,8 @@ using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Testing; using osu.Game.Overlays.Settings.Sections; +using osu.Game.Overlays.SkinEditor; using osu.Game.Skinning; -using osu.Game.Skinning.Editor; namespace osu.Game.Tests.Visual.Navigation { diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs index 845cfdd6df..467b943ea0 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs @@ -12,11 +12,11 @@ using osu.Framework.Screens; using osu.Framework.Testing; using osu.Framework.Threading; using osu.Game.Overlays.Settings; +using osu.Game.Overlays.SkinEditor; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Screens.Play; using osu.Game.Screens.Play.HUD.HitErrorMeters; -using osu.Game.Skinning.Editor; using osu.Game.Tests.Beatmaps.IO; using osuTK; using osuTK.Input; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 4113c9be8f..df3d8b99f4 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -49,6 +49,7 @@ using osu.Game.Overlays; using osu.Game.Overlays.BeatmapListing; using osu.Game.Overlays.Music; using osu.Game.Overlays.Notifications; +using osu.Game.Overlays.SkinEditor; using osu.Game.Overlays.Toolbar; using osu.Game.Overlays.Volume; using osu.Game.Performance; @@ -59,7 +60,6 @@ using osu.Game.Screens.Menu; using osu.Game.Screens.Play; using osu.Game.Screens.Ranking; using osu.Game.Screens.Select; -using osu.Game.Skinning.Editor; using osu.Game.Updater; using osu.Game.Users; using osu.Game.Utils; diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index f75656cc99..5cf8157812 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -17,9 +17,9 @@ using osu.Framework.Platform; using osu.Game.Database; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; +using osu.Game.Overlays.SkinEditor; using osu.Game.Screens.Select; using osu.Game.Skinning; -using osu.Game.Skinning.Editor; using Realms; namespace osu.Game.Overlays.Settings.Sections diff --git a/osu.Game/Skinning/Editor/SkinBlueprint.cs b/osu.Game/Overlays/SkinEditor/SkinBlueprint.cs similarity index 98% rename from osu.Game/Skinning/Editor/SkinBlueprint.cs rename to osu.Game/Overlays/SkinEditor/SkinBlueprint.cs index c5e822a17a..893bc4bac2 100644 --- a/osu.Game/Skinning/Editor/SkinBlueprint.cs +++ b/osu.Game/Overlays/SkinEditor/SkinBlueprint.cs @@ -11,10 +11,11 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Edit; +using osu.Game.Skinning; using osuTK; using osuTK.Graphics; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { public partial class SkinBlueprint : SelectionBlueprint { diff --git a/osu.Game/Skinning/Editor/SkinBlueprintContainer.cs b/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs similarity index 98% rename from osu.Game/Skinning/Editor/SkinBlueprintContainer.cs rename to osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs index 2998136aca..9f99242fc5 100644 --- a/osu.Game/Skinning/Editor/SkinBlueprintContainer.cs +++ b/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs @@ -8,16 +8,17 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; +using osu.Framework.Input.Events; using osu.Framework.Screens; using osu.Framework.Testing; -using osu.Framework.Input.Events; using osu.Game.Rulesets.Edit; using osu.Game.Screens; using osu.Game.Screens.Edit.Compose.Components; +using osu.Game.Skinning; using osuTK; using osuTK.Input; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { public partial class SkinBlueprintContainer : BlueprintContainer { diff --git a/osu.Game/Skinning/Editor/SkinComponentToolbox.cs b/osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs similarity index 99% rename from osu.Game/Skinning/Editor/SkinComponentToolbox.cs rename to osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs index 9985b81059..6017a98944 100644 --- a/osu.Game/Skinning/Editor/SkinComponentToolbox.cs +++ b/osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs @@ -11,12 +11,12 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; -using osu.Game.Overlays; using osu.Game.Screens.Edit.Components; using osu.Game.Screens.Play.HUD; +using osu.Game.Skinning; using osuTK; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { public partial class SkinComponentToolbox : EditorSidebarSection { diff --git a/osu.Game/Skinning/Editor/SkinEditor.cs b/osu.Game/Overlays/SkinEditor/SkinEditor.cs similarity index 99% rename from osu.Game/Skinning/Editor/SkinEditor.cs rename to osu.Game/Overlays/SkinEditor/SkinEditor.cs index 5c0c8b2427..ad89057d12 100644 --- a/osu.Game/Skinning/Editor/SkinEditor.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditor.cs @@ -23,12 +23,12 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Cursor; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; -using osu.Game.Overlays; using osu.Game.Overlays.OSD; using osu.Game.Screens.Edit.Components; using osu.Game.Screens.Edit.Components.Menus; +using osu.Game.Skinning; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { [Cached(typeof(SkinEditor))] public partial class SkinEditor : VisibilityContainer, ICanAcceptFiles, IKeyBindingHandler diff --git a/osu.Game/Skinning/Editor/SkinEditorOverlay.cs b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs similarity index 99% rename from osu.Game/Skinning/Editor/SkinEditorOverlay.cs rename to osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs index f15afc7feb..4eff87c5f4 100644 --- a/osu.Game/Skinning/Editor/SkinEditorOverlay.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs @@ -14,7 +14,7 @@ using osu.Game.Screens; using osu.Game.Screens.Edit.Components; using osuTK; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { /// /// A container which handles loading a skin editor on user request for a specified target. diff --git a/osu.Game/Skinning/Editor/SkinEditorSceneLibrary.cs b/osu.Game/Overlays/SkinEditor/SkinEditorSceneLibrary.cs similarity index 98% rename from osu.Game/Skinning/Editor/SkinEditorSceneLibrary.cs rename to osu.Game/Overlays/SkinEditor/SkinEditorSceneLibrary.cs index 0936be3ee8..61195d7175 100644 --- a/osu.Game/Skinning/Editor/SkinEditorSceneLibrary.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditorSceneLibrary.cs @@ -14,7 +14,6 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; -using osu.Game.Overlays; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Screens; @@ -23,7 +22,7 @@ using osu.Game.Screens.Select; using osu.Game.Utils; using osuTK; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { public partial class SkinEditorSceneLibrary : CompositeDrawable { diff --git a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs b/osu.Game/Overlays/SkinEditor/SkinSelectionHandler.cs similarity index 99% rename from osu.Game/Skinning/Editor/SkinSelectionHandler.cs rename to osu.Game/Overlays/SkinEditor/SkinSelectionHandler.cs index d67cbef481..129b9c1b44 100644 --- a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs +++ b/osu.Game/Overlays/SkinEditor/SkinSelectionHandler.cs @@ -14,9 +14,10 @@ using osu.Game.Extensions; using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Edit; using osu.Game.Screens.Edit.Compose.Components; +using osu.Game.Skinning; using osuTK; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { public partial class SkinSelectionHandler : SelectionHandler { diff --git a/osu.Game/Skinning/Editor/SkinSettingsToolbox.cs b/osu.Game/Overlays/SkinEditor/SkinSettingsToolbox.cs similarity index 96% rename from osu.Game/Skinning/Editor/SkinSettingsToolbox.cs rename to osu.Game/Overlays/SkinEditor/SkinSettingsToolbox.cs index 6afe92c6b2..5a48dee973 100644 --- a/osu.Game/Skinning/Editor/SkinSettingsToolbox.cs +++ b/osu.Game/Overlays/SkinEditor/SkinSettingsToolbox.cs @@ -9,7 +9,7 @@ using osu.Game.Localisation; using osu.Game.Screens.Edit.Components; using osuTK; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { internal partial class SkinSettingsToolbox : EditorSidebarSection { From 183d1c5bd60612c4b385a08b9e1c3c2f7ad086f5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 14:08:45 +0900 Subject: [PATCH 23/43] Change version comparison to match other existing code as proposed in review --- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 69d38b06c5..ae9ab86d3e 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -62,7 +62,7 @@ namespace osu.Game.Skinning decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; - if (legacyVersion > 1) + if (legacyVersion >= 2.0m) { this.MoveTo(new Vector2(0, -5)); this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); From 229fb518dc54b76c2c49dd62954ebd76381c075b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 14:09:05 +0900 Subject: [PATCH 24/43] Apply NRT to `LegacyJudgementPieceOld` --- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index ae9ab86d3e..082d0e4a67 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using osu.Framework.Allocation; using osu.Framework.Graphics; From 3a861fd94370f473b17caf7aa9e0899dd346788d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 14:28:21 +0900 Subject: [PATCH 25/43] Remove multiple cases of excess braces --- osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs index 918be7ff90..adf8c1a73c 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -23,21 +23,15 @@ namespace osu.Game.Rulesets.Edit.Checks int previewTime = context.Beatmap.BeatmapInfo.Metadata.PreviewTime; if (previewTime == -1) - { yield return new IssueTemplateHasNoPreviewTime(this).Create(); - } foreach (var diff in diffList) { if (diff.Equals(context.Beatmap.BeatmapInfo)) - { continue; - } if (diff.Metadata.PreviewTime != previewTime) - { yield return new IssueTemplatePreviewTimeConflict(this).Create(diff.DifficultyName, previewTime, diff.Metadata.PreviewTime); - } } } From c2cde8361a5a05a43e3da6261cffc0973869b9a6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 14:33:41 +0900 Subject: [PATCH 26/43] Fix message not reading well --- osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs index adf8c1a73c..fe5853a840 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -38,15 +38,15 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplatePreviewTimeConflict : IssueTemplate { public IssueTemplatePreviewTimeConflict(ICheck check) - : base(check, IssueType.Problem, "Audio preview time {1} doesn't match \"{0}\"'s preview time. {2}") + : base(check, IssueType.Problem, "Audio preview time ({1}) doesn't match the time specified in \"{0}\" ({2})") { } public Issue Create(string diffName, int originalTime, int conflictTime) => // preview time should show (not set) when it is not set. new Issue(this, diffName, - originalTime != -1 ? $"({originalTime:N0})" : "(not set)", - conflictTime != -1 ? $"({conflictTime:N0})" : "(not set)"); + originalTime != -1 ? $"{originalTime:N0} ms" : "not set", + conflictTime != -1 ? $"{conflictTime:N0} ms" : "not set"); } public class IssueTemplateHasNoPreviewTime : IssueTemplate From 175b9fc5c918a1a4601912dc3b7dcbe16a85f7b5 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Thu, 2 Feb 2023 08:34:38 +0300 Subject: [PATCH 27/43] Specify texelSize value in the Triangles background --- osu.Game/Graphics/Backgrounds/Triangles.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 6750d74a08..ca5f5d06d3 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -253,6 +253,7 @@ namespace osu.Game.Graphics.Backgrounds private class TrianglesDrawNode : DrawNode { private float fill = 1f; + private float texelSize = 0f; protected new Triangles Source => (Triangles)base.Source; @@ -296,6 +297,7 @@ namespace osu.Game.Graphics.Backgrounds shader.Bind(); shader.GetUniform("thickness").UpdateValue(ref fill); + shader.GetUniform("texelSize").UpdateValue(ref texelSize); foreach (TriangleParticle particle in parts) { From 5b3d7a8f266a9efc80b7f33c54f57084a002cdc7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 14:34:59 +0900 Subject: [PATCH 28/43] Fix typo in missing-preview-point message --- osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs index fe5853a840..d4f9c1feaf 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckPreviewTime.cs @@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplateHasNoPreviewTime : IssueTemplate { public IssueTemplateHasNoPreviewTime(ICheck check) - : base(check, IssueType.Problem, "A preview point for this map is not set. Consider settings one from the Timing menu.") + : base(check, IssueType.Problem, "A preview point for this map is not set. Consider setting one from the Timing menu.") { } From 659b78058f767f311fe0ce751910eb1ad4310e6b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 15:25:45 +0900 Subject: [PATCH 29/43] Move replay specific key bindings to their own section --- osu.Game/Input/Bindings/GlobalActionContainer.cs | 9 +++++++-- osu.Game/Localisation/InputSettingsStrings.cs | 5 +++++ .../Sections/Input/GlobalKeyBindingsSection.cs | 12 ++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/osu.Game/Input/Bindings/GlobalActionContainer.cs b/osu.Game/Input/Bindings/GlobalActionContainer.cs index 3826139716..9d14ce95cf 100644 --- a/osu.Game/Input/Bindings/GlobalActionContainer.cs +++ b/osu.Game/Input/Bindings/GlobalActionContainer.cs @@ -35,6 +35,7 @@ namespace osu.Game.Input.Bindings // It is used to decide the order of precedence, with the earlier items having higher precedence. public override IEnumerable DefaultKeyBindings => GlobalKeyBindings .Concat(EditorKeyBindings) + .Concat(ReplayKeyBindings) .Concat(InGameKeyBindings) .Concat(SongSelectKeyBindings) .Concat(AudioControlKeyBindings) @@ -112,12 +113,16 @@ namespace osu.Game.Input.Bindings new KeyBinding(new[] { InputKey.F4 }, GlobalAction.IncreaseScrollSpeed), new KeyBinding(new[] { InputKey.Shift, InputKey.Tab }, GlobalAction.ToggleInGameInterface), new KeyBinding(InputKey.MouseMiddle, GlobalAction.PauseGameplay), + new KeyBinding(InputKey.Control, GlobalAction.HoldForHUD), + new KeyBinding(InputKey.Tab, GlobalAction.ToggleChatFocus), + }; + + public IEnumerable ReplayKeyBindings => new[] + { new KeyBinding(InputKey.Space, GlobalAction.TogglePauseReplay), new KeyBinding(InputKey.MouseMiddle, GlobalAction.TogglePauseReplay), new KeyBinding(InputKey.Left, GlobalAction.SeekReplayBackward), new KeyBinding(InputKey.Right, GlobalAction.SeekReplayForward), - new KeyBinding(InputKey.Control, GlobalAction.HoldForHUD), - new KeyBinding(InputKey.Tab, GlobalAction.ToggleChatFocus), }; public IEnumerable SongSelectKeyBindings => new[] diff --git a/osu.Game/Localisation/InputSettingsStrings.cs b/osu.Game/Localisation/InputSettingsStrings.cs index a0da6cc2f7..2c9b175dfb 100644 --- a/osu.Game/Localisation/InputSettingsStrings.cs +++ b/osu.Game/Localisation/InputSettingsStrings.cs @@ -34,6 +34,11 @@ namespace osu.Game.Localisation /// public static LocalisableString InGameSection => new TranslatableString(getKey(@"in_game_section"), @"In Game"); + /// + /// "Replay" + /// + public static LocalisableString ReplaySection => new TranslatableString(getKey(@"replay_section"), @"Replay"); + /// /// "Audio" /// diff --git a/osu.Game/Overlays/Settings/Sections/Input/GlobalKeyBindingsSection.cs b/osu.Game/Overlays/Settings/Sections/Input/GlobalKeyBindingsSection.cs index 862bbbede0..291e9a93cf 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/GlobalKeyBindingsSection.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/GlobalKeyBindingsSection.cs @@ -25,6 +25,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input Add(new AudioControlKeyBindingsSubsection(manager)); Add(new SongSelectKeyBindingSubsection(manager)); Add(new InGameKeyBindingsSubsection(manager)); + Add(new ReplayKeyBindingsSubsection(manager)); Add(new EditorKeyBindingsSubsection(manager)); } @@ -72,6 +73,17 @@ namespace osu.Game.Overlays.Settings.Sections.Input } } + private partial class ReplayKeyBindingsSubsection : KeyBindingsSubsection + { + protected override LocalisableString Header => InputSettingsStrings.ReplaySection; + + public ReplayKeyBindingsSubsection(GlobalActionContainer manager) + : base(null) + { + Defaults = manager.ReplayKeyBindings; + } + } + private partial class AudioControlKeyBindingsSubsection : KeyBindingsSubsection { protected override LocalisableString Header => InputSettingsStrings.AudioSection; From 843d9914c49c8c98c93fb7e5e0716e443ac972ab Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 2 Feb 2023 08:18:56 +0000 Subject: [PATCH 30/43] quality: remove new line --- osu.Game/Localisation/JudgementCounterDisplayStrings.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Localisation/JudgementCounterDisplayStrings.cs b/osu.Game/Localisation/JudgementCounterDisplayStrings.cs index fbc22e96fd..aeba06b2e7 100644 --- a/osu.Game/Localisation/JudgementCounterDisplayStrings.cs +++ b/osu.Game/Localisation/JudgementCounterDisplayStrings.cs @@ -47,4 +47,3 @@ namespace osu.Game.Localisation private static string getKey(string key) => $"{prefix}:{key}"; } } - From 26efb8e8423ccc7e4aa559d2aea28090d4fc3b61 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 18:33:31 +0900 Subject: [PATCH 31/43] Replace white box legacy placeholder with something that visually fits --- .../SkinEditor/SkinBlueprintContainer.cs | 72 +++++++++++++++++-- 1 file changed, 67 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs b/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs index 9f99242fc5..a448b3d0c1 100644 --- a/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs +++ b/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs @@ -8,11 +8,15 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Events; -using osu.Framework.Screens; using osu.Framework.Testing; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Rulesets.Edit; -using osu.Game.Screens; using osu.Game.Screens.Edit.Compose.Components; using osu.Game.Skinning; using osuTK; @@ -45,9 +49,7 @@ namespace osu.Game.Overlays.SkinEditor if (targetContainers.Length == 0) { - string targetScreen = target.ChildrenOfType().LastOrDefault()?.GetType().Name ?? "this screen"; - - AddInternal(new ScreenWhiteBox.UnderConstructionMessage(targetScreen, "doesn't support skin customisation just yet.")); + AddInternal(new NonSkinnableScreenPlaceholder()); return; } @@ -158,5 +160,65 @@ namespace osu.Game.Overlays.SkinEditor foreach (var list in targetComponents) list.UnbindAll(); } + + public partial class NonSkinnableScreenPlaceholder : CompositeDrawable + { + [Resolved] + private SkinEditorOverlay? skinEditorOverlay { get; set; } + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + RelativeSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] + { + new Box + { + Colour = colourProvider.Dark6, + RelativeSizeAxes = Axes.Both, + Alpha = 0.95f, + }, + new FillFlowContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Spacing = new Vector2(0, 5), + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new SpriteIcon + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Icon = FontAwesome.Solid.ExclamationCircle, + Size = new Vector2(24), + Y = -5, + }, + new OsuTextFlowContainer(t => t.Font = OsuFont.Default.With(weight: FontWeight.SemiBold, size: 18)) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + TextAnchor = Anchor.Centre, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Text = "Please navigate to a skinnable screen using the scene library", + }, + new RoundedButton + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Width = 200, + Margin = new MarginPadding { Top = 20 }, + Action = () => skinEditorOverlay?.Hide(), + Text = "Return to game" + } + } + }, + }; + } + } } } From 9b6d95b3d6ff4c01e371fc0b8898ad14498c8d44 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 18:33:45 +0900 Subject: [PATCH 32/43] Adjust skin editor pop in/out to be more snappy --- osu.Game/Overlays/SkinEditor/SkinEditor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinEditor.cs b/osu.Game/Overlays/SkinEditor/SkinEditor.cs index ad89057d12..479a559643 100644 --- a/osu.Game/Overlays/SkinEditor/SkinEditor.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditor.cs @@ -33,7 +33,7 @@ namespace osu.Game.Overlays.SkinEditor [Cached(typeof(SkinEditor))] public partial class SkinEditor : VisibilityContainer, ICanAcceptFiles, IKeyBindingHandler { - public const double TRANSITION_DURATION = 500; + public const double TRANSITION_DURATION = 300; public const float MENU_HEIGHT = 40; @@ -361,7 +361,6 @@ namespace osu.Game.Overlays.SkinEditor { this // align animation to happen after the majority of the ScalingContainer animation completes. - .Delay(ScalingContainer.TRANSITION_DURATION * 0.3f) .FadeIn(TRANSITION_DURATION, Easing.OutQuint); } From 015f4f2b388a5de891f1fb58f6d3eb536e0dc8e1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 18:42:33 +0900 Subject: [PATCH 33/43] Avoid showing skin save message when changing scenes after making no changes --- osu.Game/Overlays/SkinEditor/SkinEditor.cs | 9 +++++---- .../Overlays/SkinEditor/SkinEditorOverlay.cs | 2 +- osu.Game/Skinning/SkinImporter.cs | 16 ++++++++++++++-- osu.Game/Skinning/SkinManager.cs | 8 ++++++-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinEditor.cs b/osu.Game/Overlays/SkinEditor/SkinEditor.cs index ad89057d12..4ef45b8df5 100644 --- a/osu.Game/Overlays/SkinEditor/SkinEditor.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditor.cs @@ -125,7 +125,7 @@ namespace osu.Game.Overlays.SkinEditor { Items = new[] { - new EditorMenuItem(Resources.Localisation.Web.CommonStrings.ButtonsSave, MenuItemType.Standard, Save), + new EditorMenuItem(Resources.Localisation.Web.CommonStrings.ButtonsSave, MenuItemType.Standard, () => Save()), new EditorMenuItem(CommonStrings.RevertToDefault, MenuItemType.Destructive, revert), new EditorMenuItemSpacer(), new EditorMenuItem(CommonStrings.Exit, MenuItemType.Standard, () => skinEditorOverlay?.Hide()), @@ -333,7 +333,7 @@ namespace osu.Game.Overlays.SkinEditor } } - public void Save() + public void Save(bool userTriggered = true) { if (!hasBegunMutating) return; @@ -343,8 +343,9 @@ namespace osu.Game.Overlays.SkinEditor foreach (var t in targetContainers) currentSkin.Value.UpdateDrawableTarget(t); - skins.Save(skins.CurrentSkin.Value); - onScreenDisplay?.Display(new SkinEditorToast(ToastStrings.SkinSaved, currentSkin.Value.SkinInfo.ToString() ?? "Unknown")); + // In the case the save was user triggered, always show the save message to make them feel confident. + if (skins.Save(skins.CurrentSkin.Value) || userTriggered) + onScreenDisplay?.Display(new SkinEditorToast(ToastStrings.SkinSaved, currentSkin.Value.SkinInfo.ToString() ?? "Unknown")); } protected override bool OnHover(HoverEvent e) => true; diff --git a/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs index 4eff87c5f4..b8da3e3f67 100644 --- a/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs @@ -147,7 +147,7 @@ namespace osu.Game.Overlays.SkinEditor if (skinEditor == null) return; - skinEditor.Save(); + skinEditor.Save(false); // ensure the toolbar is re-hidden even if a new screen decides to try and show it. updateComponentVisibility(); diff --git a/osu.Game/Skinning/SkinImporter.cs b/osu.Game/Skinning/SkinImporter.cs index 1685562cc7..7485a89404 100644 --- a/osu.Game/Skinning/SkinImporter.cs +++ b/osu.Game/Skinning/SkinImporter.cs @@ -179,8 +179,14 @@ namespace osu.Game.Skinning private Skin createInstance(SkinInfo item) => item.CreateInstance(skinResources); - public void Save(Skin skin) + /// + /// Save a skin. Updates any drawable layouts that are out of date. + /// + /// Whether any change actually occurred. + public bool Save(Skin skin) { + bool hadChanges = false; + skin.SkinInfo.PerformWrite(s => { // Update for safety @@ -212,8 +218,14 @@ namespace osu.Game.Skinning } } - s.Hash = ComputeHash(s); + string newHash = ComputeHash(s); + + hadChanges = newHash != s.Hash; + + s.Hash = newHash; }); + + return hadChanges; } } } diff --git a/osu.Game/Skinning/SkinManager.cs b/osu.Game/Skinning/SkinManager.cs index a4cf83b32e..70173d9c2a 100644 --- a/osu.Game/Skinning/SkinManager.cs +++ b/osu.Game/Skinning/SkinManager.cs @@ -192,12 +192,16 @@ namespace osu.Game.Skinning }); } - public void Save(Skin skin) + /// + /// Save a skin. Updates any drawable layouts that are out of date. + /// + /// Whether any change actually occurred. + public bool Save(Skin skin) { if (!skin.SkinInfo.IsManaged) throw new InvalidOperationException($"Attempting to save a skin which is not yet tracked. Call {nameof(EnsureMutableSkin)} first."); - skinImporter.Save(skin); + return skinImporter.Save(skin); } /// From f7fa9e3927c7ad65bc631aa7242febb04ffbc823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 2 Feb 2023 18:41:35 +0100 Subject: [PATCH 34/43] Remove outdated comment --- osu.Game/Overlays/SkinEditor/SkinEditor.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinEditor.cs b/osu.Game/Overlays/SkinEditor/SkinEditor.cs index 479a559643..275cbd18d7 100644 --- a/osu.Game/Overlays/SkinEditor/SkinEditor.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditor.cs @@ -359,9 +359,7 @@ namespace osu.Game.Overlays.SkinEditor protected override void PopIn() { - this - // align animation to happen after the majority of the ScalingContainer animation completes. - .FadeIn(TRANSITION_DURATION, Easing.OutQuint); + this.FadeIn(TRANSITION_DURATION, Easing.OutQuint); } protected override void PopOut() From 9c954a93e322095781571638e94beb21e9b710b2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 15:18:01 +0900 Subject: [PATCH 35/43] Update `Save` method xmldoc to make more sense --- osu.Game/Skinning/SkinImporter.cs | 2 +- osu.Game/Skinning/SkinManager.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/SkinImporter.cs b/osu.Game/Skinning/SkinImporter.cs index 7485a89404..8ce265719c 100644 --- a/osu.Game/Skinning/SkinImporter.cs +++ b/osu.Game/Skinning/SkinImporter.cs @@ -180,7 +180,7 @@ namespace osu.Game.Skinning private Skin createInstance(SkinInfo item) => item.CreateInstance(skinResources); /// - /// Save a skin. Updates any drawable layouts that are out of date. + /// Save a skin, serialising any changes to skin layouts to relevant JSON structures. /// /// Whether any change actually occurred. public bool Save(Skin skin) diff --git a/osu.Game/Skinning/SkinManager.cs b/osu.Game/Skinning/SkinManager.cs index 70173d9c2a..fca7dc0f5e 100644 --- a/osu.Game/Skinning/SkinManager.cs +++ b/osu.Game/Skinning/SkinManager.cs @@ -193,7 +193,7 @@ namespace osu.Game.Skinning } /// - /// Save a skin. Updates any drawable layouts that are out of date. + /// Save a skin, serialising any changes to skin layouts to relevant JSON structures. /// /// Whether any change actually occurred. public bool Save(Skin skin) From 5ca5f04794791bc1e7b79b7d1ee7ae42dd4d74ce Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 15:18:40 +0900 Subject: [PATCH 36/43] Add parameter hint for optional `bool` value --- osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs index b8da3e3f67..c87e60e47f 100644 --- a/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs @@ -147,7 +147,7 @@ namespace osu.Game.Overlays.SkinEditor if (skinEditor == null) return; - skinEditor.Save(false); + skinEditor.Save(userTriggered: false); // ensure the toolbar is re-hidden even if a new screen decides to try and show it. updateComponentVisibility(); From 50559643bbb4f104fda7e7a577afbf26b755bdb3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 15:27:11 +0900 Subject: [PATCH 37/43] Fix incorrectly applied enum localisation --- osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs index 3507987fe4..f380165a66 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs @@ -507,7 +507,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesIcons))] Icons, - [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesIcons))] + [LocalisableDescription(typeof(BarHitErrorMeterStrings), nameof(BarHitErrorMeterStrings.LabelStylesText))] Text } } From cf8cfe0d2c7678f316faddc77eaff5d787bce6c6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 15:34:57 +0900 Subject: [PATCH 38/43] Move skin component localisations to namespaces --- osu.Game/Localisation/{ => HUD}/BarHitErrorMeterStrings.cs | 4 ++-- osu.Game/Localisation/{ => HUD}/ColourHitErrorMeterStrings.cs | 4 ++-- .../Localisation/{ => HUD}/GameplayAccuracyCounterStrings.cs | 4 ++-- .../Localisation/{ => HUD}/JudgementCounterDisplayStrings.cs | 4 ++-- osu.Game/Localisation/{ => HUD}/SongProgressStrings.cs | 4 ++-- .../{ => SkinComponents}/BeatmapAttributeTextStrings.cs | 4 ++-- .../FontAdjustableSkinComponentStrings.cs | 4 ++-- .../{ => SkinComponents}/SkinnableSpriteStrings.cs | 4 ++-- .../Localisation/{ => SkinComponents}/TextElementStrings.cs | 4 ++-- osu.Game/Screens/Play/HUD/ArgonSongProgress.cs | 2 +- osu.Game/Screens/Play/HUD/DefaultSongProgress.cs | 2 +- osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs | 2 +- osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs | 2 +- .../Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs | 2 +- .../Play/HUD/JudgementCounter/JudgementCounterDisplay.cs | 2 +- osu.Game/Skinning/Components/BeatmapAttributeText.cs | 1 + osu.Game/Skinning/Components/TextElement.cs | 2 +- osu.Game/Skinning/FontAdjustableSkinComponent.cs | 2 +- osu.Game/Skinning/SkinnableSprite.cs | 2 +- 19 files changed, 28 insertions(+), 27 deletions(-) rename osu.Game/Localisation/{ => HUD}/BarHitErrorMeterStrings.cs (98%) rename osu.Game/Localisation/{ => HUD}/ColourHitErrorMeterStrings.cs (97%) rename osu.Game/Localisation/{ => HUD}/GameplayAccuracyCounterStrings.cs (95%) rename osu.Game/Localisation/{ => HUD}/JudgementCounterDisplayStrings.cs (96%) rename osu.Game/Localisation/{ => HUD}/SongProgressStrings.cs (93%) rename osu.Game/Localisation/{ => SkinComponents}/BeatmapAttributeTextStrings.cs (93%) rename osu.Game/Localisation/{ => SkinComponents}/FontAdjustableSkinComponentStrings.cs (88%) rename osu.Game/Localisation/{ => SkinComponents}/SkinnableSpriteStrings.cs (90%) rename osu.Game/Localisation/{ => SkinComponents}/TextElementStrings.cs (90%) diff --git a/osu.Game/Localisation/BarHitErrorMeterStrings.cs b/osu.Game/Localisation/HUD/BarHitErrorMeterStrings.cs similarity index 98% rename from osu.Game/Localisation/BarHitErrorMeterStrings.cs rename to osu.Game/Localisation/HUD/BarHitErrorMeterStrings.cs index 171c3e223e..2f77a287a0 100644 --- a/osu.Game/Localisation/BarHitErrorMeterStrings.cs +++ b/osu.Game/Localisation/HUD/BarHitErrorMeterStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.HUD { public static class BarHitErrorMeterStrings { - private const string prefix = @"osu.Game.Resources.Localisation.BarHitErrorMeter"; + private const string prefix = @"osu.Game.Resources.Localisation.HUD.BarHitErrorMeter"; /// /// "Judgement line thickness" diff --git a/osu.Game/Localisation/ColourHitErrorMeterStrings.cs b/osu.Game/Localisation/HUD/ColourHitErrorMeterStrings.cs similarity index 97% rename from osu.Game/Localisation/ColourHitErrorMeterStrings.cs rename to osu.Game/Localisation/HUD/ColourHitErrorMeterStrings.cs index 13682c9c85..8fdcb34a49 100644 --- a/osu.Game/Localisation/ColourHitErrorMeterStrings.cs +++ b/osu.Game/Localisation/HUD/ColourHitErrorMeterStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.HUD { public static class ColourHitErrorMeterStrings { - private const string prefix = @"osu.Game.Resources.Localisation.ColourHitError"; + private const string prefix = @"osu.Game.Resources.Localisation.HUD.ColourHitError"; /// /// "Judgement count" diff --git a/osu.Game/Localisation/GameplayAccuracyCounterStrings.cs b/osu.Game/Localisation/HUD/GameplayAccuracyCounterStrings.cs similarity index 95% rename from osu.Game/Localisation/GameplayAccuracyCounterStrings.cs rename to osu.Game/Localisation/HUD/GameplayAccuracyCounterStrings.cs index c9e936d8af..ec7f4a1af3 100644 --- a/osu.Game/Localisation/GameplayAccuracyCounterStrings.cs +++ b/osu.Game/Localisation/HUD/GameplayAccuracyCounterStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.HUD { public static class GameplayAccuracyCounterStrings { - private const string prefix = @"osu.Game.Resources.Localisation.GameplayAccuracyCounter"; + private const string prefix = @"osu.Game.Resources.Localisation.HUD.GameplayAccuracyCounter"; /// /// "Accuracy display mode" diff --git a/osu.Game/Localisation/JudgementCounterDisplayStrings.cs b/osu.Game/Localisation/HUD/JudgementCounterDisplayStrings.cs similarity index 96% rename from osu.Game/Localisation/JudgementCounterDisplayStrings.cs rename to osu.Game/Localisation/HUD/JudgementCounterDisplayStrings.cs index aeba06b2e7..b1c756e48e 100644 --- a/osu.Game/Localisation/JudgementCounterDisplayStrings.cs +++ b/osu.Game/Localisation/HUD/JudgementCounterDisplayStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.HUD { public static class JudgementCounterDisplayStrings { - private const string prefix = @"osu.Game.Resources.Localisation.JudgementCounterDisplay"; + private const string prefix = @"osu.Game.Resources.Localisation.HUD.JudgementCounterDisplay"; /// /// "Display mode" diff --git a/osu.Game/Localisation/SongProgressStrings.cs b/osu.Game/Localisation/HUD/SongProgressStrings.cs similarity index 93% rename from osu.Game/Localisation/SongProgressStrings.cs rename to osu.Game/Localisation/HUD/SongProgressStrings.cs index 033560ebb0..4c621e8e8c 100644 --- a/osu.Game/Localisation/SongProgressStrings.cs +++ b/osu.Game/Localisation/HUD/SongProgressStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.HUD { public static class SongProgressStrings { - private const string prefix = @"osu.Game.Resources.Localisation.SongProgress"; + private const string prefix = @"osu.Game.Resources.Localisation.HUD.SongProgress"; /// /// "Show difficulty graph" diff --git a/osu.Game/Localisation/BeatmapAttributeTextStrings.cs b/osu.Game/Localisation/SkinComponents/BeatmapAttributeTextStrings.cs similarity index 93% rename from osu.Game/Localisation/BeatmapAttributeTextStrings.cs rename to osu.Game/Localisation/SkinComponents/BeatmapAttributeTextStrings.cs index 1ceb482cf4..b2e2285faf 100644 --- a/osu.Game/Localisation/BeatmapAttributeTextStrings.cs +++ b/osu.Game/Localisation/SkinComponents/BeatmapAttributeTextStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.SkinComponents { public static class BeatmapAttributeTextStrings { - private const string prefix = @"osu.Game.Resources.Localisation.BeatmapAttributeText"; + private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.BeatmapAttributeText"; /// /// "Attribute" diff --git a/osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs b/osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs similarity index 88% rename from osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs rename to osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs index 76f9f2f8b9..8bcc45998a 100644 --- a/osu.Game/Localisation/FontAdjustableSkinComponentStrings.cs +++ b/osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.SkinComponents { public static class FontAdjustableSkinComponentStrings { - private const string prefix = @"osu.Game.Resources.Localisation.FontAdjustableSkinComponent"; + private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.FontAdjustableSkinComponent"; /// /// "Font" diff --git a/osu.Game/Localisation/SkinnableSpriteStrings.cs b/osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs similarity index 90% rename from osu.Game/Localisation/SkinnableSpriteStrings.cs rename to osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs index 6192f5e43d..f039c9044f 100644 --- a/osu.Game/Localisation/SkinnableSpriteStrings.cs +++ b/osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.SkinComponents { public static class SkinnableSpriteStrings { - private const string prefix = @"osu.Game.Resources.Localisation.SkinnableSprite"; + private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.SkinnableSprite"; /// /// "Sprite name" diff --git a/osu.Game/Localisation/TextElementStrings.cs b/osu.Game/Localisation/SkinComponents/TextElementStrings.cs similarity index 90% rename from osu.Game/Localisation/TextElementStrings.cs rename to osu.Game/Localisation/SkinComponents/TextElementStrings.cs index 6257b80d72..6417c1d923 100644 --- a/osu.Game/Localisation/TextElementStrings.cs +++ b/osu.Game/Localisation/SkinComponents/TextElementStrings.cs @@ -3,11 +3,11 @@ using osu.Framework.Localisation; -namespace osu.Game.Localisation +namespace osu.Game.Localisation.SkinComponents { public static class TextElementStrings { - private const string prefix = @"osu.Game.Resources.Localisation.TextElement"; + private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.TextElement"; /// /// "Text" diff --git a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs index 6c5ba52f27..9dce8996c3 100644 --- a/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/ArgonSongProgress.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Objects; namespace osu.Game.Screens.Play.HUD diff --git a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs index fccefd49a4..6eed563703 100644 --- a/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs +++ b/osu.Game/Screens/Play/HUD/DefaultSongProgress.cs @@ -7,7 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Objects; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs index 3a7c97632d..9da032e489 100644 --- a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs +++ b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs @@ -6,7 +6,7 @@ using osu.Framework.Bindables; using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Play.HUD diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs index f380165a66..eb5221aa45 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs @@ -17,7 +17,7 @@ using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs index ac49e9ca5e..5793713fca 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs @@ -11,7 +11,7 @@ using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Shapes; using osu.Framework.Localisation; using osu.Game.Configuration; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osuTK; diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs index 31b0b9ebc5..80d2e0863f 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Localisation; using osu.Game.Configuration; -using osu.Game.Localisation; +using osu.Game.Localisation.HUD; using osu.Game.Rulesets.Scoring; using osu.Game.Skinning; using osuTK; diff --git a/osu.Game/Skinning/Components/BeatmapAttributeText.cs b/osu.Game/Skinning/Components/BeatmapAttributeText.cs index e8b2d547a9..2c16a67cac 100644 --- a/osu.Game/Skinning/Components/BeatmapAttributeText.cs +++ b/osu.Game/Skinning/Components/BeatmapAttributeText.cs @@ -18,6 +18,7 @@ using osu.Game.Configuration; using osu.Game.Extensions; using osu.Game.Graphics.Sprites; using osu.Game.Localisation; +using osu.Game.Localisation.SkinComponents; using osu.Game.Resources.Localisation.Web; namespace osu.Game.Skinning.Components diff --git a/osu.Game/Skinning/Components/TextElement.cs b/osu.Game/Skinning/Components/TextElement.cs index c160f3f9d0..1e0a0d0ad1 100644 --- a/osu.Game/Skinning/Components/TextElement.cs +++ b/osu.Game/Skinning/Components/TextElement.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation; +using osu.Game.Localisation.SkinComponents; namespace osu.Game.Skinning.Components { diff --git a/osu.Game/Skinning/FontAdjustableSkinComponent.cs b/osu.Game/Skinning/FontAdjustableSkinComponent.cs index 9c28621d48..11d3e36d9e 100644 --- a/osu.Game/Skinning/FontAdjustableSkinComponent.cs +++ b/osu.Game/Skinning/FontAdjustableSkinComponent.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Configuration; using osu.Game.Graphics; -using osu.Game.Localisation; +using osu.Game.Localisation.SkinComponents; namespace osu.Game.Skinning { diff --git a/osu.Game/Skinning/SkinnableSprite.cs b/osu.Game/Skinning/SkinnableSprite.cs index 3deb264bc8..31391755a3 100644 --- a/osu.Game/Skinning/SkinnableSprite.cs +++ b/osu.Game/Skinning/SkinnableSprite.cs @@ -12,7 +12,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; -using osu.Game.Localisation; +using osu.Game.Localisation.SkinComponents; using osu.Game.Overlays.Settings; using osuTK; From 92306b912329aec3fdb74a2cf88822b42bf54537 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 16:02:16 +0900 Subject: [PATCH 39/43] Combine localisations for abstract skinnable components into a single file Generally we don't want localisation files with only one to two translations. It makes it harder for translators to handle in crowdin (a lot of file changes for small results). So for cases like this I believe we should be grouping translations where it makes sense. I've left individual components in their own files as I can see potential for more settings to be added in the future. Plus it gives a bit of extra context. --- .../FontAdjustableSkinComponentStrings.cs | 24 ---------- .../SkinnableComponentStrings.cs | 44 +++++++++++++++++++ .../SkinComponents/SkinnableSpriteStrings.cs | 24 ---------- .../SkinComponents/TextElementStrings.cs | 24 ---------- osu.Game/Skinning/Components/TextElement.cs | 2 +- .../Skinning/FontAdjustableSkinComponent.cs | 2 +- osu.Game/Skinning/SkinnableSprite.cs | 2 +- 7 files changed, 47 insertions(+), 75 deletions(-) delete mode 100644 osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs create mode 100644 osu.Game/Localisation/SkinComponents/SkinnableComponentStrings.cs delete mode 100644 osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs delete mode 100644 osu.Game/Localisation/SkinComponents/TextElementStrings.cs diff --git a/osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs b/osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs deleted file mode 100644 index 8bcc45998a..0000000000 --- a/osu.Game/Localisation/SkinComponents/FontAdjustableSkinComponentStrings.cs +++ /dev/null @@ -1,24 +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.Localisation; - -namespace osu.Game.Localisation.SkinComponents -{ - public static class FontAdjustableSkinComponentStrings - { - private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.FontAdjustableSkinComponent"; - - /// - /// "Font" - /// - public static LocalisableString Font => new TranslatableString(getKey(@"font"), "Font"); - - /// - /// "The font to use." - /// - public static LocalisableString FontDescription => new TranslatableString(getKey(@"font_description"), "The font to use."); - - private static string getKey(string key) => $"{prefix}:{key}"; - } -} diff --git a/osu.Game/Localisation/SkinComponents/SkinnableComponentStrings.cs b/osu.Game/Localisation/SkinComponents/SkinnableComponentStrings.cs new file mode 100644 index 0000000000..547df86fc7 --- /dev/null +++ b/osu.Game/Localisation/SkinComponents/SkinnableComponentStrings.cs @@ -0,0 +1,44 @@ +// 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.Localisation; + +namespace osu.Game.Localisation.SkinComponents +{ + public static class SkinnableComponentStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.SkinnableComponentStrings"; + + /// + /// "Sprite name" + /// + public static LocalisableString SpriteName => new TranslatableString(getKey(@"sprite_name"), "Sprite name"); + + /// + /// "The filename of the sprite" + /// + public static LocalisableString SpriteNameDescription => new TranslatableString(getKey(@"sprite_name_description"), "The filename of the sprite"); + + /// + /// "Font" + /// + public static LocalisableString Font => new TranslatableString(getKey(@"font"), "Font"); + + /// + /// "The font to use." + /// + public static LocalisableString FontDescription => new TranslatableString(getKey(@"font_description"), "The font to use."); + + /// + /// "Text" + /// + public static LocalisableString TextElementText => new TranslatableString(getKey(@"text_element_text"), "Text"); + + /// + /// "The text to be displayed." + /// + public static LocalisableString TextElementTextDescription => new TranslatableString(getKey(@"text_element_text_description"), "The text to be displayed."); + + private static string getKey(string key) => $"{prefix}:{key}"; + } +} diff --git a/osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs b/osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs deleted file mode 100644 index f039c9044f..0000000000 --- a/osu.Game/Localisation/SkinComponents/SkinnableSpriteStrings.cs +++ /dev/null @@ -1,24 +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.Localisation; - -namespace osu.Game.Localisation.SkinComponents -{ - public static class SkinnableSpriteStrings - { - private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.SkinnableSprite"; - - /// - /// "Sprite name" - /// - public static LocalisableString SpriteName => new TranslatableString(getKey(@"sprite_name"), "Sprite name"); - - /// - /// "The filename of the sprite" - /// - public static LocalisableString SpriteNameDescription => new TranslatableString(getKey(@"sprite_name_description"), "The filename of the sprite"); - - private static string getKey(string key) => $"{prefix}:{key}"; - } -} diff --git a/osu.Game/Localisation/SkinComponents/TextElementStrings.cs b/osu.Game/Localisation/SkinComponents/TextElementStrings.cs deleted file mode 100644 index 6417c1d923..0000000000 --- a/osu.Game/Localisation/SkinComponents/TextElementStrings.cs +++ /dev/null @@ -1,24 +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.Localisation; - -namespace osu.Game.Localisation.SkinComponents -{ - public static class TextElementStrings - { - private const string prefix = @"osu.Game.Resources.Localisation.SkinComponents.TextElement"; - - /// - /// "Text" - /// - public static LocalisableString TextElementText => new TranslatableString(getKey(@"text_element_text"), "Text"); - - /// - /// "The text to be displayed." - /// - public static LocalisableString TextElementTextDescription => new TranslatableString(getKey(@"text_element_text_description"), "The text to be displayed."); - - private static string getKey(string key) => $"{prefix}:{key}"; - } -} diff --git a/osu.Game/Skinning/Components/TextElement.cs b/osu.Game/Skinning/Components/TextElement.cs index 1e0a0d0ad1..936f6a529b 100644 --- a/osu.Game/Skinning/Components/TextElement.cs +++ b/osu.Game/Skinning/Components/TextElement.cs @@ -15,7 +15,7 @@ namespace osu.Game.Skinning.Components [UsedImplicitly] public partial class TextElement : FontAdjustableSkinComponent { - [SettingSource(typeof(TextElementStrings), nameof(TextElementStrings.TextElementText), nameof(TextElementStrings.TextElementTextDescription))] + [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.TextElementText), nameof(SkinnableComponentStrings.TextElementTextDescription))] public Bindable Text { get; } = new Bindable("Circles!"); private readonly OsuSpriteText text; diff --git a/osu.Game/Skinning/FontAdjustableSkinComponent.cs b/osu.Game/Skinning/FontAdjustableSkinComponent.cs index 11d3e36d9e..2e41b35abb 100644 --- a/osu.Game/Skinning/FontAdjustableSkinComponent.cs +++ b/osu.Game/Skinning/FontAdjustableSkinComponent.cs @@ -17,7 +17,7 @@ namespace osu.Game.Skinning { public bool UsesFixedAnchor { get; set; } - [SettingSource(typeof(FontAdjustableSkinComponentStrings), nameof(FontAdjustableSkinComponentStrings.Font), nameof(FontAdjustableSkinComponentStrings.FontDescription))] + [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.Font), nameof(SkinnableComponentStrings.FontDescription))] public Bindable Font { get; } = new Bindable(Typeface.Torus); /// diff --git a/osu.Game/Skinning/SkinnableSprite.cs b/osu.Game/Skinning/SkinnableSprite.cs index 31391755a3..c3449562c3 100644 --- a/osu.Game/Skinning/SkinnableSprite.cs +++ b/osu.Game/Skinning/SkinnableSprite.cs @@ -28,7 +28,7 @@ namespace osu.Game.Skinning [Resolved] private TextureStore textures { get; set; } = null!; - [SettingSource(typeof(SkinnableSpriteStrings), nameof(SkinnableSpriteStrings.SpriteName), nameof(SkinnableSpriteStrings.SpriteNameDescription), SettingControlType = typeof(SpriteSelectorControl))] + [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.SpriteName), nameof(SkinnableComponentStrings.SpriteNameDescription), SettingControlType = typeof(SpriteSelectorControl))] public Bindable SpriteName { get; } = new Bindable(string.Empty); [Resolved] From 14524237acb85e77c8253484d4c78c3adf5b6340 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Fri, 3 Feb 2023 10:32:41 +0300 Subject: [PATCH 40/43] Add comment explaining texelSize value --- osu.Game/Graphics/Backgrounds/Triangles.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index ca5f5d06d3..598278b2e4 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -253,7 +253,6 @@ namespace osu.Game.Graphics.Backgrounds private class TrianglesDrawNode : DrawNode { private float fill = 1f; - private float texelSize = 0f; protected new Triangles Source => (Triangles)base.Source; @@ -295,6 +294,11 @@ namespace osu.Game.Graphics.Backgrounds vertexBatch = renderer.CreateQuadBatch(Source.AimCount, 1); } + //Due to triangles having various sizes we would need to set a different "texelSize" value for each of them, which is insanely expensive, thus we should use one single value. + //texelSize computed for an average triangle (size 100) will result in big triangles becoming blurry, so we may just use 0 for all of them. + //But we still need to specify at least something, because otherwise other shader usages will override this value. + float texelSize = 0f; + shader.Bind(); shader.GetUniform("thickness").UpdateValue(ref fill); shader.GetUniform("texelSize").UpdateValue(ref texelSize); From 7b9239088bca1678a33227ac161f7c2a16cd098d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 16:40:16 +0900 Subject: [PATCH 41/43] Comment space addition --- osu.Game/Graphics/Backgrounds/Triangles.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 598278b2e4..68ece56d8a 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -294,9 +294,9 @@ namespace osu.Game.Graphics.Backgrounds vertexBatch = renderer.CreateQuadBatch(Source.AimCount, 1); } - //Due to triangles having various sizes we would need to set a different "texelSize" value for each of them, which is insanely expensive, thus we should use one single value. - //texelSize computed for an average triangle (size 100) will result in big triangles becoming blurry, so we may just use 0 for all of them. - //But we still need to specify at least something, because otherwise other shader usages will override this value. + // Due to triangles having various sizes we would need to set a different "texelSize" value for each of them, which is insanely expensive, thus we should use one single value. + // texelSize computed for an average triangle (size 100) will result in big triangles becoming blurry, so we may just use 0 for all of them. + // But we still need to specify at least something, because otherwise other shader usages will override this value. float texelSize = 0f; shader.Bind(); From 60ccf35125a5f95b5f6c5b6a973a336fcec07a9d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 16:44:53 +0900 Subject: [PATCH 42/43] Update resources --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index d4ea0abbb5..cdb3d9b66b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -36,7 +36,7 @@ - + From b19047b90b9847e58cd2c98a9653aab908474dc9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Feb 2023 16:55:51 +0900 Subject: [PATCH 43/43] Fix skin editor component list having uneven padding --- osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs | 2 +- osu.Game/Screens/Edit/Components/EditorSidebar.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs b/osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs index 6017a98944..a8d64c1de8 100644 --- a/osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs +++ b/osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs @@ -40,7 +40,7 @@ namespace osu.Game.Overlays.SkinEditor RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, - Spacing = new Vector2(2) + Spacing = new Vector2(EditorSidebar.PADDING) }; reloadComponents(); diff --git a/osu.Game/Screens/Edit/Components/EditorSidebar.cs b/osu.Game/Screens/Edit/Components/EditorSidebar.cs index 9a8c5115dd..24e21ceafe 100644 --- a/osu.Game/Screens/Edit/Components/EditorSidebar.cs +++ b/osu.Game/Screens/Edit/Components/EditorSidebar.cs @@ -18,6 +18,8 @@ namespace osu.Game.Screens.Edit.Components { public const float WIDTH = 250; + public const float PADDING = 3; + private readonly Box background; protected override Container Content { get; } @@ -35,13 +37,13 @@ namespace osu.Game.Screens.Edit.Components }, new OsuScrollContainer { - Padding = new MarginPadding { Left = 20 }, ScrollbarOverlapsContent = false, RelativeSizeAxes = Axes.Both, Child = Content = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, + Padding = new MarginPadding(PADDING), Direction = FillDirection.Vertical, }, }