public static void VerifyConfigValues(MaritimeSecretsConfig config, MaritimeSecrets mod)
 {
     if (config.MarinerSpeechType < 0 || config.MarinerSpeechType >= SpeechChoices.Length)
     {
         config.MarinerSpeechType = 0;
         mod.DebugLog("At least one config value was out of range and was reset.");
         mod.Helper.WriteConfig(config);
     }
 }
        public static void SetUpModConfigMenu(MaritimeSecretsConfig config, MaritimeSecrets mod)
        {
            IGenericModConfigMenuApi api = mod.Helper.ModRegistry.GetApi <IGenericModConfigMenuApi>("spacechase0.GenericModConfigMenu");

            if (api == null)
            {
                return;
            }

            var manifest = mod.ModManifest;

            api.RegisterModConfig(manifest, () => config = new MaritimeSecretsConfig(), delegate { mod.Helper.WriteConfig(config); VerifyConfigValues(config, mod); });

            api.AddTextOption(manifest, () => GetElementFromConfig(SpeechChoices, config.MarinerSpeechType), (string val) => config.MarinerSpeechType = GetIndexFromArrayElement(SpeechChoices, val), () => mod.Helper.Translation.Get("ConfigMarinerSpeechType"), null, SpeechChoices, (s) => TranslateSpeechChoice(s, mod));
            api.AddBoolOption(manifest, () => config.ChangePendantPriceToPearl, (bool val) => config.ChangePendantPriceToPearl = val, () => mod.Helper.Translation.Get("ConfigChangePendantPriceToPearl"));
        }