From a1acdacd834d152dbd53ac9e45d8578e0c1c2749 Mon Sep 17 00:00:00 2001 From: janavarro95 Date: Sun, 24 Apr 2016 18:54:14 -0700 Subject: [PATCH] Added files via upload --- Museum_Rearrange/Class1.cs | 142 +++++++++++++++++++ Museum_Rearrange/Museum_Rearrange.dll | Bin 0 -> 7168 bytes Museum_Rearrange/Museum_Rearrange_Config.txt | 20 +++ Museum_Rearrange/manifest.json | 14 ++ 4 files changed, 176 insertions(+) create mode 100644 Museum_Rearrange/Class1.cs create mode 100644 Museum_Rearrange/Museum_Rearrange.dll create mode 100644 Museum_Rearrange/Museum_Rearrange_Config.txt create mode 100644 Museum_Rearrange/manifest.json diff --git a/Museum_Rearrange/Class1.cs b/Museum_Rearrange/Class1.cs new file mode 100644 index 00000000..7941e37d --- /dev/null +++ b/Museum_Rearrange/Class1.cs @@ -0,0 +1,142 @@ +using System; +using StardewValley; +using StardewModdingAPI; +using System.IO; + +/* +TO DO: + +*/ +namespace Stardew_Save_Anywhere_Mod +{ + public class Class1 : Mod + { + string key_binding="R"; + + bool game_loaded = false; + + public override void Entry(params object[] objects) + { + //set up all of my events here + StardewModdingAPI.Events.PlayerEvents.LoadedGame += PlayerEvents_LoadedGame; + StardewModdingAPI.Events.ControlEvents.KeyPressed += ControlEvents_KeyPressed; + } + + + + public void ControlEvents_KeyPressed(object sender, StardewModdingAPI.Events.EventArgsKeyPressed e) + { + + + if (e.KeyPressed.ToString() == key_binding) //if the key is pressed, load my cusom save function + { + if (StardewValley.Game1.player.currentLocation.name == "ArchaeologyHouse") + { + my_save(); + + } + else + { + Log.Info("You can't rearrange the museum here!"); + } + + } + //DataLoader_Settings(); //update the key if players changed it while playing. + + } + + public void PlayerEvents_LoadedGame(object sender, StardewModdingAPI.Events.EventArgsLoadedGameChanged e) + { + game_loaded = true; + DataLoader_Settings(); + MyWritter_Settings(); + } + + + + + void DataLoader_Settings() + { + //loads the data to the variables upon loading the game. + string myname = StardewValley.Game1.player.name; + string mylocation = Path.Combine(PathOnDisk, "Museum_Rearrange_Config"); + string mylocation2 = mylocation; + string mylocation3 = mylocation2 + ".txt"; + if (!File.Exists(mylocation3)) //if not data.json exists, initialize the data variables to the ModConfig data. I.E. starting out. + { + // Console.WriteLine("Can't load custom save info since the file doesn't exist."); + + key_binding = "R"; + // Log.Info("KEY TIME"); + } + + else + { + // Console.WriteLine("HEY THERE IM LOADING DATA"); + string[] readtext = File.ReadAllLines(mylocation3); + key_binding = Convert.ToString(readtext[3]); + + + // Log.Info(key_binding); + // Log.Info(Convert.ToString(readtext[3])); + + } + } + + void MyWritter_Settings() + { + + //write all of my info to a text file. + string myname = StardewValley.Game1.player.name; + + string mylocation = Path.Combine(PathOnDisk, "Museum_Rearrange_Config"); + string mylocation2 = mylocation; + string mylocation3 = mylocation2 + ".txt"; + + string[] mystring3 = new string[20]; + if (!File.Exists(mylocation3)) + { + Console.WriteLine("The custom character save info doesn't exist. It will be created when the custom saving method is run. Which is now."); + + mystring3[0] = "Config: Museum_Rearranger. Feel free to mess with these settings."; + mystring3[1] = "===================================================================================="; + + mystring3[2] = "Key binding for saving anywhere. Press this key to save anywhere!"; + mystring3[3] = key_binding.ToString(); + + + + File.WriteAllLines(mylocation3, mystring3); + + } + + else + { + + //write out the info to a text file at the end of a day. This will run if it doesnt exist. + + mystring3[0] = "Config: Save_Anywhere Info. Feel free to mess with these settings."; + mystring3[1] = "===================================================================================="; + + mystring3[2] = "Key binding for saving anywhere. Press this key to save anywhere!"; + mystring3[3] = key_binding.ToString(); + + File.WriteAllLines(mylocation3, mystring3); + } + } + + + + + void my_save() + { + + // Game1.activeClickableMenu = new StardewValley.Menus.SaveGameMenu(); //This command is what allows the player to save anywhere as it calls the saving function. + + + Game1.activeClickableMenu = new StardewValley.Menus.MuseumMenu(); + } + + } + } + //end class \ No newline at end of file diff --git a/Museum_Rearrange/Museum_Rearrange.dll b/Museum_Rearrange/Museum_Rearrange.dll new file mode 100644 index 0000000000000000000000000000000000000000..084b8e3ddfbd7b884b1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