-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathCheckedVersions.cs
More file actions
36 lines (33 loc) · 997 Bytes
/
CheckedVersions.cs
File metadata and controls
36 lines (33 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using InnoVault.GameSystem;
using System;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
namespace CalamityOverhaul
{
internal class CheckedVersions : SaveMod
{
internal static Version SaveVersion;
internal static bool IsNewVersion {
get {
if (CWRMod.Instance == null || CWRMod.Instance.Version == null) {
return false;
}
return SaveVersion < CWRMod.Instance.Version;
}
}
public override void SetStaticDefaults() {
if (!HasSave) {
DoSave<CheckedVersions>();
}
DoLoad<CheckedVersions>();
}
public override void SaveData(TagCompound tag) {
tag["Versions"] = Mod.Version;
}
public override void LoadData(TagCompound tag) {
if (!tag.TryGet("Versions", out SaveVersion)) {
SaveVersion = Mod.Version;
}
}
}
}