Пример #1
0
 private void GameLoop_SaveLoaded(object sender, StardewModdingAPI.Events.SaveLoadedEventArgs e)
 {
     if (Context.IsMultiplayer)
     {
         this.Monitor.Log("Companions not initalized, because multiplayer currently unsupported in NPC Adventures.", LogLevel.Warn);
         return;
     }
     this.companionManager.InitializeCompanions(this.contentLoader, this.Helper.Events, this.SpecialEvents, this.Helper.Reflection);
 }
Пример #2
0
        void GameLoop_SaveLoaded(object sender, StardewModdingAPI.Events.SaveLoadedEventArgs e)
        {
            Composting.Load();
            Cultivation.Load();
            Pests.Load();

            /*
             * for (int i = 0; i < 10; i++)
             *  Helper.ConsoleCommands.Trigger("player_add", new string[2] { "name", "Seed Maker" });
             * Helper.ConsoleCommands.Trigger("player_add", new string[3] { "name", "Melon", "100" });
             *
             */
        }
Пример #3
0
        void GameLoop_SaveLoaded(object sender, StardewModdingAPI.Events.SaveLoadedEventArgs e)
        {
            SaveData data = null;

            try
            {
                data = Helper.Data.ReadSaveData <SaveData>(nameof(SaveData));
            }
            finally
            {
                if (data == null)
                {
                    Monitor.Log($"No save data with key '{nameof(SaveData)}' found");
                    data = new SaveData();
                }
                data.InitNullValues();

                Composting.Load(data);
                Cultivation.Load(data);
                Pests.Load(data);
            }
        }
Пример #4
0
        public static void GameLoop_SaveLoaded(object sender, StardewModdingAPI.Events.SaveLoadedEventArgs e)
        {
            Monitor.Log($"total apps: {ModEntry.apps.Count}");
            PhoneUtils.OrderApps();
            PhoneUtils.RefreshPhoneLayout();
            Helper.Events.Display.RenderedWorld += PhoneVisuals.Display_RenderedWorld;

            if (ModEntry.npcAdventureModApi != null)
            {
                Monitor.Log("Testing NpcAdventureModApi...");
                try
                {
                    Monitor.Log($"Can recruit: {ModEntry.npcAdventureModApi.CanRecruitCompanions()}");
                    Monitor.Log($"Possible companions: {ModEntry.npcAdventureModApi.GetPossibleCompanions().Count()}");
                    Monitor.Log($"Can recruit Abigail: {ModEntry.npcAdventureModApi.IsPossibleCompanion("Abigail")}");
                    Monitor.Log($"Recruit Abigail: {ModEntry.npcAdventureModApi.IsPossibleCompanion("Abigail") && ModEntry.npcAdventureModApi.RecruitCompanion(Game1.player, Game1.getCharacterFromName("Abigail"))}");
                }
                catch (Exception ex)
                {
                    Monitor.Log($"Error testing NpcAdventureModApi: {ex}", LogLevel.Warn);
                }
                Monitor.Log("Testing NpcAdventureModApi finished");
            }
        }
Пример #5
0
 private void GameLoop_SaveLoaded(object sender, StardewModdingAPI.Events.SaveLoadedEventArgs e)
 {
     this.companionManager.InitializeCompanions(this.contentLoader, this.Helper.Events);
 }
Пример #6
0
 private void GameLoop_SaveLoadedSlow(object sender, StardewModdingAPI.Events.SaveLoadedEventArgs e)
 {
     Monitor.Log($"[{timer.Elapsed.TotalMilliseconds:N}][Slow] Save Loaded", LogLevel.Info);
 }
Пример #7
0
 private void GameLoop_SaveLoaded(object sender, StardewModdingAPI.Events.SaveLoadedEventArgs e)
 {
     LockpickItemId = Helper.ModRegistry.GetApi <JsonAssets.IApi>("spacechase0.JsonAssets").GetObjectId("Lockpick");
     Monitor.Log("Lockpick item ID: " + LockpickItemId, LogLevel.Trace);
     Helper.Events.Multiplayer.ModMessageReceived += Multiplayer_ModMessageReceived;
 }