Beispiel #1
0
        public override void Entry(IModHelper helper)
        {
            if (helper.ModRegistry.IsLoaded("Entoarox.ExtendedMinecart"))
            {
                DesertWarpX -= 2;
            }
            var savesFolder = $"{helper.DirectoryPath}{Path.DirectorySeparatorChar}saves";

            if (!Directory.Exists(savesFolder))
            {
                Directory.CreateDirectory(savesFolder);
            }
            this.modifier          = new AssetModifier(helper, this.Monitor, DesertWarpX);
            this.savedTempObelisks = new List <DesertObelisk>();
            this.obeliskBlueprint  = new BluePrint("Desert Obelisk");

            SaveEvents.AfterLoad          += this.AfterLoad;
            SaveEvents.AfterReturnToTitle += (sender, args) => this.Unsubscribe();
            MenuEvents.MenuChanged        += this.MenuChanged;
            MenuEvents.MenuClosed         += this.MenuClosed;
        }
Beispiel #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)
        {
            if (helper.ModRegistry.IsLoaded("Entoarox.ExtendedMinecart"))
            {
                DesertWarpX -= 2;
            }

            DirectoryInfo savesFolder = new DirectoryInfo(Path.Combine(helper.DirectoryPath, "saves"));

            if (!savesFolder.Exists)
            {
                savesFolder.Create();
            }

            this.modifier          = new AssetModifier(helper, this.Monitor, DesertWarpX);
            this.savedTempObelisks = new List <DesertObelisk>();
            this.obeliskBlueprint  = new BluePrint("Desert Obelisk");

            helper.Events.GameLoop.SaveLoaded      += this.OnSaveLoaded;
            helper.Events.GameLoop.ReturnedToTitle += (sender, args) => this.Unsubscribe();
            helper.Events.Display.MenuChanged      += this.OnMenuChanged;
        }