Skip to content

Commit

Permalink
fix: remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DorielRivalet committed Aug 6, 2023
1 parent 4b786ac commit 4d233e9
Show file tree
Hide file tree
Showing 18 changed files with 468 additions and 419 deletions.
6 changes: 3 additions & 3 deletions MHFZ_Overlay/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected override void OnStartup(StartupEventArgs e)
loggingRules[0].SetLoggingLevels(LoggingService.GetLogLevel(s.LogLevel), NLog.LogLevel.Fatal);
Logger.Info(CultureInfo.InvariantCulture, "Started WPF application");
Logger.Trace(CultureInfo.InvariantCulture, "Call stack: {0}", new StackTrace().ToString());
Logger.Debug("OS: {0}, is64BitOS: {1}, is64BitProcess: {2}, CLR version: {3}", Environment.OSVersion, Environment.Is64BitOperatingSystem, Environment.Is64BitProcess, Environment.Version);
Logger.Debug(CultureInfo.InvariantCulture, "OS: {0}, is64BitOS: {1}, is64BitProcess: {2}, CLR version: {3}", Environment.OSVersion, Environment.Is64BitOperatingSystem, Environment.Is64BitProcess, Environment.Version);

// TODO: test if this doesnt conflict with squirrel update
CurrentProgramVersion = $"v{GetAssemblyVersion}";
Expand Down Expand Up @@ -143,14 +143,14 @@ protected override void OnStartup(StartupEventArgs e)
private static void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) =>

// Log/inspect the inspection here
Logger.Error("Unhandled exception\n\nMessage: {0}\n\nStack Trace: {1}\n\nHelp Link: {2}\n\nHResult: {3}\n\nSource: {4}\n\nTarget Site: {5}", e.Exception.Message, e.Exception.StackTrace, e.Exception.HelpLink, e.Exception.HResult, e.Exception.Source, e.Exception.TargetSite);
Logger.Error(CultureInfo.InvariantCulture, "Unhandled exception\n\nMessage: {0}\n\nStack Trace: {1}\n\nHelp Link: {2}\n\nHResult: {3}\n\nSource: {4}\n\nTarget Site: {5}", e.Exception.Message, e.Exception.StackTrace, e.Exception.HelpLink, e.Exception.HResult, e.Exception.Source, e.Exception.TargetSite);

private static void SetRenderingMode(string renderingMode)
{
RenderOptions.ProcessRenderMode = renderingMode == "Hardware"
? RenderMode.Default
: RenderMode.SoftwareOnly;
Logger.Info($"Rendering mode: {renderingMode}");
Logger.Info(CultureInfo.InvariantCulture, $"Rendering mode: {renderingMode}");
}

// https://github.com/Squirrel/Squirrel.Windows/issues/198#issuecomment-299262613
Expand Down
1 change: 1 addition & 0 deletions MHFZ_Overlay/Models/Collections/Achievements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace MHFZ_Overlay.Models.Collections;
using System.Collections.ObjectModel;
using MHFZ_Overlay.Models;
using MHFZ_Overlay.Models.Structures;
using Octokit;

/// <summary>
/// Achievements dictionary. TODO.
Expand Down
2 changes: 1 addition & 1 deletion MHFZ_Overlay/Models/Structures/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public enum GetterMode
/// <summary>
/// Gets a single object/primitive
/// </summary>
Single,
One,

/// <summary>
/// Gets the count of the object
Expand Down
2 changes: 1 addition & 1 deletion MHFZ_Overlay/Services/AchievementService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private static bool CheckConditionsForAchievement(int achievementID, DataLoader
{
default:
{
LoggerInstance.Error("Achievement ID {0} not found", achievementID);
LoggerInstance.Error(CultureInfo.InvariantCulture, "Achievement ID {0} not found", achievementID);
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion MHFZ_Overlay/Services/BingoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
// found in the LICENSE file.

namespace MHFZ_Overlay.Services;
internal class BingoService
internal sealed class BingoService
{
}
2 changes: 1 addition & 1 deletion MHFZ_Overlay/Services/ChallengeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
// found in the LICENSE file.

namespace MHFZ_Overlay.Services;
internal class ChallengeService
internal sealed class ChallengeService
{
}
37 changes: 37 additions & 0 deletions MHFZ_Overlay/Services/Contracts/IChallenge.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// © 2023 The mhfz-overlay developers.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.

namespace MHFZ_Overlay.Services.Contracts;

public interface IChallenge
{
/// <summary>
/// Checks the requirements to unlock the challenge.
/// </summary>
/// <param name="bronzeCount"></param>
/// <param name="silverCount"></param>
/// <param name="goldCount"></param>
/// <param name="platinumCount"></param>
/// <param name="secretID"></param>
/// <returns>false if the requirements are not met</returns>
bool CheckAchievementRequirements(int bronzeCount, int silverCount, int goldCount, int platinumCount, int secretID);

/// <summary>
/// Unlocks the challenge.
/// </summary>
/// <param name="checkRequirements"></param>
/// <returns>false if the challenge could not be unlocked</returns>
bool Unlock(bool checkRequirements);

/// <summary>
/// Starts the challenge. If there is already a challenge in progress, that challenge is canceled.
/// </summary>
/// <returns>false if the challenge could not be started</returns>
bool Start();

/// <summary>
/// Cancels the challenge.
/// </summary>
void Cancel();
}
2 changes: 1 addition & 1 deletion MHFZ_Overlay/Services/Contracts/IDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface IDatabase
/// <param name="data"></param>
/// <param name="mode"></param>
/// <returns></returns>
object? GetData(object data, GetterMode mode = GetterMode.Single);
object? GetData(object data, GetterMode mode = GetterMode.One);

void SetUpDatabase();
}
2 changes: 1 addition & 1 deletion MHFZ_Overlay/Services/Contracts/IDiscordRpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public interface IDiscordRpcClient : IDisposable

void SetPresence(RichPresence presence);

RichPresence UpdateButtons(Button[]? button = null);
RichPresence UpdateButtons(Button[] ? button = null);

RichPresence SetButton(Button button, int index = 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
if (value is TextFormattingMode textFormattingMode)
{
return textFormattingMode.ToString(CultureInfo.InvariantCulture);
return textFormattingMode.ToString();
}

return null;
Expand Down
Loading

0 comments on commit 4d233e9

Please sign in to comment.