/// <summary> /// Sets a <see cref="string"/> value in the modded settings /// </summary> /// <param name="owner">The <see cref="Mod"/> that owns this setting</param> /// <param name="saveID">The id of the setting</param> /// <param name="value">The value you want to set the setting to</param> /// <param name="writeToFile"><see langword="true"/> if the setting should be written to the save file immediately, <see langword="false"/> if not. It is recommended to set this to <see langword="false"/> and then calling <see cref="WriteSettingsToFile"/> if you set values often</param> public static void SetModdedSettingsStringValue(Mod owner, string saveID, string value, bool writeToFile = true) { if (value == null) { throw new ArgumentNullException(nameof(value)); } OptionsSaver.SetSetting(owner, saveID, value, writeToFile); }
public static void SetModdedSettingsStringValue(Mod mod, string id, string value) { if (value == null) { throw new ArgumentNullException(nameof(value)); } OptionsSaver.SetSetting(mod, id, value, true); }
/// <summary> /// Sets a <see cref="KeyCode"/> value in the loaded settings /// </summary> /// <param name="mod">The <see cref="Mod"/> that owns this setting</param> /// <param name="id">The id of the setting</param> /// <param name="value">The value you want to set the setting to</param> /// <param name="writeToFile"><see langword="true"/> if the setting should be written to the save file immediately, <see langword="false"/> if not. It is recommended to set this to <see langword="false"/> and then calling <see cref="WriteSettingsToFile"/> if you set values often</param> public static void SetModdedSettingsKeyCodeValue(Mod mod, string id, KeyCode value, bool writeToFile = true) { OptionsSaver.SetSetting(mod, id, (int)value, writeToFile); }
/// <summary> /// Sets a <see langword="bool"/> value in the loaded settings /// </summary> /// <param name="mod">The <see cref="Mod"/> that owns this setting</param> /// <param name="id">The id of the setting</param> /// <param name="value">The value you want to set the setting to</param> /// <param name="writeToFile"><see langword="true"/> if the setting should be written to the save file immediately, <see langword="false"/> if not. It is recommended to set this to <see langword="false"/> and then calling <see cref="WriteSettingsToFile"/> if you set values often</param> public static void SetModdedSettingsBoolValue(Mod mod, string id, bool value, bool writeToFile = true) { OptionsSaver.SetSetting(mod, id, value, writeToFile); }
/// <summary> /// Sets a <see langword="int"/> value in the loaded settings /// </summary> /// <param name="owner">The <see cref="Mod"/> that owns this setting</param> /// <param name="saveID">The id of the setting</param> /// <param name="value">The value you want to set the setting to</param> /// <param name="writeToFile"><see langword="true"/> if the setting should be written to the save file immediately, <see langword="false"/> if not. It is recommended to set this to <see langword="false"/> and then calling <see cref="WriteSettingsToFile"/> if you set values often</param> public static void SetModdedSettingsIntValue(Mod owner, string saveID, int value, bool writeToFile = true) { OptionsSaver.SetSetting(owner, saveID, value, writeToFile); }
public static void SetModdedSettingsIntValue(Mod mod, string id, int value) { OptionsSaver.SetSetting(mod, id, value, true); }