Skip to content

Commit

Permalink
(Hopefully) Fix Code QA
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-nyan committed Jun 29, 2024
1 parent 503168b commit 3702cf8
Show file tree
Hide file tree
Showing 13 changed files with 726 additions and 594 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public GenshinSettings(IGameVersionCheck GameVersionManager)
InitializeSettings();
}

public override void InitializeSettings()
public sealed override void InitializeSettings()
{
// Load Settings
base.InitializeSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace CollapseLauncher.GameSettings.Honkai
{
internal class HonkaiSettings : SettingsBase, IGameSettingsUniversal
internal class HonkaiSettings : SettingsBase
{
#region PresetProperties
public Preset<PersonalGraphicsSettingV2, HonkaiSettingsJSONContext> Preset_SettingsGraphics { get; set; }
Expand All @@ -27,7 +27,7 @@ public HonkaiSettings(IGameVersionCheck GameVersionManager)
InitializeSettings();
}

public override void InitializeSettings()
public sealed override void InitializeSettings()
{
// Load Settings
SettingsGraphics = PersonalGraphicsSettingV2.Load();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using CollapseLauncher.GameSettings.Base;
using CollapseLauncher.Interfaces;
// ReSharper disable CheckNamespace

namespace CollapseLauncher.GameSettings.StarRail
{
internal class StarRailSettings : SettingsBase, IGameSettings, IGameSettingsUniversal
internal class StarRailSettings : SettingsBase
{
public Model GraphicsSettings { get; set; }
public BGMVolume AudioSettings_BGM { get; set; }
Expand All @@ -20,7 +21,7 @@ public StarRailSettings(IGameVersionCheck GameVersionManager)
InitializeSettings();
}

public override void InitializeSettings()
public sealed override void InitializeSettings()
{
// Load Settings required for MainPage
base.InitializeSettings();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using CollapseLauncher.Interfaces;
using Microsoft.UI.Xaml;

namespace CollapseLauncher.GameVersioning
{
internal class GameTypeZenlessVersion : GameVersionBase, IGameVersionCheck
internal sealed class GameTypeZenlessVersion : GameVersionBase
{
#region Properties
#endregion
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ protected virtual async Task LoadLauncherGameResource(ActionOnTimeOutRetry? onTi
EnsureResourceUrlNotNull();

ActionTimeoutValueTaskCallback<RegionResourceProp?> launcherGameResourceCallback =
new ActionTimeoutValueTaskCallback<RegionResourceProp?>(async (innerToken) =>
await FallbackCDNUtil.DownloadAsJSONType<RegionResourceProp>(PresetConfig?.LauncherResourceURL, InternalAppJSONContext.Default, innerToken));
async innerToken =>
await FallbackCDNUtil.DownloadAsJSONType<RegionResourceProp>(PresetConfig?.LauncherResourceURL, InternalAppJSONContext.Default, innerToken);

LauncherGameResource = await launcherGameResourceCallback.WaitForRetryAsync(ExecutionTimeout, ExecutionTimeoutStep,
ExecutionTimeoutAttempt, onTimeoutRoutine, token).ConfigureAwait(false);
Expand All @@ -102,15 +102,15 @@ protected virtual async Task LoadLauncherGameResource(ActionOnTimeOutRetry? onTi
if (string.IsNullOrEmpty(PresetConfig?.LauncherPluginURL))
{
ActionTimeoutValueTaskCallback<RegionResourceProp?> launcherPluginPropCallback =
new ActionTimeoutValueTaskCallback<RegionResourceProp?>(async (innerToken) =>
await FallbackCDNUtil.DownloadAsJSONType<RegionResourceProp>(string.Format(PresetConfig?.LauncherPluginURL!, GetDeviceId(PresetConfig!)), InternalAppJSONContext.Default, innerToken));
async innerToken =>
await FallbackCDNUtil.DownloadAsJSONType<RegionResourceProp>(string.Format(PresetConfig?.LauncherPluginURL!, GetDeviceId(PresetConfig!)), InternalAppJSONContext.Default, innerToken);

RegionResourceProp? pluginProp = await launcherPluginPropCallback.WaitForRetryAsync(ExecutionTimeout, ExecutionTimeoutStep,
ExecutionTimeoutAttempt, onTimeoutRoutine, token).ConfigureAwait(false);

if (pluginProp != null && LauncherGameResource.data != null)
{
LauncherGameResource.data.plugins = pluginProp?.data?.plugins;
LauncherGameResource.data.plugins = pluginProp.data?.plugins;
#if DEBUG
Logger.LogWriteLine("[LauncherApiBase::LoadLauncherGameResource] Loading plugin handle!",
LogType.Debug, true);
Expand Down Expand Up @@ -269,10 +269,10 @@ protected virtual async ValueTask LoadLauncherGameInfo(ActionOnTimeOutRetry? onT
}

ActionTimeoutValueTaskCallback<LauncherGameNews?> taskGameLauncherNewsSophonCallback =
new ActionTimeoutValueTaskCallback<LauncherGameNews?>(async (innerToken) =>
isMultiLang
? await LoadMultiLangLauncherNews(presetConfig.LauncherSpriteURL, lang, innerToken)
: await LoadSingleLangLauncherNews(presetConfig.LauncherSpriteURL, innerToken));
async innerToken =>
isMultiLang
? await LoadMultiLangLauncherNews(presetConfig.LauncherSpriteURL, lang, innerToken)
: await LoadSingleLangLauncherNews(presetConfig.LauncherSpriteURL, innerToken);

return await taskGameLauncherNewsSophonCallback.WaitForRetryAsync(
ExecutionTimeout, ExecutionTimeoutStep, ExecutionTimeoutAttempt,
Expand Down
Loading

0 comments on commit 3702cf8

Please sign in to comment.