Exemplo n.º 1
0
        private static void LoadCaveChoice()
        {
            string choiceId = SHelper.Data.ReadSaveData <string>("farm-cave-framework-choice");

            if (choiceId != null && choiceId.Length > 0)
            {
                Dictionary <string, CaveChoice> choices = SHelper.Content.Load <Dictionary <string, CaveChoice> >(frameworkPath, ContentSource.GameContent);
                if (choices.ContainsKey(choiceId))
                {
                    caveChoice = choices[choiceId];
                }
            }
        }
Exemplo n.º 2
0
 private void GameLoop_SaveLoaded(object sender, StardewModdingAPI.Events.SaveLoadedEventArgs e)
 {
     caveChoice = null;
     if (Config.EnableMod && Config.ResetEvent)
     {
         Config.ResetEvent = false;
         Helper.WriteConfig(Config);
         Game1.player.eventsSeen.Remove(65);
         string choiceId = SHelper.Data.ReadSaveData <string>("farm-cave-framework-choice");
         if (choiceId != null && choiceId.Length > 0)
         {
             (Game1.getLocationFromName("FarmCave") as FarmCave).objects.Clear();
             SHelper.Data.WriteSaveData("farm-cave-framework-choice", "");
         }
         Monitor.Log("Reset farm cave and event");
     }
     else
     {
         LoadCaveChoice();
     }
 }