コード例 #1
0
 /*********
 ** 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();
 }
コード例 #2
0
 private void onSaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     NetController.OnSaveLoaded();
 }
コード例 #3
0
 private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     JojaMail.ProcessPlayerMailbox();
     this.Monitor.Log($"Processed player's mailbox to check for any scheduled JojaMail orders.");
 }
コード例 #4
0
 private static void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     CachedSapphireID = ExternalAPIs.JA.GetObjectId("Sapphire Pearl");
 }
コード例 #5
0
ファイル: ModEntry.cs プロジェクト: Quipex/ExperienceUpdates
 private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     Monitor.Log("Save loaded, resetting counters");
     Calculator().Reset();
 }
コード例 #6
0
 /*********
 ** 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();
 }
コード例 #7
0
 private void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e, IModHelper helper)
 {
     helper.Events.Display.RenderedWorld += Display_RenderedWorld;
 }
コード例 #8
0
 /// <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);
 }
コード例 #9
0
 /// <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();
 }
コード例 #10
0
 /// <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();
 }
コード例 #11
0
 private void OnLoadedSave(object sender, SaveLoadedEventArgs e)
 {
     this.Monitor.Log("Save Loaded!", LogLevel.Debug);
     this.SetLoadValues(e);
 }
コード例 #12
0
 private void GetFarm(object sender, SaveLoadedEventArgs e)
 {
     this.Farm = (StardewValley.Locations.BuildableGameLocation)Game1.locations.ToList().Find(x => x is Farm);
 }
コード例 #13
0
 //listeners
 private void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     this.niceMessages = new NiceMessages(mainHelper);
 }
コード例 #14
0
        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));
                        }
                    }
                }
            }
        }
コード例 #15
0
 /// <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();
 }
コード例 #16
0
 private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     this.hasSaveLoaded = true;
     this.Patcher.CheckPatches();
     this.Initialize();
 }
コード例 #17
0
 private void addRadialMenu(object sender, SaveLoadedEventArgs e)
 {
     Game1.onScreenMenus.Add(new Framework.RadialMenu(this.Monitor));
 }
コード例 #18
0
 /// <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);
コード例 #19
0
 private void SaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     BaseSpeed = Game1.player.addedSpeed;
 }
コード例 #20
0
 private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     // Read persisted config.
     config_ = this.Helper.ReadConfig <ModConfig>();
 }
コード例 #21
0
ファイル: ModEntry.cs プロジェクト: iwa-yasu/smapi-mod-dump
        /// <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));
                        }
                    }
                }
            }
        }
コード例 #22
0
 private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     Helper.Events.Display.MenuChanged += OnMenuChanged;
 }
コード例 #23
0
 private void OnSaveLoaded(object?sender, SaveLoadedEventArgs e)
 {
     SprinklerBehavior.ClearCache();
     SprinklerCoverageAlpha = 0f;
     SprinklerCoverageCurrentAnimationTime = 0f;
 }
コード例 #24
0
 private void AfterLoad(object sender, SaveLoadedEventArgs e)
 {
     _config = Helper.ReadConfig <ModConfig>();
     RePopulateConfig();
 }
コード例 #25
0
 /*********
 ** 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();
 }
コード例 #26
0
 public void OnSaveLoaded(object?sender, SaveLoadedEventArgs e)
 {
     LoadFavorites();
 }
コード例 #27
0
ファイル: Mod.cs プロジェクト: iwa-yasu/smapi-mod-dump
 private void onSaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     Game1.getFarm().resourceClumps.OnValueRemoved += onClumpRemoved;
 }
コード例 #28
0
 /// <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;
 }
コード例 #29
0
 private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     FixOdds();
 }