예제 #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)
        {
            instance = this;

            Util.WHITE_1X1 = new Texture2D(Game1.graphics.GraphicsDevice, 1, 1);
            Util.WHITE_1X1.SetData(new Color[] { Color.White });

            Log.info("Loading Config");
            ModConfig = Helper.ReadConfig <MultiplayerConfig>();

            helper.Events.GameLoop.UpdateTicked += OnUpdateTicked;
            helper.Events.Display.RenderingHud  += OnRenderingHud;
            helper.Events.Player.Warped         += OnWarped;
            helper.Events.Input.ButtonPressed   += OnButtonPressed;
            helper.Events.GameLoop.Saving       += OnSaving;

            Helper.ConsoleCommands.Add("player_unstuck", "...", unstuckCommand);
            Helper.ConsoleCommands.Add("player_sleep", "...", sleepCommand);
            Helper.ConsoleCommands.Add("player_unsleep", "...", unsleepCommand);

            if (DEBUG)
            {
                a = Assembly.GetAssembly(typeof(StardewValley.Game1));
                Util.SetStaticField(a.GetType("StardewValley.Program"), "releaseBuild", false);
            }
        }
예제 #2
0
        public override void Entry(IModHelper helper)
        {
            instance = this;

            Util.WHITE_1X1 = new Texture2D(Game1.graphics.GraphicsDevice, 1, 1);
            Util.WHITE_1X1.SetData(new Color[] { Color.White });

            Log.info("Loading Config");
            ModConfig = Helper.ReadConfig <MultiplayerConfig>();

            GameEvents.UpdateTick += onUpdate;
            GraphicsEvents.OnPreRenderHudEvent    += onPreDraw;
            LocationEvents.CurrentLocationChanged += onCurrentLocationChange;
            ControlEvents.KeyboardChanged         += onKeyboardChange;
            SaveEvents.BeforeSave += onBeforeSave;

            Helper.ConsoleCommands.Add("player_unstuck", "...", unstuckCommand);
            Helper.ConsoleCommands.Add("player_sleep", "...", sleepCommand);
            Helper.ConsoleCommands.Add("player_unsleep", "...", unsleepCommand);

            if (DEBUG)
            {
                a = Assembly.GetAssembly(typeof(StardewValley.Game1));
                Util.SetStaticField(a.GetType("StardewValley.Program"), "releaseBuild", false);
            }
        }
예제 #3
0
        public override void Entry(IModHelper helper)
        {
            instance = this;
            Log.info("Loading Config");
            ModConfig = Helper.ReadConfig <MultiplayerConfig>();

            GameEvents.UpdateTick += onUpdate;
            GraphicsEvents.OnPreRenderHudEvent    += onPreDraw;
            LocationEvents.CurrentLocationChanged += onCurrentLocationChange;
            ControlEvents.KeyboardChanged         += onKeyboardChange;

            //GraphicsEvents.DrawDebug += Multiplayer.drawNetworkingDebug;

            if (DEBUG)
            {
                a = Assembly.GetAssembly(typeof(StardewValley.Game1));
                Util.SetStaticField(a.GetType("StardewValley.Program"), "releaseBuild", false);
            }
        }