Exemplo n.º 1
0
        private void GameLoop_UpdateTicked(object sender, StardewModdingAPI.Events.UpdateTickedEventArgs e)
        {
            if (e.Ticks > 1)
            {
                japi = Helper.ModRegistry.GetApi <JsonAssets.IApi>("spacechase0.JsonAssets");

                if (Helper.ModRegistry.IsLoaded("FlashShifter.MarlonSVE"))
                {
                    japi.LoadAssets(Path.Combine(Helper.DirectoryPath, "assets", "SVE"));
                }
                else
                {
                    japi.LoadAssets(Path.Combine(Helper.DirectoryPath, "assets", "NSVE"));
                }

                Helper.Events.GameLoop.UpdateTicked -= GameLoop_UpdateTicked;
            }
        }
Exemplo n.º 2
0
        /*********
        ** Private methods
        *********/
        /****
        ** GameLoop Event handlers
        ****/
        /// <summary>
        /// Set up API integrations and instatiate Lotions (to handle JA items). Raised after the game is launched.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void onGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            ModConfig.SetUpMenu();

            JA = Helper.ModRegistry.GetApi <JsonAssets.IApi>("spacechase0.JsonAssets");
            if (JA != null)
            {
                JA.LoadAssets(Path.Combine(Helper.DirectoryPath, "assets", "JA"));
            }
            else
            {
                Monitor.LogOnce("Could not connect to Json Assets. It may not be installed or working properly.", LogLevel.Error);
            }

            Lotion = new Lotions();
        }