Beispiel #1
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" });
             *
             */
        }
Beispiel #2
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);
            }
        }