Ejemplo n.º 1
0
        /*********
        ** Private methods
        *********/
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            JsonAssets = ModHelper.ModRegistry.GetApi <IJsonAssetsApi>("spacechase0.JsonAssets");
            if (JsonAssets is null)
            {
                Monitor.Log("JsonAssets is needed to load Mega Storage chests", LogLevel.Error);
                return;
            }

            ConvenientChests = ModHelper.ModRegistry.GetApi <IConvenientChestsApi>("aEnigma.ConvenientChests");
            if (!(ConvenientChests is null))
            {
                ModConfig.Instance.LargeChest.EnableCategories = false;
                ModConfig.Instance.MagicChest.EnableCategories = false;
                ModConfig.Instance.SuperMagicChest.EnableChest = false;
            }

            if (ModConfig.Instance.LargeChest.EnableChest)
            {
                JsonAssets.LoadAssets(Path.Combine(ModHelper.DirectoryPath, "assets", "LargeChest"));
            }
            if (ModConfig.Instance.MagicChest.EnableChest)
            {
                JsonAssets.LoadAssets(Path.Combine(ModHelper.DirectoryPath, "assets", "MagicChest"));
            }
            if (ModConfig.Instance.SuperMagicChest.EnableChest)
            {
                JsonAssets.LoadAssets(Path.Combine(ModHelper.DirectoryPath, "assets", "SuperMagicChest"));
            }

            JsonAssets.IdsAssigned += OnIdsAssigned;
            ItemPatcher.Start();
            SaveManager.Start();
            StateManager.Start();
        }
Ejemplo n.º 2
0
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            IConvenientChestsAPI convenientChestsAPI = Helper.ModRegistry.GetApi <IConvenientChestsAPI>("aEnigma.ConvenientChests");

            if (convenientChestsAPI != null)
            {
                Monitor.Log("Convenient Chests found, integration enabled");
            }
            else
            {
                convenientChestsAPI = new MockConvenientChestsAPI();
            }

            var itemPatcher     = new ItemPatcher(Helper, Monitor);
            var spritePatcher   = new SpritePatcher(Helper, Monitor);
            var farmhandMonitor = new FarmhandMonitor(Helper, Monitor);
            var savers          = new ISaver[]
            {
                new InventorySaver(Helper, Monitor, convenientChestsAPI),
                new FarmhandInventorySaver(Helper, Monitor, convenientChestsAPI),
                new LocationSaver(Helper, Monitor, convenientChestsAPI),
                new LocationInventorySaver(Helper, Monitor, convenientChestsAPI)
            };
            var saveManager = new SaveManager(Helper, Monitor, farmhandMonitor, savers);

            Helper.ReadConfig <ModConfig>();
            Helper.Content.AssetEditors.Add(spritePatcher);
            itemPatcher.Start();
            saveManager.Start();
        }
Ejemplo n.º 3
0
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            var itemPatcher     = new ItemPatcher(Helper, Monitor);
            var spritePatcher   = new SpritePatcher(Helper, Monitor);
            var farmhandMonitor = new FarmhandMonitor(Helper, Monitor);
            var savers          = new ISaver[]
            {
                new InventorySaver(Helper, Monitor),
                new FarmhandInventorySaver(Helper, Monitor),
                new LocationSaver(Helper, Monitor),
                new LocationInventorySaver(Helper, Monitor)
            };
            var saveManager = new SaveManager(Helper, Monitor, farmhandMonitor, savers);

            Helper.ReadConfig <ModConfig>();
            Helper.Content.AssetEditors.Add(spritePatcher);
            itemPatcher.Start();
            saveManager.Start();
        }
Ejemplo n.º 4
0
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            var convenientChestsApi = Helper.ModRegistry.GetApi <IConvenientChestsApi>("aEnigma.ConvenientChests");

            var spritePatcher = new SpritePatcher(Helper, Monitor);
            var itemPatcher   = new ItemPatcher(Helper, Monitor);
            var menuChanger   = new MenuChanger(Helper, Monitor);
            var saveManager   = new SaveManager(Helper, Monitor,
                                                new FarmhandMonitor(Helper, Monitor),
                                                new InventorySaver(Helper, Monitor, convenientChestsApi),
                                                new FarmhandInventorySaver(Helper, Monitor, convenientChestsApi),
                                                new LocationSaver(Helper, Monitor, convenientChestsApi),
                                                new LocationInventorySaver(Helper, Monitor, convenientChestsApi));

            Helper.ReadConfig <ModConfig>();
            Helper.Content.AssetEditors.Add(spritePatcher);
            itemPatcher.Start();
            saveManager.Start();
            menuChanger.Start();
        }