コード例 #1
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();
        }
コード例 #2
0
 public InventorySaver(IModHelper modHelper, IMonitor monitor, IConvenientChestsAPI convenientChestsAPI)
 {
     _modHelper           = modHelper;
     _monitor             = monitor;
     _convenientChestsAPI = convenientChestsAPI;
 }