Beispiel #1
0
        private void GameLoop_GameLaunched(object sender, StardewModdingAPI.Events.GameLaunchedEventArgs e)
        {
            var GMCMapi = Helper.ModRegistry.GetApi <IGMCMApi>("spacechase0.GenericModConfigMenu");

            if (GMCMapi != null)
            {
                GMCMapi.RegisterModConfig(ModManifest, () => ModConfig = new FishConfig(), () => Helper.WriteConfig(ModConfig));
                GMCMapi.RegisterSimpleOption(ModManifest, "Splash Sound", "Disable to stop the splash sound on jump", () => ModConfig.SplashSound, (bool val) => ModConfig.SplashSound = val);
                GMCMapi.RegisterSimpleOption(ModManifest, "Legendaries Jump After Catch", "If enabled, legendaries will jump after you catch them.", () => ModConfig.LegendariesJumpAfterCatch, (bool val) => ModConfig.LegendariesJumpAfterCatch = val);
                GMCMapi.RegisterClampedOption(ModManifest, "Jumping Fish", "The number of jumping fish. Minimum 2. Note that large numbers may lag a computer.", () => ModConfig.NumberOfJumpingFish, (int val) => ModConfig.NumberOfJumpingFish  = val, 2, 1000);
                GMCMapi.RegisterSimpleOption(ModManifest, "Jump Chance", "Controls the jump chance per pond every 10 minutes.", () => ModConfig.JumpChance,
                                             (float val) => ModConfig.JumpChance = val);
            }
        }
Beispiel #2
0
        public override void Entry(IModHelper helper)
        {
            _jumpingFish        = new List <JumpFish>();
            _validFishLocations = new Dictionary <Vector2, int>();

            var harmony = HarmonyInstance.Create("koihimenakamura.happyfishjump");

            harmony.PatchAll();
            Monitor.Log("Patching JumpingFish.Splash with a transpiler", LogLevel.Trace);

            ModConfig = Helper.ReadConfig <FishConfig>();

            Helper.Events.Player.Warped         += Player_Warped;
            Helper.Events.Display.RenderedWorld += Display_RenderedWorld;
            Helper.Events.GameLoop.GameLaunched += GameLoop_GameLaunched;
            Helper.Events.GameLoop.UpdateTicked += GameLoop_UpdateTicked;
            Helper.Events.GameLoop.TimeChanged  += GameLoop_TimeChanged;
        }