コード例 #1
0
        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);
        }
コード例 #2
0
 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");
         }
     }
 }
コード例 #3
0
        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");
                }
            }
        }
コード例 #4
0
 public DataModulatorSettings(long entityId, ModulatorSettingsValues settings) : base(entityId)
 {
     Settings = settings;
 }