コード例 #1
0
        public override void Entry(IModHelper helper)
        {
            Config = Helper.ReadConfig <ScytheConfig>();

            Helper.Events.GameLoop.GameLaunched += delegate { ScytheConfig.SetUpModConfigMenu(Config, this); };

            Patcher.PatchAll(this);
        }
コード例 #2
0
        public static void SetUpModConfigMenu(ScytheConfig config, EnchantableScythes mod)
        {
            IGenericModConfigMenuAPI api = mod.Helper.ModRegistry.GetApi <IGenericModConfigMenuAPI>("spacechase0.GenericModConfigMenu");

            if (api == null)
            {
                return;
            }

            var manifest = mod.ModManifest;

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

            api.RegisterLabel(manifest, "Enchanting", null);

            api.RegisterSimpleOption(manifest, "Enchantable Scythes", null, () => config.EnchantableScythes, (bool val) => config.EnchantableScythes = val);
            api.RegisterSimpleOption(manifest, "Scythes Can Only Get Haymaker", null, () => config.ScythesCanOnlyGetHaymaker, (bool val) => config.ScythesCanOnlyGetHaymaker = val);
            api.RegisterSimpleOption(manifest, "Other Weapons Cannot\nGet Haymaker Anymore", null, () => config.OtherWeaponsCannotGetHaymakerAnymore, (bool val) => config.OtherWeaponsCannotGetHaymakerAnymore = val);

            api.RegisterLabel(manifest, "Fixes", null);

            api.RegisterSimpleOption(manifest, "Golden Scythe Respawns", null, () => config.GoldenScytheRespawns, (bool val) => config.GoldenScytheRespawns = val);
        }