Ejemplo n.º 1
0
        /// <summary>The mod entry point, called after the mod is first loaded.</summary>
        /// <param name="helper">Provides simplified APIs for writing mods.</param>
        public override void Entry(IModHelper helper)
        {
            Dice             = new Xoshiro.PRNG64.XoShiRo256starstar();
            Translation      = Helper.Translation;
            ModConfig        = Helper.ReadConfig <MoonConfig>();
            OurMoon          = new SDVMoon(ModConfig, Dice, Helper.Translation, Monitor);
            ContentManager   = Helper.Content;
            MPHandler        = Helper.Multiplayer;
            OurIcons         = new Sprites.Icons(Helper.Content);
            queuedMsg        = null;
            BloodMoonTracker = new List <string>();

            helper.Events.GameLoop.GameLaunched          += OnGameLaunched;
            helper.Events.GameLoop.OneSecondUpdateTicked += OnOneSecondUpdateTicked;
            helper.Events.GameLoop.TimeChanged           += OnTimeChanged;
            helper.Events.GameLoop.DayStarted            += OnDayStarted;
            helper.Events.GameLoop.DayEnding             += GameLoop_DayEnding;
            helper.Events.GameLoop.SaveLoaded            += GameLoop_SaveLoaded;
            helper.Events.GameLoop.Saving            += OnSaving;
            helper.Events.GameLoop.UpdateTicked      += OnUpdateTicked;
            helper.Events.Display.RenderedActiveMenu += OnRenderedActiveMenu;
            helper.Events.Display.MenuChanged        += OnMenuChanged;
            helper.Events.Player.Warped                  += OnWarped;
            helper.Events.GameLoop.ReturnedToTitle       += OnReturnedToTitle;
            helper.Events.Multiplayer.ModMessageReceived += OnModMessageRecieved;

            SpaceEvents.ChooseNightlyFarmEvent += SpaceEvents_ChooseNightlyFarmEvent;

            helper.ConsoleCommands.Add("force_bloodmoon", "Forces a bloodmoon", ForceBloodMoon)
            .Add("force_bloodmoonoff", "Turns bloodmoon off.", TurnBloodMoonOff)
            .Add("show_mooninfo", "Show moon info", ShowMoonInfo)
            .Add("force_eclipseOn", "Turns eclipse on.", OurMoon.TurnEclipseOn);
        }
Ejemplo n.º 2
0
        /// <summary>The mod entry point, called after the mod is first loaded.</summary>
        /// <param name="helper">Provides simplified APIs for writing mods.</param>
        public override void Entry(IModHelper helper)
        {
            Dice             = new MersenneTwister();
            Translation      = Helper.Translation;
            ModConfig        = Helper.ReadConfig <MoonConfig>();
            OurMoon          = new SDVMoon(ModConfig, Dice, Helper.Translation);
            ContentManager   = Helper.Content;
            OurIcons         = new Sprites.Icons(Helper.Content);
            queuedMsg        = null;
            BloodMoonTracker = new List <string>();

            helper.Events.GameLoop.GameLaunched          += OnGameLaunched;
            helper.Events.GameLoop.OneSecondUpdateTicked += OnOneSecondUpdateTicked;
            helper.Events.GameLoop.TimeChanged           += OnTimeChanged;
            helper.Events.GameLoop.DayStarted            += OnDayStarted;
            helper.Events.GameLoop.DayEnding             += GameLoop_DayEnding;
            helper.Events.GameLoop.Saving            += OnSaving;
            helper.Events.GameLoop.UpdateTicked      += OnUpdateTicked;
            helper.Events.Display.RenderedActiveMenu += OnRenderedActiveMenu;
            helper.Events.Display.MenuChanged        += OnMenuChanged;
            helper.Events.Player.Warped            += OnWarped;
            helper.Events.GameLoop.ReturnedToTitle += OnReturnedToTitle;

            helper.ConsoleCommands.Add("force_bloodmoon", "Forces a bloodmoon", ForceBloodMoon)
            .Add("force_bloodmoonoff", "Turns bloodmoon off.", TurnBloodMoonOff)
            .Add("force_eclipseOn", "Turns eclipse on.", TurnEclipseOn);
        }
Ejemplo n.º 3
0
        /// <summary>The mod entry point, called after the mod is first loaded.</summary>
        /// <param name="helper">Provides simplified APIs for writing mods.</param>
        public override void Entry(IModHelper helper)
        {
            Dice        = new MersenneTwister();
            Translation = Helper.Translation;
            ModConfig   = Helper.ReadConfig <MoonConfig>();
            OurMoon     = new SDVMoon(ModConfig, Dice, Helper.Translation);
            OurIcons    = new Sprites.Icons(Helper.Content);

            helper.Events.GameLoop.GameLaunched          += OnGameLaunched;
            helper.Events.GameLoop.OneSecondUpdateTicked += OnOneSecondUpdateTicked;
            helper.Events.GameLoop.TimeChanged           += OnTimeChanged;
            helper.Events.GameLoop.DayStarted            += OnDayStarted;
            helper.Events.GameLoop.Saving            += OnSaving;
            helper.Events.GameLoop.UpdateTicked      += OnUpdateTicked;
            helper.Events.Display.RenderedActiveMenu += OnRenderedActiveMenu;
            helper.Events.Display.MenuChanged        += OnMenuChanged;
            helper.Events.Player.Warped            += OnWarped;
            helper.Events.GameLoop.ReturnedToTitle += OnReturnedToTitle;
        }