Ejemplo n.º 1
0
        public string GenerateDefaultModSettings()
        {
            Logger.Debug("Generating default settings...");
            var settingsList = new List <string>();

            settingsList.Add(new TModSettings().Serialize());
            ModFeatures.ForEach(feature => settingsList.Add(feature.DefaultSettings.Serialize()));
            return(settingsList.Join());
        }
Ejemplo n.º 2
0
        private void Initialize(HarmonyInstance harmonyInstance, string settings)
        {
            Logger.Debug("Initializing Features...");
            ModSettings     = JsonHelpers.Deserialize <TModSettings>(settings) ?? new TModSettings();
            Logger.LogLevel = ModSettings.LogLevel;
            var jsonSettings = JsonHelpers.Deserialize(settings);

            ModFeatures.ForEach(
                feature => feature.Initialize(
                    harmonyInstance,
                    jsonSettings?[feature.Name]?.ToString(),
                    Logger,
                    Directory));
            Logger.Debug("Feature initialization complete.");
        }