public static void Postfix(SaveSlotType gameMode, string name) { SaveProxy proxy = new SaveProxy(); proxy.data = MelonLoader.TinyJSON.JSON.Dump(ModHealthManager.GetData()); SaveGameSlots.SaveDataToSlot(gameMode, SaveGameSystem.m_CurrentEpisode, SaveGameSystem.m_CurrentGameId, name, "ModHealthManager", MelonLoader.TinyJSON.JSON.Dump(proxy)); }
public static void Postfix(string name) { string serializedProxy = SaveGameSlots.LoadDataFromSlot(name, "ModHealthManager"); SaveProxy proxy = Utils.DeserializeObject <SaveProxy>(serializedProxy); ModHealthManager.SetData(GetData(proxy)); }
public static void Postfix(SaveSlotType gameMode, string name) { SaveProxy proxy = new SaveProxy(); proxy.data = Utils.SerializeObject(ModHealthManager.GetData()); SaveGameSlots.SaveDataToSlot(gameMode, SaveGameSystem.m_CurrentEpisode, SaveGameSystem.m_CurrentGameId, name, "ModHealthManager", Utils.SerializeObject(proxy)); }
private static ModHealthManagerData GetData(SaveProxy proxy) { if (proxy is null || string.IsNullOrEmpty(proxy.data)) { return(null); } return(MelonLoader.TinyJSON.JSON.Load(proxy.data).Make <ModHealthManagerData>()); }
private static ModHealthManagerData GetData(SaveProxy proxy) { if (proxy == null || string.IsNullOrEmpty(proxy.data)) { return(null); } return(Utils.DeserializeObject <ModHealthManagerData>(proxy.data)); }
public static void Postfix(string name) { string serializedProxy = SaveGameSlots.LoadDataFromSlot(name, "ModHealthManager"); SaveProxy proxy = new SaveProxy(); if (!string.IsNullOrEmpty(serializedProxy)) { proxy = MelonLoader.TinyJSON.JSON.Load(serializedProxy).Make <SaveProxy>(); } ModHealthManager.SetData(GetData(proxy)); }