internal void SaveToFile() { if (this.Data != null) { ModCustomDataFileHelpers.SaveAsJson <InboxMessageData>(ModHelpersMod.Instance, "Inbox", true, this.Data); } }
private void UnloadModData() { if (this.Data != null) { ModCustomDataFileHelpers.SaveAsJson <ModHelpersData>(this, "data", true, this.Data); } this.Data = new ModHelpersData(); }
public void Save() { var mymod = ResetModeMod.Instance; if (Main.netMode == 1) { LogHelpers.Warn("Clients cannot save config to file"); return; } ModCustomDataFileHelpers.SaveAsJson(mymod, SessionLogic.DataFileNameOnly, true, this.Data); }
public void Save(string baseFileName) { var mymod = RewardsMod.Instance; try { if (mymod.SettingsConfig.DebugModeSaveKillsAsJson) { ModCustomDataFileHelpers.SaveAsJson(mymod, baseFileName, true, this); // false? } else { ModCustomDataFileHelpers.SaveAsBinaryJson(mymod, baseFileName, true, this); // false? } } catch (IOException e) { throw new ModHelpersException("Failed to save file: " + baseFileName, e); } }