This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Xgames
authored and
Xgames
committed
Aug 1, 2022
1 parent
ef3617f
commit a2ce5f6
Showing
10 changed files
with
225 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
PrimitierModdingFramework/CustomSaveFileData/MetaDataFile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace PrimitierModdingFramework | ||
{ | ||
public class MetaDataFile | ||
{ | ||
public List<ModMetaData> Mods = new List<ModMetaData>(); | ||
|
||
} | ||
|
||
|
||
public class ModMetaData | ||
{ | ||
public string Id; | ||
public List<SubstanceToIndexMap> SubstanceToIndexMaps = new List<SubstanceToIndexMap>(); | ||
|
||
|
||
} | ||
|
||
public class SubstanceToIndexMap | ||
{ | ||
public string Name; | ||
public int Index; | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
PrimitierModdingFramework/CustomSaveFileData/Patches/SaveAndLoad_Load.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using HarmonyLib; | ||
using Il2CppSystem; | ||
using Il2CppSystem.Threading.Tasks; | ||
using System.Reflection; | ||
using UnityEngine; | ||
|
||
namespace PrimitierModdingFramework.CustomSaveFileData.Patches | ||
{ | ||
[HarmonyPatch(typeof(SaveAndLoad), nameof(SaveAndLoad.Load))] | ||
public class SaveAndLoad_Load | ||
{ | ||
public static void Prefix(ref SaveAndLoad.SaveData saveData) | ||
{ | ||
if (!CustomSaveFileSystem.IsEnabled) | ||
return; | ||
|
||
saveData = CustomSaveFileSystem.ReadMetaDataFile(CustomSaveFileSystem.LastParsedSaveSlot, saveData); | ||
} | ||
|
||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
PrimitierModdingFramework/CustomSaveFileData/Patches/SaveAndLoad_Parse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using HarmonyLib; | ||
|
||
namespace PrimitierModdingFramework.CustomSaveFileData.Patches | ||
{ | ||
[HarmonyPatch(typeof(SaveAndLoad), nameof(SaveAndLoad.Parse))] | ||
public class SaveAndLoad_Parse | ||
{ | ||
|
||
public static void Postfix(int slot) | ||
{ | ||
CustomSaveFileSystem.LastParsedSaveSlot = slot; | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
PrimitierModdingFramework/CustomSaveFileData/Patches/SaveAndLoad_Save.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using HarmonyLib; | ||
using Il2CppSystem; | ||
using System.Reflection; | ||
using UnityEngine; | ||
|
||
namespace PrimitierModdingFramework.CustomSaveFileData.Patches | ||
{ | ||
[HarmonyPatch(typeof(SaveAndLoad), nameof(SaveAndLoad.Save))] | ||
public class SaveAndLoad_Save | ||
{ | ||
public static void Postfix(int slot) | ||
{ | ||
if (!CustomSaveFileSystem.IsEnabled) | ||
return; | ||
|
||
CustomSaveFileSystem.WriteSaveMetadata(slot); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters