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); }
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" }); * */ }
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); } }
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"); } }
private void GameLoop_SaveLoaded(object sender, StardewModdingAPI.Events.SaveLoadedEventArgs e) { this.companionManager.InitializeCompanions(this.contentLoader, this.Helper.Events); }
private void GameLoop_SaveLoadedSlow(object sender, StardewModdingAPI.Events.SaveLoadedEventArgs e) { Monitor.Log($"[{timer.Elapsed.TotalMilliseconds:N}][Slow] Save Loaded", LogLevel.Info); }
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; }