Skip to content

Commit 1405db6

Browse files
committed
Adding some non stock, useful thingies to be used on the KSPU add'ons
1 parent c086e6f commit 1405db6

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

Source/ModuleManager/MMPatchLoader.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ public IEnumerable<IProtoUrlConfig> Run()
6363
status = "Checking Cache";
6464
logger.Info(status);
6565

66-
bool useCache = false;
67-
try
66+
#pragma warning disable CS0618 // Type or member is obsolete
67+
ModuleManager.IsLoadedFromCache = false;
68+
try
6869
{
69-
useCache = !ModuleManager.IgnoreCache && IsCacheUpToDate();
70+
ModuleManager.IsLoadedFromCache = !ModuleManager.IgnoreCache && IsCacheUpToDate();
7071
}
7172
catch (Exception ex)
7273
{
@@ -75,7 +76,8 @@ public IEnumerable<IProtoUrlConfig> Run()
7576

7677
IEnumerable<IProtoUrlConfig> databaseConfigs = null;
7778

78-
if (!useCache)
79+
if (!ModuleManager.IsLoadedFromCache)
80+
#pragma warning restore CS0618 // Type or member is obsolete
7981
{
8082
IBasicLogger patchLogger = ModLogger.Instance;
8183

Source/ModuleManager/ModuleManager.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ public class ModuleManager : MonoBehaviour
3535
public static bool dumpPostPatch = false;
3636
public static bool DontCopyLogs { get; private set; } = false;
3737

38-
public static bool IgnoreCache { get { return _IgnoreCache; }}
39-
//useCache = false;
40-
private static bool _IgnoreCache
41-
#if DEBUG
38+
[Obsolete("This attribute is not Standard MM. Do not use it on things to be published on Forum")]
39+
public static bool IsLoadedFromCache { get; internal set; }
40+
41+
internal static bool IgnoreCache { get; private set; }
42+
#if DEBUG
4243
= true;
43-
#else
44+
#else
4445
= false;
45-
#endif
46+
#endif
4647

4748
private PopupDialog menu;
4849

@@ -159,7 +160,7 @@ internal void Awake()
159160

160161
DontCopyLogs = Environment.GetCommandLineArgs().Contains("-mm-dont-copy-logs");
161162

162-
_IgnoreCache = Environment.GetCommandLineArgs().Contains("-ignore-cache");
163+
IgnoreCache = Environment.GetCommandLineArgs().Contains("-ignore-cache");
163164

164165
loadedInScene = true;
165166
}

0 commit comments

Comments
 (0)