예제 #1
0
        public void RegisterModConfigMenu(IModHelper helper, IManifest manifest)
        {
            if (!helper.ModRegistry.IsLoaded("spacechase0.GenericModConfigMenu"))
            {
                return;
            }
            IGMCMAPI api = helper.ModRegistry.GetApi <IGMCMAPI>("spacechase0.GenericModConfigMenu");

            api.RegisterModConfig(manifest, ResetToDefault, () => helper.WriteConfig(this));
            api.SetDefaultIngameOptinValue(manifest, true);

            api.RegisterLabel(manifest, manifest.Name, manifest.Description);

            api.RegisterChoiceOption(
                manifest,
                helper.Translation.Get("cfg-warpsenabled.label"),
                helper.Translation.Get("cfg-warpsenabled.desc"),
                () => VanillaWarpsEnabled.ToString(),
                (string c) => VanillaWarpsEnabled = Utils.ParseEnum <WarpEnabled>(c),
                Enum.GetNames(typeof(WarpEnabled))
                );
            api.RegisterChoiceOption(
                manifest,
                helper.Translation.Get("cfg-farmenabled.label"),
                helper.Translation.Get("cfg-farmenabled.desc"),
                () => FarmWarpEnabled.ToString(),
                (string c) => FarmWarpEnabled = Utils.ParseEnum <WarpEnabled>(c),
                Enum.GetNames(typeof(WarpEnabled))
                );
            api.RegisterSimpleOption(
                manifest,
                helper.Translation.Get("cfg-accessdisabled.label"),
                helper.Translation.Get("cfg-accessdisabled.desc"),
                () => AccessFromDisabled,
                (bool b) => AccessFromDisabled = b
                );
            api.RegisterSimpleOption(
                manifest,
                helper.Translation.Get("cfg-accesswand.label"),
                helper.Translation.Get("cfg-accesswand.desc"),
                () => AccessFromWand,
                (bool b) => AccessFromWand = b
                );
            api.RegisterSimpleOption(
                manifest,
                helper.Translation.Get("cfg-obeliskpatch.label"),
                helper.Translation.Get("cfg-obeliskpatch.desc"),
                () => PatchObelisks,
                (bool b) => PatchObelisks = b
                );
            api.RegisterSimpleOption(
                manifest,
                helper.Translation.Get("cfg-menu.label"),
                helper.Translation.Get("cfg-menu.desc"),
                () => MenuEnabled,
                (bool b) => MenuEnabled = b
                );
        }
예제 #2
0
        public void RegisterModConfigMenu(IModHelper helper, IManifest manifest)
        {
            if (!helper.ModRegistry.IsLoaded("spacechase0.GenericModConfigMenu"))
            {
                return;
            }
            IGMCMAPI api = helper.ModRegistry.GetApi <IGMCMAPI>("spacechase0.GenericModConfigMenu");

            api.RegisterModConfig(manifest, ResetToDefault, () => helper.WriteConfig(this));
            api.SetDefaultIngameOptinValue(manifest, true);

            api.RegisterLabel(manifest, manifest.Name, manifest.Description);

            api.RegisterSimpleOption(
                manifest,
                helper.Translation.Get("cfg-afterobelisk.label"),
                helper.Translation.Get("cfg-afterobelisk.desc"),
                () => AfterObelisk,
                (bool b) => AfterObelisk = b
                );
        }