Exemplo n.º 1
0
        public Propulsion(Item item, XElement element)
            : base(item, element)
        {
            switch (element.GetAttributeString("usablein", "both").ToLowerInvariant())
            {
            case "air":
                usableIn = UsableIn.Air;
                break;

            case "water":
                usableIn = UsableIn.Water;
                break;

            case "both":
            default:
                usableIn = UsableIn.Both;
                break;
            }
        }
Exemplo n.º 2
0
        public void RegisterModConfigMenu(IManifest manifest)
        {
            if (!ModEntry.helper.ModRegistry.IsLoaded("spacechase0.GenericModConfigMenu"))
            {
                return;
            }

            var api = ModEntry.helper.ModRegistry.GetApi <integration.IGMCMAPI>("spacechase0.GenericModConfigMenu");

            api.Register(manifest, ResetToDefault, ApplyConfig);

            api.AddNumberOption(manifest,
                                () => DaysToProduce,
                                (n) => DaysToProduce = n,
                                () => i18n.Get("config.daysToProduce.name"),
                                () => i18n.Get("config.daysToProduce.desc"),
                                1, 7
                                );
            api.AddNumberOption(manifest,
                                () => FlowerRange,
                                (n) => FlowerRange = n,
                                () => i18n.Get("config.flowerRange.name"),
                                () => i18n.Get("config.flowerRange.desc"),
                                1, 14
                                );
            api.AddTextOption(manifest,
                              () => UsableIn.ToString(),
                              (s) => UsableIn = (UsableOptions)Enum.Parse(typeof(UsableOptions), s),
                              () => i18n.Get("config.usableIn.name"),
                              () => i18n.Get("config.usableIn.desc"),
                              Enum.GetNames(typeof(UsableOptions)),
                              (s) => TranslatedOption("usableOptions", s)
                              );
            api.AddTextOption(manifest,
                              () => ProduceInWinter.ToString(),
                              (s) => ProduceInWinter = (ProduceWhere)Enum.Parse(typeof(ProduceWhere), s),
                              () => i18n.Get("config.produceInWinter.name"),
                              () => i18n.Get("config.produceInWinter.desc"),
                              Enum.GetNames(typeof(ProduceWhere)),
                              (s) => TranslatedOption("produceWhere", s)
                              );
            api.AddTextOption(manifest,
                              () => UsePottedFlowers.ToString(),
                              (s) => UsePottedFlowers = (ProduceWhere)Enum.Parse(typeof(ProduceWhere), s),
                              () => i18n.Get("config.usePottedFlowers.name"),
                              () => i18n.Get("config.usePottedFlowers.desc"),
                              Enum.GetNames(typeof(ProduceWhere)),
                              (s) => TranslatedOption("produceWhere", s)
                              );
            api.AddBoolOption(manifest,
                              () => UseForageFlowers,
                              (b) => UseForageFlowers = b,
                              () => i18n.Get("config.useForage.name"),
                              () => i18n.Get("config.useForage.desc")
                              );
            api.AddBoolOption(manifest,
                              () => UseQuality,
                              (b) => UseQuality = b,
                              () => i18n.Get("config.useQuality.name"),
                              () => i18n.Get("config.useQuality.desc")
                              );
            api.AddNumberOption(manifest,
                                () => BearBoost,
                                (n) => BearBoost = n,
                                () => i18n.Get("config.bearBoost.name"),
                                () => i18n.Get("config.bearBoost.desc"),
                                1f, 3f, .05f
                                );
            api.AddPageLink(manifest, "price", () => i18n.Get("config.price.name"), () => i18n.Get("config.price.desc"));
            api.AddPageLink(manifest, "integration", () => i18n.Get("config.integration.name"), () => i18n.Get("config.integration.desc"));

            //integration
            api.AddPage(manifest, "integration", () => i18n.Get("config.integration.name"));
            if (ModEntry.helper.ModRegistry.IsLoaded("aedenthorn.ParticleEffects"))
            {
                api.AddBoolOption(manifest,
                                  () => Particles,
                                  (b) => Particles = b,
                                  () => i18n.Get("config.particles.name"),
                                  () => i18n.Get("config.particles.desc")
                                  );
            }
            api.AddBoolOption(manifest,
                              () => PatchAutomate,
                              (b) => PatchAutomate = b,
                              () => i18n.Get("config.patchAutomate.name"),
                              () => i18n.Get("config.patchAutomate.desc")
                              );
            api.AddBoolOption(manifest,
                              () => PatchPFM,
                              (b) => PatchPFM = b,
                              () => i18n.Get("config.patchPFM.name"),
                              () => i18n.Get("config.patchPFM.desc")
                              );

            //price balancing
            api.AddPage(manifest, "price", () => i18n.Get("config.price.name"));
            api.AddNumberOption(manifest,
                                () => ValueMultiplier,
                                (n) => ValueMultiplier = n,
                                () => i18n.Get("config.valueMultiplier.name"),
                                () => i18n.Get("config.valueMultiplier.desc"),
                                .1f, 2f, .1f
                                );
            api.AddNumberOption(manifest,
                                () => CapFactor,
                                (v) => CapFactor = v,
                                () => i18n.Get("config.capFactor.name"),
                                () => i18n.Get("config.capFactor.desc"),
                                100
                                );
            api.AddNumberOption(manifest,
                                () => CapCurve,
                                (v) => CapCurve = v,
                                () => i18n.Get("config.capCurve.name"),
                                () => i18n.Get("config.capCurve.desc"),
                                0f, 1f, .01f
                                );
        }