Skip to content

Commit 643103a

Browse files
authored
Merge pull request #2 from NullScope/development
Fixed Default settings not being re-applied when returning to the main menu
2 parents c2dd024 + db0f022 commit 643103a

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

GlobalSuppressions.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
[assembly: SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~M:CotLAutoGraphicsSettings.Plugin.Awake")]
9+
[assembly: SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~M:CotLAutoGraphicsSettings.Plugin.OnEnable")]
10+
[assembly: SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~M:CotLAutoGraphicsSettings.Plugin.OnDisable")]

Patches/GraphicsSettingsPatches.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using HarmonyLib;
22
using Lamb.UI;
3+
using Lamb.UI.MainMenu;
34

45
namespace CotLAutoGraphicsSettings.Patches
56
{
@@ -14,6 +15,13 @@ public static void UIManager_Start()
1415
Plugin.ApplySettings();
1516
}
1617

18+
[HarmonyPostfix]
19+
[HarmonyPatch(typeof(UIMainMenuController), nameof(UIMainMenuController.Start))]
20+
public static void LoadMainMenu_Start()
21+
{
22+
Plugin.ApplySettings();
23+
}
24+
1725
[HarmonyPostfix]
1826
[HarmonyPatch(typeof(SettingsManager), nameof(SettingsManager.SaveSettings))]
1927
public static void SettingsManager_SaveSettings()
@@ -40,7 +48,6 @@ public static void SettingsManager_SaveSettings()
4048
[HarmonyPatch(typeof(LocationManager), nameof(LocationManager.EndLoadLocation))]
4149
public static void LocationManager_EndLoadLocation(FollowerLocation location)
4250
{
43-
Plugin.Log.LogError(location);
4451
switch(location)
4552
{
4653
// These are all called during loading of the Cult Base,

Plugin.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ private void OnDisable()
4949

5050
public static SettingsData.GraphicsSettings CloneSettings (SettingsData.GraphicsSettings settings)
5151
{
52-
var newSettings = new SettingsData.GraphicsSettings(settings);
53-
// For some reason the constructor does not copy over the AntiAliasing option, so we set it here.
54-
newSettings.AntiAliasing = settings.AntiAliasing;
52+
var newSettings = new SettingsData.GraphicsSettings(settings)
53+
{
54+
// For some reason the constructor does not copy over the AntiAliasing option, so we set it here.
55+
AntiAliasing = settings.AntiAliasing
56+
};
5557

56-
return newSettings;
58+
return newSettings;
5759
}
5860

5961
public static void SetupConfig()

0 commit comments

Comments
 (0)