diff --git a/PerformanceCalculatorGUI/APIManager.cs b/PerformanceCalculatorGUI/APIManager.cs index e2ec077..65aec67 100644 --- a/PerformanceCalculatorGUI/APIManager.cs +++ b/PerformanceCalculatorGUI/APIManager.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Diagnostics; using System.Globalization; using System.Net.Http; using System.Threading.Tasks; @@ -33,7 +34,10 @@ namespace PerformanceCalculatorGUI public async Task GetJsonFromApi(string request) { if (token == null) + { await getAccessToken(); + Debug.Assert(token != null); + } using var req = new JsonWebRequest($"{ENDPOINT_CONFIGURATION.APIEndpointUrl}/api/v2/{request}"); req.AddHeader("x-api-version", api_version.ToString(CultureInfo.InvariantCulture)); diff --git a/PerformanceCalculatorGUI/Components/ScreenSelectionButton.cs b/PerformanceCalculatorGUI/Components/ScreenSelectionButton.cs index 8319287..7076605 100644 --- a/PerformanceCalculatorGUI/Components/ScreenSelectionButton.cs +++ b/PerformanceCalculatorGUI/Components/ScreenSelectionButton.cs @@ -2,24 +2,12 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics.Sprites; -using osu.Framework.Localisation; -using osu.Game.Beatmaps.Drawables.Cards; using osu.Game.Input.Bindings; using osu.Game.Overlays.Toolbar; using osuTK; namespace PerformanceCalculatorGUI.Components { - public class ScreenSelectionButtonIcon : IconPill - { - public ScreenSelectionButtonIcon(IconUsage? icon = null) - : base(icon ?? FontAwesome.Solid.List) - { - } - - public override LocalisableString TooltipText => string.Empty; - } - internal class ScreenSelectionButton : ToolbarButton { public ScreenSelectionButton(string title, IconUsage? icon = null, GlobalAction? hotkey = null) diff --git a/PerformanceCalculatorGUI/Components/ScreenSelectionButtonIcon.cs b/PerformanceCalculatorGUI/Components/ScreenSelectionButtonIcon.cs new file mode 100644 index 0000000..8032a9e --- /dev/null +++ b/PerformanceCalculatorGUI/Components/ScreenSelectionButtonIcon.cs @@ -0,0 +1,18 @@ +// 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.Graphics.Sprites; +using osu.Framework.Localisation; +using osu.Game.Beatmaps.Drawables.Cards; + +namespace PerformanceCalculatorGUI.Components; + +public class ScreenSelectionButtonIcon : IconPill +{ + public ScreenSelectionButtonIcon(IconUsage? icon = null) + : base(icon ?? FontAwesome.Solid.List) + { + } + + public override LocalisableString TooltipText => string.Empty; +} diff --git a/PerformanceCalculatorGUI/ExtendedDifficultyCalculator.cs b/PerformanceCalculatorGUI/ExtendedDifficultyCalculator.cs index dcb3627..1931ebe 100644 --- a/PerformanceCalculatorGUI/ExtendedDifficultyCalculator.cs +++ b/PerformanceCalculatorGUI/ExtendedDifficultyCalculator.cs @@ -15,12 +15,6 @@ using osu.Game.Rulesets.Taiko.Difficulty; namespace PerformanceCalculatorGUI { - public interface IExtendedDifficultyCalculator - { - Skill[] GetSkills(); - DifficultyHitObject[] GetDifficultyHitObjects(IBeatmap beatmap, double clockRate); - } - public class ExtendedOsuDifficultyCalculator : OsuDifficultyCalculator, IExtendedDifficultyCalculator { private Skill[] skills; diff --git a/PerformanceCalculatorGUI/IExtendedDifficultyCalculator.cs b/PerformanceCalculatorGUI/IExtendedDifficultyCalculator.cs new file mode 100644 index 0000000..5671a0b --- /dev/null +++ b/PerformanceCalculatorGUI/IExtendedDifficultyCalculator.cs @@ -0,0 +1,14 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Difficulty.Preprocessing; +using osu.Game.Rulesets.Difficulty.Skills; + +namespace PerformanceCalculatorGUI; + +public interface IExtendedDifficultyCalculator +{ + Skill[] GetSkills(); + DifficultyHitObject[] GetDifficultyHitObjects(IBeatmap beatmap, double clockRate); +}