diff --git a/1.1-1.2/Assemblies/BetterLoading.dll b/1.1-1.2/Assemblies/BetterLoading.dll new file mode 100644 index 0000000..7be7a77 Binary files /dev/null and b/1.1-1.2/Assemblies/BetterLoading.dll differ diff --git a/1.1-1.3/Assemblies/BetterLoading.dll b/1.1-1.3/Assemblies/BetterLoading.dll deleted file mode 100644 index aa0ee42..0000000 Binary files a/1.1-1.3/Assemblies/BetterLoading.dll and /dev/null differ diff --git a/1.3/Assemblies/BetterLoading.dll b/1.3/Assemblies/BetterLoading.dll new file mode 100644 index 0000000..e3fd870 Binary files /dev/null and b/1.3/Assemblies/BetterLoading.dll differ diff --git a/LoadFolders.xml b/LoadFolders.xml index 4d6e9d0..1ed4d4d 100644 --- a/LoadFolders.xml +++ b/LoadFolders.xml @@ -1,14 +1,14 @@ -
  • 1.1-1.3
  • +
  • 1.1-1.2
  • -
  • 1.1-1.3
  • +
  • 1.1-1.2
  • - -
  • 1.1-1.3
  • + +
  • 1.3
  • -
    +
    \ No newline at end of file diff --git a/Source/BetterLoading.csproj b/Source/BetterLoading.csproj index 94f89c5..bafcf52 100755 --- a/Source/BetterLoading.csproj +++ b/Source/BetterLoading.csproj @@ -9,12 +9,12 @@ true - ..\1.1-1.2\Assemblies\ - ..\1.1-1.2\Assemblies\ + ..\1.3\Assemblies\ + ..\1.3\Assemblies\ - ..\1.1-1.2\Assemblies\ - ..\1.1-1.2\Assemblies\ + ..\1.3\Assemblies\ + ..\1.3\Assemblies\ @@ -22,9 +22,6 @@ ..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll False - - ..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll - ../../../RimWorldLinux_Data/Managed/UnityEngine.dll ..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll @@ -47,6 +44,6 @@ - + \ No newline at end of file diff --git a/Source/BetterLoadingMain.cs b/Source/BetterLoadingMain.cs index eed2006..ae37c34 100755 --- a/Source/BetterLoadingMain.cs +++ b/Source/BetterLoadingMain.cs @@ -72,7 +72,7 @@ public BetterLoadingMain(ModContentPack content) : base(content) ) .ToList(); - Log.Error($"[BetterLoading] {dllsThatShouldBeLoaded.Count - dllsActuallyLoaded.Count} assemblies for {pack.Name} failed to load! The ones that didn't load are: {didntLoad.ToCommaList()}"); + Log.Error($"[BetterLoading] {dllsThatShouldBeLoaded.Count - dllsActuallyLoaded.Count} assemblies for {pack.Name} failed to load! The ones that didn't load are: {string.Join(", ",didntLoad)}"); Log.Error($"[BetterLoading] Got {failures.Count} messages that identify those failures."); DllPathsThatFailedToLoad[pack] = failures; @@ -130,8 +130,7 @@ private void CreateTimingReport() $"Spent {timeResolvingDatabases.TotalMilliseconds}ms resolving cross-references and running post-load, pre-finalize callbacks.\n" + $"Spent {timeRunningCctors.TotalMilliseconds}ms running static constructors (initializing mods).\n" + $"Spent {timeRunningPostFinalize.TotalMilliseconds}ms running post-finalize callbacks.\n" + - $"In total, spent {totalLoadTime.TotalMilliseconds}ms launching the game." - , true); + $"In total, spent {totalLoadTime.TotalMilliseconds}ms launching the game."); } public static void DisplayFailedLoadDialog() diff --git a/Source/LoadingScreen.cs b/Source/LoadingScreen.cs index 283749c..9a3d2c9 100755 --- a/Source/LoadingScreen.cs +++ b/Source/LoadingScreen.cs @@ -262,8 +262,7 @@ public void OnGUI() if (currentProgress > maxProgress) { Log.Error( - $"[BetterLoading] Clamping! The stage of type {_currentStage.GetType().FullName} has returned currentProgress {currentProgress} > maxProgress {maxProgress}. Please report this!", - true); + $"[BetterLoading] Clamping! The stage of type {_currentStage.GetType().FullName} has returned currentProgress {currentProgress} > maxProgress {maxProgress}. Please report this!"); currentProgress = maxProgress; } @@ -332,7 +331,16 @@ public void OnGUI() if (_currentTip == null || (DateTime.Now.Ticks - _timeLastTipShown) >= _ticksPerTip) { //No tip chosen yet, or time for next tip - pick another and reset timer. - _currentTip = _tips.Pop(); + + if (_tips.NullOrEmpty()) + { + _currentTip = "BetterLoading Warning: No tips could be located in your game. This is probably a bug with another mod"; + } + else + { + _currentTip = _tips.Pop(); + } + _timeLastTipShown = DateTime.Now.Ticks; } @@ -361,7 +369,7 @@ public void OnGUI() } catch (Exception e) { - Log.ErrorOnce($"Encountered exception while rendering loading screen: {e}", 0xBEEF99, true); + Log.ErrorOnce($"Encountered exception while rendering loading screen: {e}", 0xBEEF99); } } diff --git a/Source/Stage/InitialLoad/7StageRunPostLoadPreFinalizeCallbacks.cs b/Source/Stage/InitialLoad/7StageRunPostLoadPreFinalizeCallbacks.cs index c50455a..74bfea4 100755 --- a/Source/Stage/InitialLoad/7StageRunPostLoadPreFinalizeCallbacks.cs +++ b/Source/Stage/InitialLoad/7StageRunPostLoadPreFinalizeCallbacks.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading; using HarmonyLib; +using RimWorld; using Verse; namespace BetterLoading.Stage.InitialLoad @@ -92,9 +93,13 @@ public static bool PreExecToExecWhenFinished(List ___toExecuteWhenFinish // Debug.Log($"BL Debug: types declared in PDL: {declaredInPDL.Select(a => a.Method).ToStringSafeEnumerable()}"); - var indexOfStaticCtor = ___toExecuteWhenFinished.IndexOf(declaredInPDL.Find(task => task.Method.Name.Contains("b__4_2"))); //The anon class that calls static ctors. + var targetMethodName = VersionControl.CurrentMinor == 3 ? "b__4_3" : "b__4_2"; + + // Log.Message($"BL Debug: Tasks defined in PDL: {string.Join(", ", declaredInPDL.Select(task => task.Method.FullDescription()))}"); + + var indexOfStaticCtor = ___toExecuteWhenFinished.IndexOf(declaredInPDL.Find(task => task.Method.Name.Contains(targetMethodName))); //The anon class that calls static ctors. - // Debug.Log($"BL Debug: Identified target index as {indexOfStaticCtor} which maps to the action-method {___toExecuteWhenFinished[indexOfStaticCtor].Method.FullDescription()}"); + // Log.Message($"BL Debug: Identified target index as {indexOfStaticCtor} which maps to the action-method {___toExecuteWhenFinished[indexOfStaticCtor].Method.FullDescription()}"); //Ones to execute now are the ones before the ctors var toExecute = ___toExecuteWhenFinished.Take(indexOfStaticCtor).ToList(); @@ -144,7 +149,7 @@ public static bool PreExecToExecWhenFinished(List ___toExecuteWhenFinish Thread.Sleep(0); _done = true; - }, null, true, null); + }, null, false, null); return false; } diff --git a/Source/Stage/InitialLoad/9StageRunPostFinalizeCallbacks.cs b/Source/Stage/InitialLoad/9StageRunPostFinalizeCallbacks.cs index 3109463..d00d87b 100755 --- a/Source/Stage/InitialLoad/9StageRunPostFinalizeCallbacks.cs +++ b/Source/Stage/InitialLoad/9StageRunPostFinalizeCallbacks.cs @@ -74,21 +74,21 @@ public static bool PreExecToExecWhenFinished(List ___toExecuteWhenFinish } GlobalTimingData.TicksStartedPostFinalize = DateTime.UtcNow.Ticks; - Log.Message("Started post-finalize at " + GlobalTimingData.TicksStartedPostFinalize); _hasBeenCalled = true; ShouldInterceptNext = false; - _numTasksToRun = ___toExecuteWhenFinished.Count; _finishedExecuting = false; - if (_numTasksToRun == 0) + if (___toExecuteWhenFinished.Count == 0) { _numTasksToRun = 1; _finishedExecuting = true; return false; } + _numTasksToRun = ___toExecuteWhenFinished.Count; + var initialNumTasksToRun = _numTasksToRun; Log.Message($"[BetterLoading] Processing {initialNumTasksToRun} post-finalize tasks.");