/********* ** Private methods *********/ /**** ** Event handlers ****/ /// <summary>Raised after the player loads a save slot and the world is initialised.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { this.Stash.Clear(); }
private void onSaveLoaded(object sender, SaveLoadedEventArgs e) { NetController.OnSaveLoaded(); }
private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { JojaMail.ProcessPlayerMailbox(); this.Monitor.Log($"Processed player's mailbox to check for any scheduled JojaMail orders."); }
private static void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { CachedSapphireID = ExternalAPIs.JA.GetObjectId("Sapphire Pearl"); }
private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { Monitor.Log("Save loaded, resetting counters"); Calculator().Reset(); }
/********* ** Private methods *********/ /// <summary>Raised after the player loads a save slot.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { this.Locations = CJB.GetAllLocations().ToArray(); this.Cheats.Reset(); }
private void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e, IModHelper helper) { helper.Events.Display.RenderedWorld += Display_RenderedWorld; }
/// <summary>Raised after the player loads a save slot and the world is initialised.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { CustomTVMod.changeAction("weather", DisplayWeather); }
/// <inheritdoc cref="IGameLoopEvents.SaveLoaded"/> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { this.FixWarps(); }
/// <summary>Raised after the player loads a save slot and the world is initialised.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event data.</param> private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { DataLoader.ReloadQuestWhenClient(); }
private void OnLoadedSave(object sender, SaveLoadedEventArgs e) { this.Monitor.Log("Save Loaded!", LogLevel.Debug); this.SetLoadValues(e); }
private void GetFarm(object sender, SaveLoadedEventArgs e) { this.Farm = (StardewValley.Locations.BuildableGameLocation)Game1.locations.ToList().Find(x => x is Farm); }
//listeners private void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e) { this.niceMessages = new NiceMessages(mainHelper); }
public static void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e) { //load familiars //FamiliarsUtils.LoadFamiliars(); // load egg ids if (ModEntry.JsonAssets != null) { ModEntry.BatFamiliarEgg = ModEntry.JsonAssets.GetObjectId("Bat Familiar Egg"); ModEntry.DustFamiliarEgg = ModEntry.JsonAssets.GetObjectId("Dust Sprite Familiar Egg"); ModEntry.DinoFamiliarEgg = ModEntry.JsonAssets.GetObjectId("Dino Familiar Egg"); ModEntry.JunimoFamiliarEgg = ModEntry.JsonAssets.GetObjectId("Junimo Familiar Egg"); ModEntry.ButterflyFamiliarEgg = ModEntry.JsonAssets.GetObjectId("Butterfly Familiar Egg"); ModEntry.ButterflyDust = ModEntry.JsonAssets.GetObjectId("Butterfly Dust"); if (ModEntry.BatFamiliarEgg == -1) { Monitor.Log("Can't get ID for Familiars mod item #1. Some functionality will be lost."); } else { Monitor.Log(string.Format("Familiars mod item #1 ID is {0}.", ModEntry.BatFamiliarEgg)); } if (ModEntry.DustFamiliarEgg == -1) { Monitor.Log("Can't get ID for Familiars mod item #2. Some functionality will be lost."); } else { Monitor.Log(string.Format("Familiars mod item #2 ID is {0}.", ModEntry.DustFamiliarEgg)); } if (ModEntry.DinoFamiliarEgg == -1) { Monitor.Log("Can't get ID for Familiars mod item #3. Some functionality will be lost."); } else { Monitor.Log(string.Format("Familiars mod item #3 ID is {0}.", ModEntry.DinoFamiliarEgg)); } if (ModEntry.JunimoFamiliarEgg == -1) { Monitor.Log("Can't get ID for Familiars mod item #4. Some functionality will be lost."); } else { Monitor.Log(string.Format("Familiars mod item #4 ID is {0}.", ModEntry.JunimoFamiliarEgg)); } if (ModEntry.ButterflyFamiliarEgg == -1) { Monitor.Log("Can't get ID for Familiars mod item #5. Some functionality will be lost."); } else { Monitor.Log(string.Format("Familiars mod item #5 ID is {0}.", ModEntry.ButterflyFamiliarEgg)); } if (ModEntry.ButterflyDust == -1) { Monitor.Log("Can't get ID for Familiars mod item #6. Some functionality will be lost."); } else { Monitor.Log(string.Format("Familiars mod item #6 ID is {0}.", ModEntry.ButterflyDust)); } } // fix bug if (Game1.IsMasterGame && Config.TryToFixOldBugs) { Monitor.Log("Fixing bugs"); foreach (Building l in Game1.getFarm().buildings) { if (l is Coop) { foreach (Object o in (l as Coop).indoors.Value.Objects.Values) { if (o.bigCraftable && o.Name.Contains("Incubator") && o.heldObject.Value != null) { int egg = o.heldObject.Value.ParentSheetIndex; Monitor.Log($"egg id {egg}"); if (new int[] { ModEntry.BatFamiliarEgg, ModEntry.ButterflyFamiliarEgg, ModEntry.DinoFamiliarEgg, ModEntry.DustFamiliarEgg, ModEntry.JunimoFamiliarEgg }.Contains(egg)) { Monitor.Log($"familiar egg, removing.", LogLevel.Warn); o.heldObject.Value = null; o.minutesUntilReady.Value = -1; o.ParentSheetIndex = 101; Game1.player.addItemToInventory(new Object(egg, 1)); } } } } } foreach (GameLocation l in Game1.locations) { for (int i = l.Objects.Count() - 1; i >= 0; i--) { Object o = l.Objects.Values.ElementAt(i); if (o.Name.Equals("Butterfly Dust")) { Monitor.Log($"Removing placed butterfly dust.", LogLevel.Warn); Game1.currentLocation.debris.Add(new Debris(o.ParentSheetIndex, l.Objects.Keys.ElementAt(i), Game1.player.position)); l.objects.Remove(l.Objects.Keys.ElementAt(i)); } } } } }
/// <summary>Raised after the player loads a save slot and the world is initialized.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event data.</param> public static void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { DataLoader.FillCaskDataIds(); }
private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { this.hasSaveLoaded = true; this.Patcher.CheckPatches(); this.Initialize(); }
private void addRadialMenu(object sender, SaveLoadedEventArgs e) { Game1.onScreenMenus.Add(new Framework.RadialMenu(this.Monitor)); }
/// <summary>Raised after loading a save (including the first day after creating a new save), or connecting to a multiplayer world.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event data.</param> public abstract void OnSaveLoaded(object sender, SaveLoadedEventArgs e);
private void SaveLoaded(object sender, SaveLoadedEventArgs e) { BaseSpeed = Game1.player.addedSpeed; }
private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { // Read persisted config. config_ = this.Helper.ReadConfig <ModConfig>(); }
/// <summary>Invoked when the player loads a save.</summary> /// <param name="sender">The event sender</param> /// <param name="e">The event data.</param> private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { // load all content packs foreach (var contentPack in this.Helper.ContentPacks.GetOwned()) { try { LoadContentPack(contentPack); } catch (Exception ex) { this.Monitor.Log($"Failed to load content pack: {ex}"); } } // load saved tree data SavedTreeData = GetSavePersistantTreeData(); // place trees on maps using tree tile data foreach (var location in Game1.locations) { var map = location.Map; var backLayer = map.GetLayer("Back"); if (backLayer == null) { continue; } for (int x = 0; x < backLayer.LayerWidth; x++) { for (int y = 0; y < backLayer.LayerHeight; y++) { // check if a tree property is on the tile var treeProperty = location.doesTileHaveProperty(x, y, "Tree", "Back"); if (treeProperty == null) { continue; } // ensure the tree tile value is valid var treeType = ModEntry.Instance.Api.GetTreeType(treeProperty); if (treeType == -1) { ModEntry.Instance.Monitor.Log($"Tree property found at tile: (X:{x} Y:{y}) on map: {location.Name} but tree type: {treeProperty} couldn't be found.", LogLevel.Warn); continue; } // ensure a terrain feature isn't already in it's place if (!location.terrainFeatures.ContainsKey(new Vector2(x, y))) { location.terrainFeatures.Add(new Vector2(x, y), new Tree(treeType, 5)); var customTree = ModEntry.Instance.Api.GetTreeByType(treeType); // set default shake produce values to 0 (so player doesn't need to wait for the required number of days straight away) List <int> daysTillNextShakeProduce = new List <int>(); for (int i = 0; i < customTree.Data.ShakingProducts.Count; i++) { daysTillNextShakeProduce.Add(0); } SavedTreeData.Add(new SavePersistantTreeData(new Vector2(x, y), 0, daysTillNextShakeProduce)); } } } } }
private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { Helper.Events.Display.MenuChanged += OnMenuChanged; }
private void OnSaveLoaded(object?sender, SaveLoadedEventArgs e) { SprinklerBehavior.ClearCache(); SprinklerCoverageAlpha = 0f; SprinklerCoverageCurrentAnimationTime = 0f; }
private void AfterLoad(object sender, SaveLoadedEventArgs e) { _config = Helper.ReadConfig <ModConfig>(); RePopulateConfig(); }
/********* ** Private Methods *********/ /**** ** Events ****/ /// <summary>Invoked when the player has loaded a save. Used for calculating the possible seed based from config and installed mods.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event data.</param> private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { PopulateSeeds(); }
public void OnSaveLoaded(object?sender, SaveLoadedEventArgs e) { LoadFavorites(); }
private void onSaveLoaded(object sender, SaveLoadedEventArgs e) { Game1.getFarm().resourceClumps.OnValueRemoved += onClumpRemoved; }
/// <summary>Raised after the player loads a save slot and the world is initialised.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> public void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { this.IsUpLate = false; this.JustStartedNewDay = false; this.JustCollapsed = false; }
private void OnSaveLoaded(object sender, SaveLoadedEventArgs e) { FixOdds(); }