Skip to content

Commit d336148

Browse files
committed
Killed some bugs
1 parent a8dd32d commit d336148

5 files changed

Lines changed: 13 additions & 11 deletions

File tree

ExtendedErrorHandling/ErrorTexturePlaceholder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static void HandleTextureFail(ref Exception __exception, ref TextureResou
6868
if (__result == null)
6969
{
7070
ExtendedErrorHandling.PluginLogger.LogWarning($"[ImportCM.LoadTexture] Failed to load texture `{f_strFileName}`: ({__exception.GetType()}) {__exception.Message}");
71-
CornerMessage.DisplayMessage(ExtendedErrorHandling.VerboseCornerMessages.Value
71+
ExtendedErrorHandling.CornerMessage.DisplayMessage(ExtendedErrorHandling.VerboseCornerMessages.Value
7272
? $"[f708e0]Texture load failed: {f_strFileName}![-]"
7373
: "[f708e0]Failed to load texture! See console...[-]");
7474

ExtendedErrorHandling/ExtendedErrorHandling.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.IO;
77
using System.Security;
88
using System.Security.Permissions;
9+
using UnityEngine.SceneManagement;
910

1011
[module: UnverifiableCode]
1112
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
@@ -47,13 +48,14 @@ private void Awake()
4748
Harmony.CreateAndPatchAll(typeof(ErrorTexturePlaceholder));
4849
Harmony.CreateAndPatchAll(typeof(NDebugMod));
4950

50-
UnityEngine.SceneManagement.SceneManager.sceneLoaded += NDebugMod.DoOnTitleScreen;
51+
SceneManager.sceneLoaded += NDebugMod.DoOnTitleScreen;
52+
SceneManager.sceneLoaded += SomeSceneLoaded;
5153
}
5254

53-
[HarmonyPatch(typeof(GameMain), nameof(GameMain.OnInitialize))]
54-
[HarmonyPostfix]
55-
private static void AfterOnInit()
55+
private static void SomeSceneLoaded(Scene arg0, LoadSceneMode arg1)
5656
{
57+
PluginLogger.LogDebug("First scene loaded! Creating folders...");
58+
SceneManager.sceneLoaded -= SomeSceneLoaded;
5759
CreateMissingFolders();
5860
}
5961

ExtendedErrorHandling/MenuItemRedundancy.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ internal static void ErrorHandleMissingMenus(ref MaidProp __0)
2020
{
2121
ExtendedErrorHandling.PluginLogger.LogWarning($"Body menu: {__0.strFileName} could not be found! Reverting to base body...");
2222

23-
CornerMessage.DisplayMessage($"[fffd7a]Missing Body: {__0.strFileName}[-]");
23+
ExtendedErrorHandling.CornerMessage.DisplayMessage($"[fffd7a]Missing Body: {__0.strFileName}[-]");
2424

2525
__0.strFileName = "body001_I_.menu";
2626
}
2727
else if ((MPN)__0.idx == MPN.head)
2828
{
2929
ExtendedErrorHandling.PluginLogger.LogWarning($"Face menu: {__0.strFileName} could not be found! Reverting to base face...");
3030

31-
CornerMessage.DisplayMessage($"[fffd7a]Missing Face: {__0.strFileName}[-]");
31+
ExtendedErrorHandling.CornerMessage.DisplayMessage($"[fffd7a]Missing Face: {__0.strFileName}[-]");
3232

3333
__0.strFileName = "face006_I_.menu";
3434
}
@@ -45,7 +45,7 @@ internal static Exception MaidPropErrorFix(Exception __exception, MaidProp mp)
4545

4646
ExtendedErrorHandling.PluginLogger.LogError($"There was an exception while trying to read {mp.strFileName}");
4747

48-
CornerMessage.DisplayMessage(ExtendedErrorHandling.VerboseCornerMessages.Value
48+
ExtendedErrorHandling.CornerMessage.DisplayMessage(ExtendedErrorHandling.VerboseCornerMessages.Value
4949
? $"[ff4e33]Menu read failed: {mp.strFileName}.[-]"
5050
: "[ff4e33]Failed to read menu![-]");
5151

ExtendedErrorHandling/NDebugMod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public static bool MessageBoxToCorner(ref string f_strTitle, ref string f_strMsg
3131
{
3232
case MessageBoxHandling.Disable:
3333
return false;
34-
case MessageBoxHandling.NotifyInCorner when CornerMessage.CornerMessageLoaded:
35-
CornerMessage.DisplayMessage($"[ff4e33]{f_strTitle}: Check console...[-]");
34+
case MessageBoxHandling.NotifyInCorner when ExtendedErrorHandling.CornerMessage.CornerMessageLoaded:
35+
ExtendedErrorHandling.CornerMessage.DisplayMessage($"[ff4e33]{f_strTitle}: Check console...[-]");
3636
return false;
3737
case MessageBoxHandling.Default:
3838
default:

ExtendedErrorHandling/PresetErrorHandling.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal static Exception PresetLoadErrorFix(Exception __exception, string __1)
1717
}
1818

1919
ExtendedErrorHandling.PluginLogger.LogError($"{__1} could not be loaded!!");
20-
CornerMessage.DisplayMessage(ExtendedErrorHandling.VerboseCornerMessages.Value
20+
ExtendedErrorHandling.CornerMessage.DisplayMessage(ExtendedErrorHandling.VerboseCornerMessages.Value
2121
? $"[ff4e33]Preset load failed: {__1}[-]"
2222
: "[ff4e33]A preset failed to load...[-]");
2323

0 commit comments

Comments
 (0)