public bool LoadSettings() { if (Modulator.Storage == null) { return(false); } string rawData; bool loadedSomething = false; if (Modulator.Storage.TryGetValue(Session.Instance.ModulatorSettingsGuid, out rawData)) { ModulatorSettingsValues loadedSettings = null; var base64 = Convert.FromBase64String(rawData); loadedSettings = MyAPIGateway.Utilities.SerializeFromBinary <ModulatorSettingsValues>(base64); if (loadedSettings != null) { Settings = loadedSettings; loadedSomething = true; } if (Session.Enforced.Debug == 3) { Log.Line($"Loaded - ModulatorId [{Modulator.EntityId}]:\n{Settings.ToString()}"); } } return(loadedSomething); }
internal void UpdateSettings(ModulatorSettingsValues newSettings) { if (newSettings.MId > ModSet.Settings.MId) { SettingsUpdated = true; ModSet.Settings = newSettings; if (Session.Enforced.Debug == 3) { Log.Line("UpdateSettings for modulator"); } } }
internal void UpdateSettings(ModulatorSettingsValues newSettings) { if (newSettings.MId > ModSet.Settings.MId) { SettingsUpdated = true; if (ModSet.Settings.ModulateDamage != newSettings.ModulateDamage) { ModUi.ComputeDamage(this, newSettings.ModulateDamage); } ModSet.Settings = newSettings; if (Session.Enforced.Debug == 3) { Log.Line("UpdateSettings for modulator"); } } }
public DataModulatorSettings(long entityId, ModulatorSettingsValues settings) : base(entityId) { Settings = settings; }