Skip to content

Commit

Permalink
CodeQA
Browse files Browse the repository at this point in the history
I hope Qodana is happi
  • Loading branch information
bagusnl committed Aug 25, 2024
1 parent b299794 commit 4e8f096
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using static CollapseLauncher.GameSettings.Base.SettingsBase;
using static Hi3Helper.Logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public bool UseCustomRegionBG
/// The path of the custom BG for each region
/// </summary>
public string? CustomRegionBGPath { get; set; }
#nullable restore

#endregion

Expand Down
2 changes: 1 addition & 1 deletion CollapseLauncher/XAMLs/MainApp/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ internal async void ChangeBackgroundImageAsRegionAsync(bool ShowLoadingMsg = fal
// Check if Regional Custom BG is enabled and available
if (isUseCustomPerRegionBg)
{
var regionBgPath = ((IGameSettingsUniversal)currentGameProperty?._GameSettings)?.SettingsCollapseMisc?.CustomRegionBGPath;
var regionBgPath = ((IGameSettingsUniversal)currentGameProperty._GameSettings)?.SettingsCollapseMisc?.CustomRegionBGPath;
if (!string.IsNullOrEmpty(regionBgPath) && File.Exists(regionBgPath))
{
if (BackgroundMediaUtility.GetMediaType(regionBgPath) == BackgroundMediaUtility.MediaType.StillImage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Numerics;
using System.Threading.Tasks;
using Windows.UI;
using static Hi3Helper.Locale;
using static Hi3Helper.Logger;
Expand Down
9 changes: 4 additions & 5 deletions CollapseLauncher/XAMLs/MainApp/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using CollapseLauncher.Statics;
using CommunityToolkit.WinUI;
using Hi3Helper;
using Hi3Helper.Data;
using Hi3Helper.Shared.ClassStruct;
using Hi3Helper.Shared.Region;
using Microsoft.UI.Xaml;
Expand Down Expand Up @@ -430,9 +429,9 @@ private async void SelectBackgroundImg(object sender, RoutedEventArgs e)
{
BackgroundImgChanger.ChangeBackground(LauncherMetadataHelper.CurrentMetadataConfig.GameLauncherApi.GameBackgroundImgLocal, null, true, true, true);
}
else if (!string.IsNullOrEmpty(((IGameSettingsUniversal)currentGameProperty?._GameSettings)?.SettingsCollapseMisc?.CustomRegionBGPath))
else if (!string.IsNullOrEmpty(((IGameSettingsUniversal)currentGameProperty._GameSettings)?.SettingsCollapseMisc?.CustomRegionBGPath))
{
currentMediaType = BackgroundMediaUtility.GetMediaType(((IGameSettingsUniversal)currentGameProperty?._GameSettings)?.SettingsCollapseMisc?.CustomRegionBGPath);
currentMediaType = BackgroundMediaUtility.GetMediaType(((IGameSettingsUniversal)currentGameProperty._GameSettings)?.SettingsCollapseMisc?.CustomRegionBGPath);
}

if (currentMediaType == MediaType.Media)
Expand Down Expand Up @@ -533,7 +532,7 @@ private bool IsBGCustom

ToggleCustomBgButtons();
}
else if (isUseRegionCustomBG && value)
else if (isUseRegionCustomBG)
{
string currentRegionCustomBg = ((IGameSettingsUniversal)currentGameProperty._GameSettings).SettingsCollapseMisc.CustomRegionBGPath;
LauncherMetadataHelper.CurrentMetadataConfig.GameLauncherApi.GameBackgroundImgLocal = currentRegionCustomBg;
Expand All @@ -543,7 +542,7 @@ private bool IsBGCustom
}
else
{
string BGPath = GetAppConfigValue("CustomBGPath").ToString();
var BGPath = GetAppConfigValue("CustomBGPath").ToString();
if (string.IsNullOrEmpty(BGPath))
{
LauncherMetadataHelper.CurrentMetadataConfig.GameLauncherApi.GameBackgroundImgLocal = AppDefaultBG;
Expand Down

0 comments on commit 4e8f096

Please sign in to comment.