mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
force clear cache flag for less duplication
This commit is contained in:
parent
d184a28ceb
commit
7beb66606c
@ -97,6 +97,7 @@ namespace NewHorizons
|
||||
|
||||
private bool _playerAwake;
|
||||
public bool PlayerSpawned { get; set; }
|
||||
public bool ForceClearCaches { get; set; } // for reloading configs
|
||||
|
||||
public ShipWarpController ShipWarpController { get; private set; }
|
||||
|
||||
@ -196,7 +197,6 @@ namespace NewHorizons
|
||||
}
|
||||
};
|
||||
|
||||
// why is this false when called in Start
|
||||
if (resetTranslation)
|
||||
{
|
||||
TranslationHandler.ClearTables();
|
||||
@ -289,8 +289,10 @@ namespace NewHorizons
|
||||
EnumUtilities.ClearCache();
|
||||
|
||||
// Caches of other assets only have to be cleared if we changed star systems
|
||||
if (CurrentStarSystem != _previousStarSystem)
|
||||
if (ForceClearCaches || CurrentStarSystem != _previousStarSystem)
|
||||
{
|
||||
ForceClearCaches = false;
|
||||
|
||||
NHLogger.Log($"Changing star system from {_previousStarSystem} to {CurrentStarSystem} - Clearing system-specific caches!");
|
||||
ImageUtilities.ClearCache();
|
||||
AudioUtilities.ClearCache();
|
||||
|
||||
@ -48,13 +48,9 @@ namespace NewHorizons.Utility.DebugTools
|
||||
|
||||
SearchUtilities.Find("/PauseMenu/PauseMenuManagers").GetComponent<PauseMenuManager>().OnSkipToNextTimeLoop();
|
||||
|
||||
Main.Instance.ForceClearCaches = true;
|
||||
Main.Instance.ChangeCurrentStarSystem(Main.Instance.CurrentStarSystem);
|
||||
|
||||
NHLogger.Log($"Reloading configs for star system {Main.Instance.CurrentStarSystem} - Clearing system-specific caches!");
|
||||
ImageUtilities.ClearCache();
|
||||
AudioUtilities.ClearCache();
|
||||
AssetBundleUtilities.ClearCache();
|
||||
|
||||
Main.SecondsElapsedInLoop = -1f;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user