diff --git a/GeneralMods/AutoSpeed/AutoSpeed.cs b/GeneralMods/AutoSpeed/AutoSpeed.cs
index ac89c8b3..bde35c77 100644
--- a/GeneralMods/AutoSpeed/AutoSpeed.cs
+++ b/GeneralMods/AutoSpeed/AutoSpeed.cs
@@ -1,74 +1,73 @@
using System;
using System.IO;
using StardewModdingAPI;
+using StardewModdingAPI.Events;
+using StardewValley;
namespace Omegasis.AutoSpeed
{
-
+ /// The mod entry point.
public class AutoSpeed : Mod
{
- int speed_int = 5;
+ /*********
+ ** Properties
+ *********/
+ /// The speed multiplier.
+ private int Speed = 5;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// The mod entry point, called after the mod is first loaded.
+ /// Provides simplified APIs for writing mods.
public override void Entry(IModHelper helper)
{
- //StardewModdingAPI.Events.GameEvents.UpdateTick += Events_UpdateTick;
- StardewModdingAPI.Events.GameEvents.UpdateTick += GameEvents_UpdateTick;
- var configLocation = Path.Combine(helper.DirectoryPath, "AutoSpeed_Data.txt");
+ GameEvents.UpdateTick += this.GameEvents_UpdateTick;
+
+ string configLocation = Path.Combine(helper.DirectoryPath, "AutoSpeed_Data.txt");
if (!File.Exists(configLocation))
- {
- speed_int = 1;
- }
- DataLoader();
- // MyWritter();
- Monitor.Log("AutoSpeed Initialization Completed",LogLevel.Info);
+ this.Speed = 1;
+
+ this.LoadConfig();
+ this.Monitor.Log("AutoSpeed Initialization Completed", LogLevel.Info);
}
+
+ /*********
+ ** Private methods
+ *********/
+ /// The method invoked when the game updates (roughly 60 times per second).
+ /// The event sender.
+ /// The event data.
private void GameEvents_UpdateTick(object sender, EventArgs e)
{
- StardewValley.Game1.player.addedSpeed = speed_int;
+ Game1.player.addedSpeed = Speed;
}
- void DataLoader()
+ /// Load the configuration settings.
+ private void LoadConfig()
{
- //loads the data to the variables upon loading the game.
- var mylocation = Path.Combine(Helper.DirectoryPath, "AutoSpeed_data.txt");
- if (!File.Exists(mylocation)) //if not data.json exists, initialize the data variables to the ModConfig data. I.E. starting out.
- {
- Monitor.Log("The config file for AutoSpeed was not found, guess I'll create it...",LogLevel.Warn);
- MyWritter();
- }
+ string path = Path.Combine(this.Helper.DirectoryPath, "AutoSpeed_data.txt");
+ if (!File.Exists(path))
+ this.WriteConfig();
else
{
- string[] readtext = File.ReadAllLines(mylocation);
- speed_int = Convert.ToInt32(readtext[3]);
+ string[] text = File.ReadAllLines(path);
+ this.Speed = Convert.ToInt32(text[3]);
}
}
-
- void MyWritter()
+
+ /// Save the configuration settings.
+ void WriteConfig()
{
- //saves the BuildEndurance_data at the end of a new day;
- var mylocation = Path.Combine(Helper.DirectoryPath, "AutoSpeed_data.txt");
- string[] mystring3 = new string[20];
- if (!File.Exists(mylocation))
- {
- Monitor.Log("The data file for AutoSpeed was not found, guess I'll create it when you sleep.",LogLevel.Info);
-
- mystring3[0] = "Player: AutoSpeed Config:";
- mystring3[1] = "====================================================================================";
- mystring3[2] = "Player Added Speed:";
- mystring3[3] = speed_int.ToString();
- File.WriteAllLines(mylocation, mystring3);
- }
- else
- {
- mystring3[0] = "Player: AutoSpeed Config:";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Player Added Speed:";
- mystring3[3] = speed_int.ToString();
-
- File.WriteAllLines(mylocation, mystring3);
- }
+ string path = Path.Combine(this.Helper.DirectoryPath, "AutoSpeed_data.txt");
+ string[] text = new string[20];
+ text[0] = "Player: AutoSpeed Config:";
+ text[1] = "====================================================================================";
+ text[2] = "Player Added Speed:";
+ text[3] = Speed.ToString();
+ File.WriteAllLines(path, text);
}
-
- } //end my function
-}
\ No newline at end of file
+ }
+}
diff --git a/GeneralMods/AutoSpeed/AutoSpeed.csproj b/GeneralMods/AutoSpeed/AutoSpeed.csproj
index 26e14532..1c9aac56 100644
--- a/GeneralMods/AutoSpeed/AutoSpeed.csproj
+++ b/GeneralMods/AutoSpeed/AutoSpeed.csproj
@@ -34,6 +34,9 @@
+
+ Properties\GlobalAssemblyInfo.cs
+
diff --git a/GeneralMods/AutoSpeed/Properties/AssemblyInfo.cs b/GeneralMods/AutoSpeed/Properties/AssemblyInfo.cs
index 82848cd7..60f65a00 100644
--- a/GeneralMods/AutoSpeed/Properties/AssemblyInfo.cs
+++ b/GeneralMods/AutoSpeed/Properties/AssemblyInfo.cs
@@ -1,36 +1,7 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("AutoSpeed")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("AutoSpeed")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("57e7d17e-c237-448b-a50f-cfb67f9bb146")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/GeneralMods/AutoSpeed/README.md b/GeneralMods/AutoSpeed/README.md
index 8100c10a..4610bbe4 100644
--- a/GeneralMods/AutoSpeed/README.md
+++ b/GeneralMods/AutoSpeed/README.md
@@ -1,20 +1,20 @@
-# AutoSpeed_Mod
+**Auto Speed** is a [Stardew Valley](http://stardewvalley.net/) mod which lets you move faster
+without the need to enter commands in the console.
+Compatible with Stardew Valley 1.2+ on Linux, Mac, and Windows.
-Initial Post: 3/27/16
-Updated: v1.1.0 10/11/16
+## Installation
+1. [Install the latest version of SMAPI](https://github.com/Pathoschild/SMAPI/releases).
+2. Install [this mod from Nexus mods](http://www.nexusmods.com/stardewvalley/mods/443).
+3. Run the game using SMAPI.
-Compatability:
-Windows
-SDV 1.1
+## Usage
+Launch the game with the mod installed to generate the config file, then edit the
+`AutoSpeed_data.txt` to set the speed you want (higher values are faster).
-Changelog:
-1.1.0
--Updated to SDv 1.1
--Updated to SMAPI 0.40.0 1.1-3
+## Versions
+1.0
+* Initial release.
-Description:
-This is a simple .dll mod for SMAPI which automatically changes the character's speed value referenced in AutoSpeed.txt.
-This basically just bypasses having to type in the command everytime you load SMAPI.
-
-Install in by putting it into Stardew Valley/Mods/AutoSpeed!
+1.1:
+* Updated to Stardew Valley 1.1 and SMAPI 0.40 1.1-3.
diff --git a/GeneralMods/AutoSpeed/manifest.json b/GeneralMods/AutoSpeed/manifest.json
index 1dd85526..7626445d 100644
--- a/GeneralMods/AutoSpeed/manifest.json
+++ b/GeneralMods/AutoSpeed/manifest.json
@@ -11,4 +11,4 @@
"UniqueID": "AutoSpeed",
"PerSaveConfigs": false,
"EntryDll": "AutoSpeed.dll"
-}
\ No newline at end of file
+}
diff --git a/GeneralMods/BillboardAnywhere/BillboardAnywhere.cs b/GeneralMods/BillboardAnywhere/BillboardAnywhere.cs
new file mode 100644
index 00000000..3c6523ef
--- /dev/null
+++ b/GeneralMods/BillboardAnywhere/BillboardAnywhere.cs
@@ -0,0 +1,88 @@
+using System;
+using System.IO;
+using StardewModdingAPI;
+using StardewModdingAPI.Events;
+using StardewValley;
+using StardewValley.Menus;
+
+namespace Omegasis.BillboardAnywhere
+{
+ /// The mod entry point.
+ public class BillboardAnywhere : Mod
+ {
+ /*********
+ ** Properties
+ *********/
+ /// The key which shows the billboard menu.
+ private string KeyBinding = "B";
+
+ /// Whether the player loaded a save.
+ private bool IsGameLoaded;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// The mod entry point, called after the mod is first loaded.
+ /// Provides simplified APIs for writing mods.
+ public override void Entry(IModHelper helper)
+ {
+ SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
+ ControlEvents.KeyPressed += this.ControlEvents_KeyPressed;
+ }
+
+
+ /*********
+ ** Private methods
+ *********/
+ /// The method invoked after the player loads a save.
+ /// The event sender.
+ /// The event data.
+ private void SaveEvents_AfterLoad(object sender, EventArgs e)
+ {
+ this.IsGameLoaded = true;
+ this.LoadConfig();
+ }
+
+ /// The method invoked when the presses a keyboard button.
+ /// The event sender.
+ /// The event data.
+ public void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
+ {
+ if (Game1.player == null || Game1.player.currentLocation == null || this.IsGameLoaded == false || Game1.activeClickableMenu != null)
+ return;
+
+ // load menu if key pressed
+ if (e.KeyPressed.ToString() == this.KeyBinding)
+ Game1.activeClickableMenu = new Billboard();
+ }
+
+ /// Load the configuration settings.
+ void LoadConfig()
+ {
+ string path = Path.Combine(this.Helper.DirectoryPath, "Billboard_Anywhere_Config.txt");
+ if (!File.Exists(path))
+ {
+ this.KeyBinding = "B";
+ this.WriteConfig();
+ }
+ else
+ {
+ string[] text = File.ReadAllLines(path);
+ this.KeyBinding = Convert.ToString(text[3]);
+ }
+ }
+
+ /// Save the configuration settings.
+ void WriteConfig()
+ {
+ string path = Path.Combine(Helper.DirectoryPath, "Billboard_Anywhere_Config.txt");
+ string[] text = new string[20];
+ text[0] = "Config: Billboard_Anywhere. Feel free to mess with these settings.";
+ text[1] = "====================================================================================";
+ text[2] = "Key binding for opening the billboard anywhere. Press this key to do so";
+ text[3] = this.KeyBinding;
+ File.WriteAllLines(path, text);
+ }
+ }
+}
diff --git a/GeneralMods/BillboardAnywhere/BillboardAnywhere.csproj b/GeneralMods/BillboardAnywhere/BillboardAnywhere.csproj
index a28ab3bf..4023451c 100644
--- a/GeneralMods/BillboardAnywhere/BillboardAnywhere.csproj
+++ b/GeneralMods/BillboardAnywhere/BillboardAnywhere.csproj
@@ -34,7 +34,10 @@
-
+
+ Properties\GlobalAssemblyInfo.cs
+
+
@@ -42,7 +45,7 @@
-
+
diff --git a/GeneralMods/BillboardAnywhere/Class1.cs b/GeneralMods/BillboardAnywhere/Class1.cs
deleted file mode 100644
index b9e95ddf..00000000
--- a/GeneralMods/BillboardAnywhere/Class1.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-using System;
-using System.IO;
-using StardewModdingAPI;
-using StardewValley;
-
-namespace Omegasis.BillboardAnywhere
-{
- public class Class1 : Mod
- {
- string key_binding = "B";
-
- bool game_loaded = false;
-
- public override void Entry(IModHelper helper)
- {
- //set up all of my events here
- StardewModdingAPI.Events.SaveEvents.AfterLoad += SecondPlayerEvents_LoadedGame;
- StardewModdingAPI.Events.ControlEvents.KeyPressed += ControlEvents_KeyPressed;
- }
-
- private void SecondPlayerEvents_LoadedGame(object sender, EventArgs e)
- {
- game_loaded = true;
- DataLoader_Settings();
- }
-
- public void ControlEvents_KeyPressed(object sender, StardewModdingAPI.Events.EventArgsKeyPressed e)
- {
- if (Game1.player == null) return;
- if (Game1.player.currentLocation == null) return;
- if (game_loaded == false) return;
-
- if (e.KeyPressed.ToString() == key_binding) //if the key is pressed, load my cusom save function
- {
- if (Game1.activeClickableMenu != null) return;
- my_menu();
- }
- }
-
- void DataLoader_Settings()
- {
- //loads the data to the variables upon loading the game.
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath, "Billboard_Anywhere_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 = "B";
- MyWritter_Settings();
- }
-
- else
- {
- string[] readtext = File.ReadAllLines(mylocation3);
- key_binding = 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(Helper.DirectoryPath, "Billboard_Anywhere_Config");
- string mylocation2 = mylocation;
- string mylocation3 = mylocation2 + ".txt";
- string[] mystring3 = new string[20];
- if (!File.Exists(mylocation3))
- {
- Monitor.Log("Billboard_Anywhere: The Billboard Anywhere Config doesn't exist. Creating it now.");
- mystring3[0] = "Config: Billboard_Anywhere. Feel free to mess with these settings.";
- mystring3[1] = "====================================================================================";
- mystring3[2] = "Key binding for opening the billboard anywhere. Press this key to do so";
- mystring3[3] = key_binding.ToString();
- File.WriteAllLines(mylocation3, mystring3);
- }
-
- else
- {
- mystring3[0] = "Config: Billboard_Anywhere Info. Feel free to mess with these settings.";
- mystring3[1] = "====================================================================================";
- mystring3[2] = "Key binding for opening the billboard anywhere. Press this key to do so";
- mystring3[3] = key_binding.ToString();
- File.WriteAllLines(mylocation3, mystring3);
- }
- }
-
- void my_menu()
- {
- Game1.activeClickableMenu = new StardewValley.Menus.Billboard();
- }
-
- }
-}
-//end class
\ No newline at end of file
diff --git a/GeneralMods/BillboardAnywhere/Properties/AssemblyInfo.cs b/GeneralMods/BillboardAnywhere/Properties/AssemblyInfo.cs
index be301328..ec9ded0e 100644
--- a/GeneralMods/BillboardAnywhere/Properties/AssemblyInfo.cs
+++ b/GeneralMods/BillboardAnywhere/Properties/AssemblyInfo.cs
@@ -1,36 +1,7 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("BillboardAnywhere")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("BillboardAnywhere")]
-[assembly: AssemblyCopyright("Copyright © 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("07a9efaa-1759-49c8-8a82-49210047b975")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/GeneralMods/BillboardAnywhere/README.md b/GeneralMods/BillboardAnywhere/README.md
new file mode 100644
index 00000000..f6649f40
--- /dev/null
+++ b/GeneralMods/BillboardAnywhere/README.md
@@ -0,0 +1,20 @@
+**Billboard Anywhere** is a [Stardew Valley](http://stardewvalley.net/) mod which lets you look at
+the billboard anywhere in-game for easy access to upcoming events and birthdays.
+
+Compatible with Stardew Valley 1.2+ on Linux, Mac, and Windows.
+
+## Installation
+1. [Install the latest version of SMAPI](https://github.com/Pathoschild/SMAPI/releases).
+2. Install [this mod from Nexus mods](http://www.nexusmods.com/stardewvalley/mods/492).
+3. Run the game using SMAPI.
+
+## Usage
+Press `B` while in-game to show the billboard menu. Edit the `Billboard_Anywhere_Config.txt` file
+to change the key.
+
+## Versions
+1.0
+* Initial release.
+
+1.1:
+* Updated to Stardew Valley 1.1 and SMAPI 0.40 1.1-3.
diff --git a/GeneralMods/BillboardAnywhere/Readme.txt b/GeneralMods/BillboardAnywhere/Readme.txt
deleted file mode 100644
index a54b33ed..00000000
--- a/GeneralMods/BillboardAnywhere/Readme.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Billboard Anywhere 1.1.0
-
-Posted 7/12/16 at 1:29 AM
-Updated: 10/11/16 1:08AM
-
-Updates:
-1.1.0
--Updated to SDV 1.1
-
-Usage:See config
-
--A simple mod that allows the Billboard/Calendar to be shown anywhere by pressing the key defined in Billboard_Anywhere_Config.txt
diff --git a/GeneralMods/BillboardAnywhere/manifest.json b/GeneralMods/BillboardAnywhere/manifest.json
index bceffa3b..684fb28f 100644
--- a/GeneralMods/BillboardAnywhere/manifest.json
+++ b/GeneralMods/BillboardAnywhere/manifest.json
@@ -11,4 +11,4 @@
"UniqueID": "7ad4f6f7-c3de-4729-a40f-7a11d2b2a358",
"PerSaveConfigs": false,
"EntryDll": "BillboardAnywhere.dll"
-}
\ No newline at end of file
+}
diff --git a/GeneralMods/BuildEndurance/BuildEndurance.cs b/GeneralMods/BuildEndurance/BuildEndurance.cs
new file mode 100644
index 00000000..4a7728af
--- /dev/null
+++ b/GeneralMods/BuildEndurance/BuildEndurance.cs
@@ -0,0 +1,349 @@
+using System;
+using System.IO;
+using System.Text;
+using Newtonsoft.Json;
+using Omegasis.BuildEndurance.Framework;
+using StardewModdingAPI;
+using StardewModdingAPI.Events;
+using StardewValley;
+
+namespace Omegasis.BuildEndurance
+{
+ /// The mod entry point.
+ public class BuildEndurance : Mod
+ {
+ /*********
+ ** Properties
+ *********/
+ /// The mod settings and player data.
+ private ModConfig Config;
+
+ /// Whether the player has been exhausted today.
+ private bool WasExhausted;
+
+ /// Whether the player has collapsed today.
+ private bool WasCollapsed;
+
+ /// The XP points needed to reach the next endurance level.
+ private double ExpToNextLevel = 20;
+
+ /// The player's current endurance XP points.
+ private double CurrentExp;
+
+ /// The player's current endurance level.
+ private int CurrentLevel;
+
+ /// The stamina points to add to the player's base stamina due to their current endurance level.
+ private int CurrentLevelStaminaBonus;
+
+ /// The initial stamina bonus to apply regardless of the player's endurance level, from the config file.
+ private int BaseStaminaBonus;
+
+ /// Whether to reset all changes by the mod to the default values (i.e. start over).
+ private bool ClearModEffects;
+
+ /// The player's original stamina value, excluding mod effects.
+ private int OriginalStamina;
+
+ /// Whether the player recently gained XP for tool use.
+ private bool HasRecentToolExp;
+
+ /// Whether the player was eating last time we checked.
+ private bool WasEating;
+
+ /// Whether the player has loaded a save.
+ private bool IsLoaded;
+
+ /// The player's stamina last time they slept.
+ private int NightlyStamina;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// The mod entry point, called after the mod is first loaded.
+ /// Provides simplified APIs for writing mods.
+ public override void Entry(IModHelper helper)
+ {
+ GameEvents.UpdateTick += this.GameEvents_UpdateTick;
+ GameEvents.OneSecondTick += this.GameEvents_OneSecondTick;
+ SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
+ TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
+
+ string configPath = Path.Combine(helper.DirectoryPath, "BuildEnduranceConfig.json");
+ if (!File.Exists(configPath))
+ {
+ this.Monitor.Log("Initial configuration file setup.");
+ this.Config = new ModConfig
+ {
+ CurrentLevel = 0,
+ MaxLevel = 100,
+ StaminaIncreasePerLevel = 1,
+ CurrentExp = 0,
+ ExpToNextLevel = 20,
+ ExpCurve = 1.15,
+ ExpForEating = 2,
+ ExpForSleeping = 10,
+ ExpForToolUse = 1,
+ BaseStaminaBonus = 0,
+ CurrentLevelStaminaBonus = 0,
+ ExpForExhaustion = 25,
+ ExpForCollapsing = 50
+ };
+ File.WriteAllBytes(configPath, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(this.Config)));
+ }
+ else
+ {
+ this.Config = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(File.ReadAllBytes(configPath)));
+ this.Monitor.Log("Found BuildEndurance config file.");
+ }
+
+ this.Monitor.Log("BuildEndurance Initialization Completed");
+ }
+
+ /// The method invoked once per second during a game update.
+ /// The event sender.
+ /// The event data.
+ public void GameEvents_OneSecondTick(object sender, EventArgs e)
+ {
+ // nerf how quickly tool xp is gained (I hope)
+ if (this.HasRecentToolExp)
+ this.HasRecentToolExp = false;
+ }
+
+ /// The method invoked when the game updates (roughly 60 times per second).
+ /// The event sender.
+ /// The event data.
+ public void GameEvents_UpdateTick(object sender, EventArgs e)
+ {
+ // give XP when player finishes eating
+ if (Game1.isEating)
+ this.WasEating = true;
+ else if (this.WasEating)
+ {
+ this.CurrentExp += this.Config.ExpForEating;
+ this.WasEating = false;
+ }
+
+ // give XP when player uses tool
+ if (!this.HasRecentToolExp && Game1.player.usingTool)
+ {
+ this.CurrentExp += this.Config.ExpForToolUse;
+ this.HasRecentToolExp = true;
+ }
+
+ // give XP when exhausted
+ if (!this.WasExhausted && Game1.player.exhausted)
+ {
+ this.CurrentExp += this.Config.ExpForExhaustion;
+ this.WasExhausted = true;
+ this.Monitor.Log("The player is exhausted");
+ }
+
+ // give XP when player stays up too late or collapses
+ if (!this.WasCollapsed && Game1.farmerShouldPassOut)
+ {
+ this.CurrentExp += this.Config.ExpForCollapsing;
+ this.WasCollapsed = true;
+ this.Monitor.Log("The player has collapsed!");
+ }
+ }
+
+ /// The method invoked after the player loads a save.
+ /// The event sender.
+ /// The event data.
+ public void SaveEvents_AfterLoad(object sender, EventArgs e)
+ {
+ // initialise
+ this.LoadConfig();
+ this.WriteConfig();
+ this.IsLoaded = true;
+
+ // grab initial stamina
+ var player = Game1.player;
+ if (this.OriginalStamina == 0)
+ this.OriginalStamina = player.MaxStamina;
+
+ // set nightly stamina
+ player.MaxStamina = this.NightlyStamina;
+ if (this.NightlyStamina == 0)
+ player.MaxStamina = this.BaseStaminaBonus + this.CurrentLevelStaminaBonus + this.OriginalStamina;
+
+ // reset if needed
+ if (this.ClearModEffects)
+ player.MaxStamina = this.OriginalStamina;
+
+ // save config
+ this.LoadConfig();
+ this.WriteConfig();
+ }
+
+ /// The method invoked when changes.
+ /// The event sender.
+ /// The event data.
+ public void TimeEvents_DayOfMonthChanged(object sender, EventArgs e)
+ {
+ // reset data
+ this.WasExhausted = false;
+ this.WasCollapsed = false;
+ if (!this.IsLoaded)
+ return;
+
+ // update settings
+ this.Monitor.Log(this.CurrentExp.ToString());
+ this.UpdateClearSetting();
+ this.Monitor.Log(this.ClearModEffects.ToString());
+
+ var player = Game1.player;
+ this.CurrentExp += this.Config.ExpForSleeping;
+ if (this.OriginalStamina == 0)
+ this.OriginalStamina = player.MaxStamina; //grab the initial stamina value
+
+ if (this.ClearModEffects)
+ {
+ this.LoadClearSettings();
+ player.MaxStamina = this.OriginalStamina;
+ this.ExpToNextLevel = this.Config.ExpToNextLevel;
+ this.CurrentExp = this.Config.CurrentExp;
+ this.CurrentLevelStaminaBonus = 0;
+ this.OriginalStamina = player.MaxStamina;
+ this.BaseStaminaBonus = 0;
+ this.CurrentLevel = 0;
+ }
+
+ if (!this.ClearModEffects && this.CurrentLevel < this.Config.MaxLevel)
+ {
+ while (this.CurrentExp >= this.ExpToNextLevel)
+ {
+ this.CurrentLevel += 1;
+ this.CurrentExp = this.CurrentExp - this.ExpToNextLevel;
+ this.ExpToNextLevel = (this.Config.ExpCurve * this.ExpToNextLevel);
+ player.MaxStamina += this.Config.StaminaIncreasePerLevel;
+ this.CurrentLevelStaminaBonus += this.Config.StaminaIncreasePerLevel;
+
+ }
+ }
+ this.ClearModEffects = false;
+ this.NightlyStamina = Game1.player.maxStamina;
+ this.WriteConfig();
+ }
+
+ /// Update the settings needed for from the latest config file on disk.
+ void LoadClearSettings()
+ {
+ this.LoadConfig();
+ this.WriteConfig();
+
+ if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData")))
+ Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
+
+ string path = Path.Combine(Helper.DirectoryPath, "PlayerData", $"BuildEndurance_data_{Game1.player.name}.txt");
+ if (!File.Exists(path))
+ {
+ Console.WriteLine("Clear Data Loaded could not find the correct file.");
+
+ this.ClearModEffects = false;
+ this.OriginalStamina = 0;
+ this.BaseStaminaBonus = 0;
+ }
+ else
+ {
+ string[] text = File.ReadAllLines(path);
+ this.BaseStaminaBonus = Convert.ToInt32(text[9]);
+ this.ClearModEffects = Convert.ToBoolean(text[14]);
+ this.OriginalStamina = Convert.ToInt32(text[16]);
+ }
+ }
+
+ /// Update based on the latest config file on disk.
+ private void UpdateClearSetting()
+ {
+ if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData")))
+ Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
+
+ string path = Path.Combine(Helper.DirectoryPath, "PlayerData", $"BuildEndurance_data_{Game1.player.name}.txt");
+ if (!File.Exists(path))
+ {
+ Console.WriteLine("Clear Data Loaded could not find the correct file.");
+
+ this.ClearModEffects = false;
+ this.OriginalStamina = 0;
+ this.BaseStaminaBonus = 0;
+ }
+ else
+ {
+ string[] text = File.ReadAllLines(path);
+ this.ClearModEffects = Convert.ToBoolean(text[14]);
+ }
+ }
+
+ /// Load the configuration settings.
+ void LoadConfig()
+ {
+ if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData")))
+ Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
+
+ string path = Path.Combine(Helper.DirectoryPath, "PlayerData", $"BuildEndurance_data_{Game1.player.name}.txt");
+ if (!File.Exists(path))
+ {
+ this.ExpToNextLevel = this.Config.ExpToNextLevel;
+ this.CurrentExp = this.Config.CurrentExp;
+ this.CurrentLevel = this.Config.CurrentLevel;
+ this.BaseStaminaBonus = this.Config.BaseStaminaBonus;
+ this.CurrentLevelStaminaBonus = this.Config.CurrentLevelStaminaBonus;
+ this.ClearModEffects = false;
+ this.OriginalStamina = 0;
+ }
+ else
+ {
+ string[] text = File.ReadAllLines(path);
+ this.CurrentLevel = Convert.ToInt32(text[3]);
+ this.ExpToNextLevel = Convert.ToDouble(text[7]);
+ this.CurrentExp = Convert.ToDouble(text[5]);
+ this.BaseStaminaBonus = Convert.ToInt32(text[9]);
+ this.CurrentLevelStaminaBonus = Convert.ToInt32(text[11]);
+ this.ClearModEffects = Convert.ToBoolean(text[14]);
+ this.OriginalStamina = Convert.ToInt32(text[16]);
+ this.NightlyStamina = Convert.ToInt32(text[18]);
+ }
+ }
+
+ /// Save the configuration settings.
+ void WriteConfig()
+ {
+ if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData")))
+ Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
+
+ string path = Path.Combine(Helper.DirectoryPath, "PlayerData", $"BuildEndurance_data_{Game1.player.name}.txt");
+ string[] text = new string[20];
+ text[0] = "Player: Build Endurance Data. Modification can cause errors. Edit at your own risk.";
+ text[1] = "====================================================================================";
+
+ text[2] = "Player Current Level:";
+ text[3] = this.CurrentLevel.ToString();
+
+ text[4] = "Player Current XP:";
+ text[5] = this.CurrentExp.ToString();
+
+ text[6] = "Xp to next Level:";
+ text[7] = this.ExpToNextLevel.ToString();
+
+ text[8] = "Initial Stam Bonus:";
+ text[9] = this.BaseStaminaBonus.ToString();
+
+ text[10] = "Additional Stam Bonus:";
+ text[11] = this.CurrentLevelStaminaBonus.ToString();
+
+ text[12] = "=======================================================================================";
+ text[13] = "RESET ALL MOD EFFECTS? This will effective start you back at square 1. Also good if you want to remove this mod.";
+ text[14] = this.ClearModEffects.ToString();
+ text[15] = "OLD STAMINA AMOUNT: This is the initial value of the Player's Stamina before this mod took over.";
+ text[16] = this.OriginalStamina.ToString();
+
+ text[17] = "Nightly Stamina Value: This is the value of the player's stamina that was saved when the player slept.";
+ text[18] = this.NightlyStamina.ToString();
+
+ File.WriteAllLines(path, text);
+ }
+ }
+}
diff --git a/GeneralMods/BuildEndurance/BuildEndurance.csproj b/GeneralMods/BuildEndurance/BuildEndurance.csproj
index 2f10904f..16ff6c1a 100644
--- a/GeneralMods/BuildEndurance/BuildEndurance.csproj
+++ b/GeneralMods/BuildEndurance/BuildEndurance.csproj
@@ -32,17 +32,23 @@
..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll
+ False
-
+
+ Properties\GlobalAssemblyInfo.cs
+
+
+
+
diff --git a/GeneralMods/BuildEndurance/Class1.cs b/GeneralMods/BuildEndurance/Class1.cs
deleted file mode 100644
index f8616ead..00000000
--- a/GeneralMods/BuildEndurance/Class1.cs
+++ /dev/null
@@ -1,480 +0,0 @@
-using System;
-using System.IO;
-using System.Text;
-using Newtonsoft.Json;
-using StardewModdingAPI;
-
-namespace Omegasis.BuildEndurance
-{
-
- public class BuildEndurance : Mod
- {
- static bool exhausted_check = false;
- static bool collapse_check = false;
- static double BuildEndurance_data_xp_nextlvl = 20;
- static double BuildEndurance_data_xp_current = 0;
- static int BuildEndurance_data_current_lvl = 0;
- static int BuildEndurance_data_stam_bonus_acumulated = 0;
-
- static int BuildEndurance_data_ini_stam_bonus = 0;
-
- static bool BuildEndurance_data_clear_mod_effects = false;
-
- static int BuildEndurance_data_old_stamina = 0;
-
- static bool tool_cleaner = false;
-
- static bool fed = false;
-
- public Config ModConfig { get; set; }
-
- static bool upon_loading = false;
-
-
- static int nightly_stamina_value = 0;
-
-
- //Credit goes to Zoryn for pieces of this config generation that I kinda repurposed.
- public override void Entry(IModHelper helper)
- {
- StardewModdingAPI.Events.GameEvents.UpdateTick += EatingCallBack; //sloppy again but it'll do.
-
- StardewModdingAPI.Events.GameEvents.OneSecondTick += Tool_Cleanup;
- StardewModdingAPI.Events.GameEvents.UpdateTick += ToolCallBack;
- StardewModdingAPI.Events.SaveEvents.AfterLoad += LoadingCallBack;
- StardewModdingAPI.Events.TimeEvents.DayOfMonthChanged += SleepCallback;
-
- StardewModdingAPI.Events.GameEvents.UpdateTick += Exhaustion_callback;
- StardewModdingAPI.Events.GameEvents.UpdateTick += Collapse_Callback;
-
-
- var configLocation = Path.Combine(helper.DirectoryPath, "BuildEnduranceConfig.json");
- if (!File.Exists(configLocation))
- {
- Monitor.Log("Initial configuration file setup.");
- ModConfig = new Config();
-
- ModConfig.BuildEndurance_current_lvl = 0;
- ModConfig.BuildEndurance_max_lvl = 100;
-
- ModConfig.BuildEndurance_stam_increase_upon_lvl_up = 1;
-
- ModConfig.BuildEndurance_xp_current = 0;
- ModConfig.BuildEndurance_xp_nextlvl = 20;
- ModConfig.BuildEndurance_xp_curve = 1.15;
-
- ModConfig.BuildEndurance_xp_eating = 2;
- ModConfig.BuildEndurance_xp_sleeping = 10;
- ModConfig.BuildEndurance_xp_tooluse = 1;
-
- ModConfig.BuildEndurance_ini_stam_boost = 0;
-
- ModConfig.BuildEndurance_stam_accumulated = 0;
-
- ModConfig.BuildEndurance_Exhaustion_XP = 25;
- ModConfig.BuildEndurance_Pass_Out_XP = 50;
-
-
- File.WriteAllBytes(configLocation, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(ModConfig)));
- }
- else
- {
- ModConfig = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(File.ReadAllBytes(configLocation)));
- Monitor.Log("Found BuildEndurance config file.");
- }
-
- // DataLoader();
- // MyWritter(); //hopefully loading these after the game is loaded will prevent wierd issues.
-
- Monitor.Log("BuildEndurance Initialization Completed");
- }
-
-
- public void ToolCallBack(object sender, EventArgs e) //ultra quick response for checking if a tool is used.
- {
- if (tool_cleaner == true) return;
-
-
- if (StardewValley.Game1.player.usingTool == true)
- {
- // Console.WriteLine("Tool is being used");
- BuildEndurance_data_xp_current += ModConfig.BuildEndurance_xp_tooluse;
- //BuildEndurance_data_xp_current += 1000; For testing purposes
- // Log.Info(BuildEndurance_data_xp_current);
-
- tool_cleaner = true;
- }
- else return;
- }
-
- public void Tool_Cleanup(object sender, EventArgs e) //nerfs how quickly xp is actually gained. I hope.
- {
-
- if (tool_cleaner == true) tool_cleaner = false;
- else return;
- }
-
- public void EatingCallBack(object sender, EventArgs e)
- {
-
-
- if (StardewValley.Game1.isEating == true)
- {
- // Console.WriteLine("NOM NOM NOM");
- fed = true;
-
- //this code will run when the player eats an object. I.E. increases their eating skills.
- }
- //I'm going to assume they ate the food.
- if ((StardewValley.Game1.isEating == false) && fed == true)
- {
- //Console.WriteLine("NOM NOM NOM22222222222");
- BuildEndurance_data_xp_current += ModConfig.BuildEndurance_xp_eating;
- fed = false;
- }
-
-
- return;
- }
-
-
- public void Exhaustion_callback(object sender, EventArgs e) //if the player is exhausted add xp.
- {
-
- if (exhausted_check == false)
- {
- if (StardewValley.Game1.player.exhausted)
- {
- BuildEndurance_data_xp_current += ModConfig.BuildEndurance_Exhaustion_XP;
- exhausted_check = true;
- Monitor.Log("The player is exhausted");
- }
- }
-
-
- }
-
-
-
- public void Collapse_Callback(object sender, EventArgs e) //if the player stays up too late add some xp.
- {
- if (collapse_check == false)
- {
-
- if (StardewValley.Game1.farmerShouldPassOut == true)
- {
-
- BuildEndurance_data_xp_current += ModConfig.BuildEndurance_Pass_Out_XP;
- collapse_check = true;
- Monitor.Log("The player has collapsed!");
- return;
- }
- }
- }
-
-
- public void LoadingCallBack(object sender, EventArgs e)
- {
-
- DataLoader();
- MyWritter();
- upon_loading = true;
- //runs when the player is loaded.
-
- var player = StardewValley.Game1.player;
-
- if (BuildEndurance_data_old_stamina == 0)
- {
- BuildEndurance_data_old_stamina = player.MaxStamina; //grab the initial stamina value
- }
-
-
- player.MaxStamina = nightly_stamina_value;
-
- if (nightly_stamina_value == 0)
- {
- player.MaxStamina = BuildEndurance_data_ini_stam_bonus + BuildEndurance_data_stam_bonus_acumulated + BuildEndurance_data_old_stamina; //incase the ini stam bonus is loaded in.
- }
- if (BuildEndurance_data_clear_mod_effects == true)
- {
- player.MaxStamina = BuildEndurance_data_old_stamina;
- // Console.WriteLine("BuildEndurance Reset!");
- }
-
- DataLoader();
- MyWritter();
- }
-
- public void SleepCallback(object sender, EventArgs e)
- {
- //This will run when the character goes to sleep. It will increase their sleeping skill.
- exhausted_check = false;
- collapse_check = false;
- if (upon_loading == true)
- {
-
- //Log.Info("THIS IS MY NEW DAY CALL BACK XP version 1");
- Monitor.Log(BuildEndurance_data_xp_current.ToString());
-
- Clear_Checker();
- Monitor.Log(BuildEndurance_data_clear_mod_effects.ToString());
-
- var player = StardewValley.Game1.player;
-
- BuildEndurance_data_xp_current += ModConfig.BuildEndurance_xp_sleeping;
-
- if (BuildEndurance_data_old_stamina == 0)
- {
- BuildEndurance_data_old_stamina = player.MaxStamina; //grab the initial stamina value
- }
-
- if (BuildEndurance_data_clear_mod_effects == true)
- {
- Clear_DataLoader();
- player.MaxStamina = BuildEndurance_data_old_stamina;
- BuildEndurance_data_xp_nextlvl = ModConfig.BuildEndurance_xp_nextlvl;
- BuildEndurance_data_xp_current = ModConfig.BuildEndurance_xp_current;
- BuildEndurance_data_stam_bonus_acumulated = 0;
- BuildEndurance_data_old_stamina = player.MaxStamina;
- BuildEndurance_data_ini_stam_bonus = 0;
- BuildEndurance_data_current_lvl = 0;
-
- //because this doesn't work propperly at first anyways.
- // Console.WriteLine("BuildEndurance Reset!");
- }
-
-
- if (BuildEndurance_data_clear_mod_effects == false)
- {
- if (BuildEndurance_data_current_lvl < ModConfig.BuildEndurance_max_lvl)
- {
- while (BuildEndurance_data_xp_current >= BuildEndurance_data_xp_nextlvl)
- {
- BuildEndurance_data_current_lvl += 1;
- BuildEndurance_data_xp_current = BuildEndurance_data_xp_current - BuildEndurance_data_xp_nextlvl;
- BuildEndurance_data_xp_nextlvl = (ModConfig.BuildEndurance_xp_curve * BuildEndurance_data_xp_nextlvl);
- player.MaxStamina += ModConfig.BuildEndurance_stam_increase_upon_lvl_up;
- BuildEndurance_data_stam_bonus_acumulated += ModConfig.BuildEndurance_stam_increase_upon_lvl_up;
-
- }
- }
- }
- BuildEndurance_data_clear_mod_effects = false;
- nightly_stamina_value = StardewValley.Game1.player.maxStamina;
- MyWritter();
- }
- //else Log.Info("Safely Loading.");
- }
-
-
- //Mod config data.
- public class Config
- {
- public double BuildEndurance_xp_nextlvl { get; set; }
- public double BuildEndurance_xp_current { get; set; }
- public double BuildEndurance_xp_curve { get; set; }
-
- public int BuildEndurance_current_lvl { get; set; }
- public int BuildEndurance_max_lvl { get; set; }
-
- public int BuildEndurance_stam_increase_upon_lvl_up { get; set; }
-
- public int BuildEndurance_xp_tooluse { get; set; }
- public int BuildEndurance_xp_eating { get; set; }
- public int BuildEndurance_xp_sleeping { get; set; }
-
- public int BuildEndurance_ini_stam_boost { get; set; }
-
- public int BuildEndurance_stam_accumulated { get; set; }
-
- public int BuildEndurance_Exhaustion_XP { get; set; }
- public int BuildEndurance_Pass_Out_XP { get; set; }
-
- }
-
-
- void Clear_DataLoader()
- {
- DataLoader();
- MyWritter();
- if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData"))) Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath, "PlayerData", "BuildEndurance_data_");
- string mylocation2 = mylocation + myname;
- 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("Clear Data Loaded could not find the correct file.");
-
-
- BuildEndurance_data_clear_mod_effects = false;
- BuildEndurance_data_old_stamina = 0;
- BuildEndurance_data_ini_stam_bonus = 0;
- //return;
- }
-
- else
- {
- //loads the BuildEndurance_data upon loading the mod
- string[] readtext = File.ReadAllLines(mylocation3);
- BuildEndurance_data_ini_stam_bonus = Convert.ToInt32(readtext[9]);
- BuildEndurance_data_clear_mod_effects = Convert.ToBoolean(readtext[14]);
- BuildEndurance_data_old_stamina = Convert.ToInt32(readtext[16]);
-
- }
- }
-
- void Clear_Checker()
- {
-
- //loads the data to the variables upon loading the game.
- if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData"))) Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath, "PlayerData", "BuildEndurance_data_"); ;
- string mylocation2 = mylocation + myname;
- 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("Clear Data Loaded could not find the correct file.");
-
-
- BuildEndurance_data_clear_mod_effects = false;
- BuildEndurance_data_old_stamina = 0;
- BuildEndurance_data_ini_stam_bonus = 0;
- //return;
- }
-
- else
- {
- //loads the BuildEndurance_data upon loading the mod
- string[] readtext = File.ReadAllLines(mylocation3);
- BuildEndurance_data_clear_mod_effects = Convert.ToBoolean(readtext[14]);
-
-
- }
- }
-
-
-
- void DataLoader()
- {
- if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData"))) Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
- //loads the data to the variables upon loading the game.
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath,"PlayerData", "BuildEndurance_data_");
- string mylocation2 = mylocation + myname;
- 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("DataLoading");
- BuildEndurance_data_xp_nextlvl = ModConfig.BuildEndurance_xp_nextlvl;
- BuildEndurance_data_xp_current = ModConfig.BuildEndurance_xp_current;
- BuildEndurance_data_current_lvl = ModConfig.BuildEndurance_current_lvl;
- BuildEndurance_data_ini_stam_bonus = ModConfig.BuildEndurance_ini_stam_boost;
- BuildEndurance_data_stam_bonus_acumulated = ModConfig.BuildEndurance_stam_accumulated;
- BuildEndurance_data_clear_mod_effects = false;
- BuildEndurance_data_old_stamina = 0;
-
- }
-
- else
- {
- // Console.WriteLine("HEY THERE IM LOADING DATA");
-
- //loads the BuildEndurance_data upon loading the mod
- string[] readtext = File.ReadAllLines(mylocation3);
- BuildEndurance_data_current_lvl = Convert.ToInt32(readtext[3]);
- BuildEndurance_data_xp_nextlvl = Convert.ToDouble(readtext[7]); //these array locations refer to the lines in BuildEndurance_data.json
- BuildEndurance_data_xp_current = Convert.ToDouble(readtext[5]);
- BuildEndurance_data_ini_stam_bonus = Convert.ToInt32(readtext[9]);
- BuildEndurance_data_stam_bonus_acumulated = Convert.ToInt32(readtext[11]);
- BuildEndurance_data_clear_mod_effects = Convert.ToBoolean(readtext[14]);
- BuildEndurance_data_old_stamina = Convert.ToInt32(readtext[16]);
- nightly_stamina_value = Convert.ToInt32(readtext[18]); //this should grab the nightly stamina values
- }
- }
-
- void MyWritter()
- {
- //saves the BuildEndurance_data at the end of a new day;
- if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData"))) Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath,"PlayerData", "BuildEndurance_data_");
- string mylocation2 = mylocation + myname;
- string mylocation3 = mylocation2 + ".txt";
- string[] mystring3 = new string[20];
- if (!File.Exists(mylocation3))
- {
- Console.WriteLine("The data file for BuildEndurance was not found, guess I'll create it when you sleep.");
-
- //write out the info to a text file at the end of a day. This will run if it doesnt exist.
-
- mystring3[0] = "Player: Build Endurance Data. Modification can cause errors. Edit at your own risk.";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Player Current Level:";
- mystring3[3] = BuildEndurance_data_current_lvl.ToString();
-
- mystring3[4] = "Player Current XP:";
- mystring3[5] = BuildEndurance_data_xp_current.ToString();
-
- mystring3[6] = "Xp to next Level:";
- mystring3[7] = BuildEndurance_data_xp_nextlvl.ToString();
-
- mystring3[8] = "Initial Stam Bonus:";
- mystring3[9] = BuildEndurance_data_ini_stam_bonus.ToString();
-
- mystring3[10] = "Additional Stam Bonus:";
- mystring3[11] = BuildEndurance_data_stam_bonus_acumulated.ToString();
-
- mystring3[12] = "=======================================================================================";
- mystring3[13] = "RESET ALL MOD EFFECTS? This will effective start you back at square 1. Also good if you want to remove this mod.";
- mystring3[14] = BuildEndurance_data_clear_mod_effects.ToString();
- mystring3[15] = "OLD STAMINA AMOUNT: This is the initial value of the Player's Stamina before this mod took over.";
- mystring3[16] = BuildEndurance_data_old_stamina.ToString();
-
- mystring3[17] = "Nightly Stamina Value: This is the value of the player's stamina that was saved when the player slept.";
- mystring3[18] = nightly_stamina_value.ToString(); //this should save the player's stamina upon sleeping.
-
-
- File.WriteAllLines(mylocation3, mystring3);
- }
-
- else
- {
- // Console.WriteLine("HEY IM SAVING DATA");
-
- //write out the info to a text file at the end of a day.
- mystring3[0] = "Player: Build Endurance Data. Modification can cause errors. Edit at your own risk.";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Player Current Level:";
- mystring3[3] = BuildEndurance_data_current_lvl.ToString();
-
- mystring3[4] = "Player Current XP:";
- mystring3[5] = BuildEndurance_data_xp_current.ToString();
-
- mystring3[6] = "Xp to next Level:";
- mystring3[7] = BuildEndurance_data_xp_nextlvl.ToString();
-
- mystring3[8] = "Initial Stam Bonus:";
- mystring3[9] = BuildEndurance_data_ini_stam_bonus.ToString();
-
- mystring3[10] = "Additional Stam Bonus:";
- mystring3[11] = BuildEndurance_data_stam_bonus_acumulated.ToString();
-
- mystring3[12] = "=======================================================================================";
- mystring3[13] = "RESET ALL MOD EFFECTS? This will effective start you back at square 1. Also good if you want to remove this mod.";
- mystring3[14] = BuildEndurance_data_clear_mod_effects.ToString();
- mystring3[15] = "OLD STAMINA AMOUNT: This is the initial value of the Player's Stamina before this mod took over.";
- mystring3[16] = BuildEndurance_data_old_stamina.ToString();
-
- mystring3[17] = "Nightly Stamina Value: This is the value of the player's stamina that was saved when the player slept.";
- mystring3[18] = nightly_stamina_value.ToString();
-
- File.WriteAllLines(mylocation3, mystring3);
- }
- }
-
- } //end my function
-}
\ No newline at end of file
diff --git a/GeneralMods/BuildEndurance/Framework/ModConfig.cs b/GeneralMods/BuildEndurance/Framework/ModConfig.cs
new file mode 100644
index 00000000..f2a12060
--- /dev/null
+++ b/GeneralMods/BuildEndurance/Framework/ModConfig.cs
@@ -0,0 +1,45 @@
+namespace Omegasis.BuildEndurance.Framework
+{
+ /// The mod settings and player data.
+ internal class ModConfig
+ {
+ /// The XP points needed to reach the next endurance level.
+ public double ExpToNextLevel { get; set; }
+
+ /// The player's current endurance XP points.
+ public double CurrentExp { get; set; }
+
+ /// The player's current endurance level.
+ public int CurrentLevel { get; set; }
+
+ /// The initial stamina bonus to apply regardless of the player's endurance level.
+ public int BaseStaminaBonus { get; set; }
+
+ /// The stamina points to add to the player's base stamina due to their current endurance level.
+ public int CurrentLevelStaminaBonus { get; set; }
+
+ /// The multiplier for the experience points to need to reach an endurance level relative to the previous one.
+ public double ExpCurve { get; set; }
+
+ /// The maximum endurance level the player can reach.
+ public int MaxLevel { get; set; }
+
+ /// The amount of stamina the player should gain for each endurance level.
+ public int StaminaIncreasePerLevel { get; set; }
+
+ /// The experience points to gain for using a tool.
+ public int ExpForToolUse { get; set; }
+
+ /// The experience points to gain for eating or drinking.
+ public int ExpForEating { get; set; }
+
+ /// The experience points to gain for sleeping.
+ public int ExpForSleeping { get; set; }
+
+ /// The experience points to gain for reaching a state of exhaustion for the day.
+ public int ExpForExhaustion { get; set; }
+
+ /// The experience points to gain for collapsing for the day.
+ public int ExpForCollapsing { get; set; }
+ }
+}
diff --git a/GeneralMods/BuildEndurance/Properties/AssemblyInfo.cs b/GeneralMods/BuildEndurance/Properties/AssemblyInfo.cs
index 46480abd..313fcebd 100644
--- a/GeneralMods/BuildEndurance/Properties/AssemblyInfo.cs
+++ b/GeneralMods/BuildEndurance/Properties/AssemblyInfo.cs
@@ -1,36 +1,7 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("BuildEndurance")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("BuildEndurance")]
-[assembly: AssemblyCopyright("Copyright © 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("84b4015d-2619-448c-8672-a3fc167f76ea")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/GeneralMods/BuildEndurance/README.md b/GeneralMods/BuildEndurance/README.md
new file mode 100644
index 00000000..36174664
--- /dev/null
+++ b/GeneralMods/BuildEndurance/README.md
@@ -0,0 +1,32 @@
+**Build Endurance** is a [Stardew Valley](http://stardewvalley.net/) mod which lets you level up
+your endurance to increase your max stamina as you play.
+
+Compatible with Stardew Valley 1.2+ on Linux, Mac, and Windows.
+
+## Installation
+1. [Install the latest version of SMAPI](https://github.com/Pathoschild/SMAPI/releases).
+2. Install [this mod from Nexus mods](http://www.nexusmods.com/stardewvalley/mods/445).
+3. Run the game using SMAPI.
+
+**NOTE:** to undo the mod's changes to your player, edit the `PlayerData\BuildEndurance_data_*.txt`
+file and change the "RESET ALL MOD EFFECTS?" field to `True`.
+
+## Usage
+You'll automatically get XP for...
+
+* using tools;
+* sleeping;
+* eating or drinking;
+* running out of stamina (becoming exhausted);
+* passing out (either by working while exhausted or or staying up late).
+
+Get enough XP, and your endurance will level up.
+
+Edit `BuildEnduranceConfig.json` to configure the mod settings.
+
+## Versions
+1.0
+* Initial release.
+
+1.1:
+* Updated to Stardew Valley 1.1 and SMAPI 0.40 1.1-3.
diff --git a/GeneralMods/BuildEndurance/manifest.json b/GeneralMods/BuildEndurance/manifest.json
index bc855f77..5683189d 100644
--- a/GeneralMods/BuildEndurance/manifest.json
+++ b/GeneralMods/BuildEndurance/manifest.json
@@ -11,4 +11,4 @@
"UniqueID": "4be88c18-b6f3-49b0-ba96-f94b1a5be890",
"PerSaveConfigs": false,
"EntryDll": "BuildEndurance.dll"
-}
\ No newline at end of file
+}
diff --git a/GeneralMods/BuildHealth/BuildHealth.cs b/GeneralMods/BuildHealth/BuildHealth.cs
new file mode 100644
index 00000000..20f4efaf
--- /dev/null
+++ b/GeneralMods/BuildHealth/BuildHealth.cs
@@ -0,0 +1,337 @@
+using System;
+using System.IO;
+using System.Text;
+using Newtonsoft.Json;
+using Omegasis.BuildHealth.Framework;
+using StardewModdingAPI;
+using StardewModdingAPI.Events;
+using StardewValley;
+
+namespace Omegasis.BuildHealth
+{
+ /// The mod entry point.
+ public class BuildHealth : Mod
+ {
+ /*********
+ ** Properties
+ *********/
+ /// The mod settings and player data.
+ private ModConfig Config;
+
+ /// The XP points needed to reach the next level.
+ private double ExpToNextLevel = 20;
+
+ /// The player's current XP points.
+ private double CurrentExp;
+
+ /// The player's current level.
+ private int CurrentLevel;
+
+ /// The health points to add to the player's base health due to their current level.
+ private int CurrentLevelHealthBonus;
+
+ /// The initial health bonus to apply regardless of the player's level, from the config file.
+ private int BaseHealthBonus;
+
+ /// Whether to reset all changes by the mod to the default values (i.e. start over).
+ private bool ClearModEffects;
+
+ /// The player's original max health value, excluding mod effects.
+ private int OriginalMaxHealth;
+
+ /// Whether the player recently gained XP for tool use.
+ private bool HasRecentToolExp;
+
+ /// Whether the player was eating last time we checked.
+ private bool WasEating;
+
+ /// The player's health last time we checked it.
+ private int LastHealth;
+
+ /// Whether the player has loaded a save.
+ private bool IsLoaded;
+
+ /// Whether the player has collapsed today.
+ private bool WasCollapsed;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// The mod entry point, called after the mod is first loaded.
+ /// Provides simplified APIs for writing mods.
+ public override void Entry(IModHelper helper)
+ {
+ GameEvents.UpdateTick += this.GameEvents_UpdateTick;
+ GameEvents.OneSecondTick += this.GameEvents_OneSecondTick;
+
+ TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
+ SaveEvents.AfterLoad += this.SaveEvents_AfterLoaded;
+
+ var configPath = Path.Combine(helper.DirectoryPath, "BuildHealthConfig.json");
+ if (!File.Exists(configPath))
+ {
+ this.Config = new ModConfig
+ {
+ CurrentLevel = 0,
+ MaxLevel = 100,
+ HealthIncreasePerLevel = 1,
+ CurrentExp = 0,
+ ExpToNextLevel = 20,
+ ExpCurve = 1.15,
+ ExpForEating = 2,
+ ExpForSleeping = 10,
+ ExpForToolUse = 1,
+ BaseHealthBonus = 0,
+ CurrentLevelHealthBonus = 0
+ };
+ File.WriteAllBytes(configPath, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(this.Config)));
+ }
+ else
+ {
+ this.Config = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(File.ReadAllBytes(configPath)));
+ this.Monitor.Log("Found BuildHealth config file.");
+ }
+
+ this.Monitor.Log("BuildHealth Initialization Completed");
+ }
+
+ /// The method invoked once per second during a game update.
+ /// The event sender.
+ /// The event data.
+ public void GameEvents_OneSecondTick(object sender, EventArgs e)
+ {
+ // nerf how quickly tool xp is gained (I hope)
+ if (this.HasRecentToolExp)
+ this.HasRecentToolExp = false;
+ }
+
+ /// The method invoked when the game updates (roughly 60 times per second).
+ /// The event sender.
+ /// The event data.
+ public void GameEvents_UpdateTick(object sender, EventArgs e)
+ {
+ // give XP when player finishes eating
+ if (Game1.isEating)
+ this.WasEating = true;
+ else if (this.WasEating)
+ {
+ this.CurrentExp += this.Config.ExpForEating;
+ this.WasEating = false;
+ }
+
+ // give XP when player uses tool
+ if (!this.HasRecentToolExp && Game1.player.usingTool)
+ {
+ this.CurrentExp += this.Config.ExpForToolUse;
+ this.HasRecentToolExp = true;
+ }
+
+ // give XP for taking damage
+ var player = Game1.player;
+ if (this.LastHealth > player.health)
+ {
+ this.CurrentExp += this.LastHealth - player.health;
+ this.LastHealth = player.health;
+ }
+ else if (this.LastHealth < player.health)
+ this.LastHealth = player.health;
+
+ // give XP when player stays up too late or collapses
+ if (!this.WasCollapsed && Game1.farmerShouldPassOut)
+ {
+ this.CurrentExp += this.Config.ExpForCollapsing;
+ this.WasCollapsed = true;
+ this.Monitor.Log("The player has collapsed!");
+ }
+ }
+
+ /// The method invoked when changes.
+ /// The event sender.
+ /// The event data.
+ public void TimeEvents_DayOfMonthChanged(object sender, EventArgs e)
+ {
+ // reset data
+ this.LastHealth = Game1.player.maxHealth;
+ this.WasCollapsed = false;
+ if (!this.IsLoaded)
+ return;
+
+ // update settings
+ this.UpdateClearSetting();
+
+ var player = StardewValley.Game1.player;
+ this.CurrentExp += this.Config.ExpForSleeping;
+ if (this.OriginalMaxHealth == 0)
+ this.OriginalMaxHealth = player.maxHealth; //grab the initial Health value
+
+ if (this.ClearModEffects)
+ {
+ this.LoadClearSettings();
+ //This will run when the character goes to sleep. It will increase their sleeping skill.
+ player.maxHealth = this.OriginalMaxHealth;
+ this.ExpToNextLevel = this.Config.ExpToNextLevel;
+ this.CurrentExp = this.Config.CurrentExp;
+ this.CurrentLevelHealthBonus = 0;
+ this.OriginalMaxHealth = player.maxHealth;
+ this.BaseHealthBonus = 0;
+ this.CurrentLevel = 0;
+ this.Monitor.Log("BuildHealth Reset!");
+ }
+
+ if (!this.ClearModEffects && this.CurrentLevel < this.Config.MaxLevel)
+ {
+ while (this.CurrentExp >= this.ExpToNextLevel)
+ {
+ this.CurrentLevel += 1;
+ this.CurrentExp = this.CurrentExp - this.ExpToNextLevel;
+ this.ExpToNextLevel =
+ (this.Config.ExpCurve * this.ExpToNextLevel);
+ player.maxHealth += this.Config.HealthIncreasePerLevel;
+ this.CurrentLevelHealthBonus += this.Config.HealthIncreasePerLevel;
+ }
+ }
+ this.ClearModEffects = false;
+
+ this.WriteConfig();
+ }
+
+ /// The method invoked after the player loads a save.
+ /// The event sender.
+ /// The event data.
+ public void SaveEvents_AfterLoaded(object sender, EventArgs e)
+ {
+ // initialise
+ this.LoadConfig();
+ this.WriteConfig();
+ this.IsLoaded = true;
+
+ // grab initial health
+ var player = Game1.player;
+ if (this.OriginalMaxHealth == 0)
+ this.OriginalMaxHealth = player.maxHealth;
+
+ // set max health
+ player.maxHealth = this.BaseHealthBonus + this.CurrentLevelHealthBonus + this.OriginalMaxHealth;
+
+ // reset if needed
+ if (this.ClearModEffects)
+ {
+ player.maxHealth = this.OriginalMaxHealth;
+ this.Monitor.Log("BuildHealth Reset!");
+ }
+
+ // save config
+ this.LastHealth = Game1.player.maxHealth;
+ this.LoadConfig();
+ this.WriteConfig();
+ }
+
+ /// Update the settings needed for from the latest config file on disk.
+ void LoadClearSettings()
+ {
+ if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData")))
+ Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
+
+ string path = Path.Combine(Helper.DirectoryPath, "PlayerData", $"BuildHealth_data_{Game1.player.name}.txt");
+ if (!File.Exists(path))
+ {
+ this.ClearModEffects = false;
+ this.OriginalMaxHealth = 0;
+ this.BaseHealthBonus = 0;
+ }
+ else
+ {
+ string[] text = File.ReadAllLines(path);
+ this.BaseHealthBonus = Convert.ToInt32(text[9]);
+ this.ClearModEffects = Convert.ToBoolean(text[14]);
+ this.OriginalMaxHealth = Convert.ToInt32(text[16]);
+ }
+ }
+
+ /// Update based on the latest config file on disk.
+ private void UpdateClearSetting()
+ {
+ if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData")))
+ Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
+
+ string path = Path.Combine(Helper.DirectoryPath, "PlayerData", $"BuildHealth_data_{Game1.player.name}.txt");
+ if (!File.Exists(path))
+ {
+ this.ClearModEffects = false;
+ this.OriginalMaxHealth = 0;
+ this.BaseHealthBonus = 0;
+ }
+ else
+ {
+ string[] text = File.ReadAllLines(path);
+ this.ClearModEffects = Convert.ToBoolean(text[14]);
+ }
+ }
+
+ /// Load the configuration settings.
+ private void LoadConfig()
+ {
+ if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData")))
+ Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
+
+ string path = Path.Combine(Helper.DirectoryPath, "PlayerData", $"BuildHealth_data_{Game1.player.name}.txr");
+ if (!File.Exists(path))
+ {
+ this.ExpToNextLevel = this.Config.ExpToNextLevel;
+ this.CurrentExp = this.Config.CurrentExp;
+ this.CurrentLevel = this.Config.CurrentLevel;
+ this.BaseHealthBonus = this.Config.BaseHealthBonus;
+ this.CurrentLevelHealthBonus = this.Config.CurrentLevelHealthBonus;
+ this.ClearModEffects = false;
+ this.OriginalMaxHealth = 0;
+ }
+ else
+ {
+ string[] text = File.ReadAllLines(path);
+ this.CurrentLevel = Convert.ToInt32(text[3]);
+ this.ExpToNextLevel = Convert.ToDouble(text[7]);
+ this.CurrentExp = Convert.ToDouble(text[5]);
+ this.BaseHealthBonus = Convert.ToInt32(text[9]);
+ this.CurrentLevelHealthBonus = Convert.ToInt32(text[11]);
+ this.ClearModEffects = Convert.ToBoolean(text[14]);
+ this.OriginalMaxHealth = Convert.ToInt32(text[16]);
+ }
+ }
+
+ /// Save the configuration settings.
+ private void WriteConfig()
+ {
+ if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData")))
+ Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
+
+ string path = Path.Combine(Helper.DirectoryPath, "PlayerData", $"BuildHealth_data_{Game1.player.name}.txt");
+ string[] text = new string[20];
+ text[0] = "Player: Build Health Data. Modification can cause errors. Edit at your own risk.";
+ text[1] = "====================================================================================";
+
+ text[2] = "Player Current Level:";
+ text[3] = this.CurrentLevel.ToString();
+
+ text[4] = "Player Current XP:";
+ text[5] = this.CurrentExp.ToString();
+
+ text[6] = "Xp to next Level:";
+ text[7] = this.ExpToNextLevel.ToString();
+
+ text[8] = "Initial Health Bonus:";
+ text[9] = this.BaseHealthBonus.ToString();
+
+ text[10] = "Additional Health Bonus:";
+ text[11] = this.CurrentLevelHealthBonus.ToString();
+
+ text[12] = "=======================================================================================";
+ text[13] = "RESET ALL MOD EFFECTS? This will effective start you back at square 1. Also good if you want to remove this mod.";
+ text[14] = this.ClearModEffects.ToString();
+ text[15] = "OLD Health AMOUNT: This is the initial value of the Player's Health before this mod took over.";
+ text[16] = this.OriginalMaxHealth.ToString();
+
+ File.WriteAllLines(path, text);
+ }
+ }
+}
diff --git a/GeneralMods/BuildHealth/BuildHealth.csproj b/GeneralMods/BuildHealth/BuildHealth.csproj
index 7d6078aa..40c8afd8 100644
--- a/GeneralMods/BuildHealth/BuildHealth.csproj
+++ b/GeneralMods/BuildHealth/BuildHealth.csproj
@@ -32,18 +32,23 @@
..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll
+ False
-
+
+ Properties\GlobalAssemblyInfo.cs
+
+
+
-
+
diff --git a/GeneralMods/BuildHealth/Class1.cs b/GeneralMods/BuildHealth/Class1.cs
deleted file mode 100644
index 2c0bef28..00000000
--- a/GeneralMods/BuildHealth/Class1.cs
+++ /dev/null
@@ -1,462 +0,0 @@
-using System;
-using System.IO;
-using System.Text;
-using Newtonsoft.Json;
-using StardewModdingAPI;
-
-namespace Omegasis.BuildHealth
-{
-
- public class BuildHealth : Mod
- {
- public double BuildHealth_data_xp_nextlvl=20;
- public double BuildHealth_data_xp_current=0;
-
- public int BuildHealth_data_current_lvl=0;
-
- public int BuildHealth_data_health_bonus_acumulated=0;
-
- public int BuildHealth_data_ini_health_bonus=0;
-
- public bool BuildHealth_data_clear_mod_effects = false;
-
- public int BuildHealth_data_old_health = 0;
-
- public bool tool_cleaner = false;
-
- public bool fed = false;
-
-
- public int old_health;
-
- public int new_health;
-
-
-
- public Config ModConfig { get; set; }
-
- public static bool upon_loading = false;
-
- public bool collapse_check;
-
- //Credit goes to Zoryn for pieces of this config generation that I kinda repurposed.
- public override void Entry(IModHelper helper)
- {
-
- StardewModdingAPI.Events.TimeEvents.DayOfMonthChanged += SleepCallback;
- StardewModdingAPI.Events.GameEvents.UpdateTick += EatingCallBack; //sloppy again but it'll do.
-
- StardewModdingAPI.Events.GameEvents.OneSecondTick += Tool_Cleanup;
- StardewModdingAPI.Events.GameEvents.UpdateTick += ToolCallBack;
- StardewModdingAPI.Events.SaveEvents.AfterLoad += LoadingCallBack;
- StardewModdingAPI.Events.GameEvents.UpdateTick += Collapse_Callback;
-
- StardewModdingAPI.Events.GameEvents.UpdateTick += damage_check;
-
- var configLocation = Path.Combine(helper.DirectoryPath, "BuildHealthConfig.json");
- if (!File.Exists(configLocation))
- {
- Monitor.Log("The config file for BuildHealth was not found, guess I'll create it...");
- ModConfig = new Config();
-
- ModConfig.BuildHealth_current_lvl = 0;
- ModConfig.BuildHealth_max_lvl = 100;
-
- ModConfig.BuildHealth_Health_increase_upon_lvl_up = 1;
-
- ModConfig.BuildHealth_xp_current = 0;
- ModConfig.BuildHealth_xp_nextlvl = 20;
- ModConfig.BuildHealth_xp_curve = 1.15;
-
- ModConfig.BuildHealth_xp_eating = 2;
- ModConfig.BuildHealth_xp_sleeping = 10;
- ModConfig.BuildHealth_xp_tooluse = 1;
-
- ModConfig.BuildHealth_ini_Health_boost = 0;
-
- ModConfig.BuildHealth_Health_accumulated = 0;
-
- File.WriteAllBytes(configLocation, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(ModConfig)));
- }
- else
- {
- ModConfig = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(File.ReadAllBytes(configLocation)));
- Monitor.Log("Found BuildHealth config file.");
- }
-
- // DataLoader();
- // MyWritter();
- Monitor.Log("BuildHealth Initialization Completed");
- }
-
-
-
- public void ToolCallBack(object sender, EventArgs e) //ultra quick response for checking if a tool is used.
- {
- if (tool_cleaner == true) return;
-
-
- if (StardewValley.Game1.player.usingTool == true)
- {
- //Monitor.Log("Tool is being used");
- BuildHealth_data_xp_current += ModConfig.BuildHealth_xp_tooluse;
- tool_cleaner = true;
- }
- else return;
- }
-
- public void Tool_Cleanup(object sender, EventArgs e) //nerfs how quickly xp is actually gained. I hope.
- {
-
- if (tool_cleaner == true) tool_cleaner = false;
- else return;
- }
-
- public void EatingCallBack(object sender, EventArgs e)
- {
-
-
- if (StardewValley.Game1.isEating == true)
- {
- // Monitor.Log("NOM NOM NOM");
- fed = true;
-
- //this code will run when the player eats an object. I.E. increases their eating skills.
- }
- //I'm going to assume they ate the food.
- if ((StardewValley.Game1.isEating == false) && fed == true)
- {
- // Monitor.Log("NOM NOM NOM");
- BuildHealth_data_xp_current += ModConfig.BuildHealth_xp_eating;
- fed = false;
- }
-
-
- return;
- }
-
-
-
- public void damage_check(object sender, EventArgs e)
- {
- var player = StardewValley.Game1.player;
-
- if (old_health > player.health)
- {
- BuildHealth_data_xp_current += (old_health - player.health);
- //Log.Info(old_health - player.health);
- old_health = (player.health);
-
- }
- if (old_health < player.health)
- {
- old_health = player.health;
- }
-
-
-
- return;
- }
-
-
-
-
- public void SleepCallback(object sender, EventArgs e)
- {
- collapse_check = false;
- if (upon_loading ==true){
-
- Clear_Checker();
-
- var player = StardewValley.Game1.player;
-
- BuildHealth_data_xp_current += ModConfig.BuildHealth_xp_sleeping;
-
- if (BuildHealth_data_old_health == 0)
- {
- BuildHealth_data_old_health = player.maxHealth; //grab the initial Health value
- }
-
- if (BuildHealth_data_clear_mod_effects == true)
- {
- Clear_DataLoader();
- //This will run when the character goes to sleep. It will increase their sleeping skill.
- player.maxHealth = BuildHealth_data_old_health;
- BuildHealth_data_xp_nextlvl = ModConfig.BuildHealth_xp_nextlvl;
- BuildHealth_data_xp_current = ModConfig.BuildHealth_xp_current;
- BuildHealth_data_health_bonus_acumulated = 0;
- BuildHealth_data_old_health = player.maxHealth;
- BuildHealth_data_ini_health_bonus = 0;
- BuildHealth_data_current_lvl = 0;
- Monitor.Log("BuildHealth Reset!");
- }
-
-
- if (BuildHealth_data_clear_mod_effects == false)
- {
- if (BuildHealth_data_current_lvl < ModConfig.BuildHealth_max_lvl)
- {
- while (BuildHealth_data_xp_current >= BuildHealth_data_xp_nextlvl)
- {
- BuildHealth_data_current_lvl += 1;
- BuildHealth_data_xp_current = BuildHealth_data_xp_current - BuildHealth_data_xp_nextlvl;
- BuildHealth_data_xp_nextlvl = (ModConfig.BuildHealth_xp_curve * BuildHealth_data_xp_nextlvl);
- player.maxHealth += ModConfig.BuildHealth_Health_increase_upon_lvl_up;
- BuildHealth_data_health_bonus_acumulated += ModConfig.BuildHealth_Health_increase_upon_lvl_up;
- }
-
-
- }
- }
- BuildHealth_data_clear_mod_effects = false;
-
- MyWritter();
- }
-
- old_health = StardewValley.Game1.player.maxHealth;
-
-
- }
-
-
- public void LoadingCallBack(object sender, EventArgs e)
- {
- DataLoader();
- MyWritter();
- upon_loading=true;
- //runs when the player is loaded.
- var player = StardewValley.Game1.player;
-
- if (BuildHealth_data_old_health == 0)
- {
- BuildHealth_data_old_health = player.maxHealth; //grab the initial health value
- }
-
- player.maxHealth = BuildHealth_data_ini_health_bonus + BuildHealth_data_health_bonus_acumulated + BuildHealth_data_old_health; //incase the ini stam bonus is loaded in.
-
- if (BuildHealth_data_clear_mod_effects == true)
- {
- player.maxHealth = BuildHealth_data_old_health;
- Monitor.Log("BuildHealth Reset!");
- }
-
- DataLoader();
- MyWritter();
-
- old_health = StardewValley.Game1.player.maxHealth;
- }
-
-
- public void Collapse_Callback(object sender, EventArgs e) //if the player stays up too late add some xp.
- {
- if (collapse_check == false)
- {
-
- if (StardewValley.Game1.farmerShouldPassOut == true)
- {
-
- BuildHealth_data_xp_current += ModConfig.BuildHealth_Pass_Out_XP;
- collapse_check = true;
- Monitor.Log("The player has collapsed!");
- return;
- }
- }
- }
-
-
- //Mod config data.
- public class Config
- {
- public double BuildHealth_xp_nextlvl { get; set; }
- public double BuildHealth_xp_current { get; set; }
- public double BuildHealth_xp_curve { get; set; }
-
- public int BuildHealth_current_lvl { get; set; }
- public int BuildHealth_max_lvl { get; set; }
-
- public int BuildHealth_Health_increase_upon_lvl_up { get; set; }
-
- public int BuildHealth_xp_tooluse { get; set; }
- public int BuildHealth_xp_eating { get; set; }
- public int BuildHealth_xp_sleeping { get; set; }
-
- public int BuildHealth_ini_Health_boost { get; set; }
-
- public int BuildHealth_Health_accumulated { get; set; }
-
- public int BuildHealth_Pass_Out_XP { get; set; }
-
- }
-
-
- void Clear_DataLoader()
- {
- if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData"))) Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath, "PlayerData", "BuildHealth_data_");
- string mylocation2 = mylocation+myname;
- 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.
- {
- Monitor.Log("The config file for BuildHealth was not found, guess I'll create it...");
-
-
- BuildHealth_data_clear_mod_effects = false;
- BuildHealth_data_old_health = 0;
- BuildHealth_data_ini_health_bonus = 0;
- }
-
- else
- {
- //loads the BuildHealth_data upon loading the mod
- string[] readtext = File.ReadAllLines(mylocation3);
- BuildHealth_data_ini_health_bonus = Convert.ToInt32(readtext[9]);
- BuildHealth_data_clear_mod_effects = Convert.ToBoolean(readtext[14]);
- BuildHealth_data_old_health = Convert.ToInt32(readtext[16]);
-
- }
- }
-
- void Clear_Checker()
- {
- //loads the data to the variables upon loading the game.
- if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData"))) Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath, "PlayerData", "BuildHealth_data_");
- string mylocation2 = mylocation + myname;
- 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.
- {
- Monitor.Log("The config file for BuildHealth was not found, guess I'll create it...");
-
-
- BuildHealth_data_clear_mod_effects = false;
- BuildHealth_data_old_health = 0;
- BuildHealth_data_ini_health_bonus = 0;
- }
-
- else
- {
- //loads the BuildHealth_data upon loading the mod
- string[] readtext = File.ReadAllLines(mylocation3);
- BuildHealth_data_clear_mod_effects = Convert.ToBoolean(readtext[14]);
-
- }
- }
-
-
- void DataLoader()
- {
- if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData"))) Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath, "PlayerData", "BuildHealth_data_");
- string mylocation2 = mylocation+myname;
- 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.
- {
- Monitor.Log("The config file for BuildHealth was not found, guess I'll create it...");
- BuildHealth_data_xp_nextlvl = ModConfig.BuildHealth_xp_nextlvl;
- BuildHealth_data_xp_current = ModConfig.BuildHealth_xp_current;
- BuildHealth_data_current_lvl = ModConfig.BuildHealth_current_lvl;
- BuildHealth_data_ini_health_bonus = ModConfig.BuildHealth_ini_Health_boost;
- BuildHealth_data_health_bonus_acumulated = ModConfig.BuildHealth_Health_accumulated;
- BuildHealth_data_clear_mod_effects = false;
- BuildHealth_data_old_health = 0;
-
- }
-
- else
- {
- // Monitor.Log("HEY THERE IM LOADING DATA");
-
- //loads the BuildHealth_data upon loading the mod
- string[] readtext = File.ReadAllLines(mylocation3);
- BuildHealth_data_current_lvl = Convert.ToInt32(readtext[3]);
- BuildHealth_data_xp_nextlvl = Convert.ToDouble(readtext[7]); //these array locations refer to the lines in BuildHealth_data.json
- BuildHealth_data_xp_current = Convert.ToDouble(readtext[5]);
- BuildHealth_data_ini_health_bonus = Convert.ToInt32(readtext[9]);
- BuildHealth_data_health_bonus_acumulated = Convert.ToInt32(readtext[11]);
- BuildHealth_data_clear_mod_effects = Convert.ToBoolean(readtext[14]);
- BuildHealth_data_old_health = Convert.ToInt32(readtext[16]);
-
- }
- }
-
- void MyWritter()
- {
- if (!Directory.Exists(Path.Combine(Helper.DirectoryPath, "PlayerData"))) Directory.CreateDirectory(Path.Combine(Helper.DirectoryPath, "PlayerData"));
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath, "PlayerData", "BuildHealth_data_");
- string mylocation2 = mylocation+myname;
- string mylocation3 = mylocation2+".txt";
- string[] mystring3 = new string[20];
- if (!File.Exists(mylocation3))
- {
- Monitor.Log("The data file for BuildHealth was not found, guess I'll create it when you sleep.");
-
- //write out the info to a text file at the end of a day. This will run if it doesnt exist.
-
- mystring3[0] = "Player: Build Health Data. Modification can cause errors. Edit at your own risk.";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Player Current Level:";
- mystring3[3] = BuildHealth_data_current_lvl.ToString();
-
- mystring3[4] = "Player Current XP:";
- mystring3[5] = BuildHealth_data_xp_current.ToString();
-
- mystring3[6] = "Xp to next Level:";
- mystring3[7] = BuildHealth_data_xp_nextlvl.ToString();
-
- mystring3[8] = "Initial Health Bonus:";
- mystring3[9] = BuildHealth_data_ini_health_bonus.ToString();
-
- mystring3[10] = "Additional Health Bonus:";
- mystring3[11] = BuildHealth_data_health_bonus_acumulated.ToString();
-
- mystring3[12] = "=======================================================================================";
- mystring3[13] = "RESET ALL MOD EFFECTS? This will effective start you back at square 1. Also good if you want to remove this mod.";
- mystring3[14] = BuildHealth_data_clear_mod_effects.ToString();
- mystring3[15] = "OLD Health AMOUNT: This is the initial value of the Player's Health before this mod took over.";
- mystring3[16] = BuildHealth_data_old_health.ToString();
-
-
- File.WriteAllLines(mylocation3, mystring3);
- }
-
- else
- {
- // Monitor.Log("HEY IM SAVING DATA");
-
- //write out the info to a text file at the end of a day.
- mystring3[0] = "Player: Build Health Data. Modification can cause errors. Edit at your own risk.";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Player Current Level:";
- mystring3[3] = BuildHealth_data_current_lvl.ToString();
-
- mystring3[4] = "Player Current XP:";
- mystring3[5] = BuildHealth_data_xp_current.ToString();
-
- mystring3[6] = "Xp to next Level:";
- mystring3[7] = BuildHealth_data_xp_nextlvl.ToString();
-
- mystring3[8] = "Initial Health Bonus:";
- mystring3[9] = BuildHealth_data_ini_health_bonus.ToString();
-
- mystring3[10] = "Additional Health Bonus:";
- mystring3[11] = BuildHealth_data_health_bonus_acumulated.ToString();
-
- mystring3[12] = "=======================================================================================";
- mystring3[13] = "RESET ALL MOD EFFECTS? This will effective start you back at square 1. Also good if you want to remove this mod.";
- mystring3[14] = BuildHealth_data_clear_mod_effects.ToString();
- mystring3[15] = "OLD Health AMOUNT: This is the initial value of the Player's Health before this mod took over.";
- mystring3[16] = BuildHealth_data_old_health.ToString();
-
-
- File.WriteAllLines(mylocation3, mystring3);
- }
- }
-
- } //end my function
-}
\ No newline at end of file
diff --git a/GeneralMods/BuildHealth/Framework/ModConfig.cs b/GeneralMods/BuildHealth/Framework/ModConfig.cs
new file mode 100644
index 00000000..7fb1cf14
--- /dev/null
+++ b/GeneralMods/BuildHealth/Framework/ModConfig.cs
@@ -0,0 +1,42 @@
+namespace Omegasis.BuildHealth.Framework
+{
+ /// The mod settings and player data.
+ internal class ModConfig
+ {
+ /// The XP points needed to reach the next level.
+ public double ExpToNextLevel { get; set; }
+
+ /// The player's current XP points.
+ public double CurrentExp { get; set; }
+
+ /// The player's current level.
+ public int CurrentLevel { get; set; }
+
+ /// The initial health bonus to apply regardless of the player's level, from the config file.
+ public int BaseHealthBonus { get; set; }
+
+ /// The health points to add to the player's base health due to their current level.
+ public int CurrentLevelHealthBonus { get; set; }
+
+ /// The multiplier for the experience points to need to reach an endurance level relative to the previous one.
+ public double ExpCurve { get; set; }
+
+ /// The maximum endurance level the player can reach.
+ public int MaxLevel { get; set; }
+
+ /// The amount of stamina the player should gain for each endurance level.
+ public int HealthIncreasePerLevel { get; set; }
+
+ /// The experience points to gain for using a tool.
+ public int ExpForToolUse { get; set; }
+
+ /// The experience points to gain for eating or drinking.
+ public int ExpForEating { get; set; }
+
+ /// The experience points to gain for sleeping.
+ public int ExpForSleeping { get; set; }
+
+ /// The experience points to gain for collapsing for the day.
+ public int ExpForCollapsing { get; set; }
+ }
+}
diff --git a/GeneralMods/BuildHealth/Properties/AssemblyInfo.cs b/GeneralMods/BuildHealth/Properties/AssemblyInfo.cs
index 42a73c25..d939e8da 100644
--- a/GeneralMods/BuildHealth/Properties/AssemblyInfo.cs
+++ b/GeneralMods/BuildHealth/Properties/AssemblyInfo.cs
@@ -1,36 +1,7 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("BuildHealth")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("BuildHealth")]
-[assembly: AssemblyCopyright("Copyright © 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("99183bd6-6243-4ae6-b2d8-7cea915b1278")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/GeneralMods/BuildHealth/ReadMe.md b/GeneralMods/BuildHealth/ReadMe.md
index 79fdca6b..a0ade205 100644
--- a/GeneralMods/BuildHealth/ReadMe.md
+++ b/GeneralMods/BuildHealth/ReadMe.md
@@ -1,33 +1,33 @@
-[SMAPI]BuildEndurance
-Initial Release 4/10/16 10:40 PM
-Updated: 10/11/16 12:55 AM
+**Build Health** is a [Stardew Valley](http://stardewvalley.net/) mod which lets you level up
+your endurance to increase your max health as you play.
-Compatability:
-Windows
+Compatible with Stardew Valley 1.2+ on Linux, Mac, and Windows.
-Updates:
-1.1.0 10/11/16 12:55 AM
--Updated to SDV 1.1
+## Installation
+1. [Install the latest version of SMAPI](https://github.com/Pathoschild/SMAPI/releases).
+2. Install [this mod from Nexus mods](http://www.nexusmods.com/stardewvalley/mods/445).
+3. Run the game using SMAPI.
-v1.0.0 4/10/16 10:40 PM PST
+**NOTE:** to undo the mod's changes to your player, edit the `PlayerData\BuildEndurance_data_*.txt`
+file and change the "RESET ALL MOD EFFECTS?" field to `True`.
-Description
--Fixed the glitch where eating and using tools would not net you xp.
+## Usage
+You'll automatically get XP for...
-This is the BuildEndurance mod, which can increase your max health in a couple of different ways! As you partake in the tasks below, you gain xp points, and when you reach enough xp points, your max health will increase!
+* using tools;
+* sleeping;
+* eating or drinking;
+* taking damage;
+* running out of stamina (becoming exhausted);
+* passing out (either by working while exhausted or or staying up late).
-Ways to increase maximum health:
+Get enough XP, and your health will level up.
-Use tools.
+Edit `BuildHealthConfig.json` to configure the mod settings.
-Eating Food.
+## Versions
+1.0
+* Initial release.
-Sleeping!
-
-I'm up to a few more suggestions as well that can add to this list.
-
-All of the data can be set up/edited in BuildEndurance_Config.tx. If you want to increase/decrease any of the values such as the xp to level up, the maximum level, or even the amount of health you gain upon level up can be found here.
-
-All data values currently associated with the character can also be change around with BuildEndurance_data.txt
-
-NOTE! If at any time you want to remove/reverse the properties set by this mod, open up the BuildEndurance_data.txt file and set the value associated with resetting the mod data to true! This will revert the player's max health to the value initially stored when the mod was installed/ the value associate with old health.
+1.1:
+* Updated to Stardew Valley 1.1 and SMAPI 0.40 1.1-3.
diff --git a/GeneralMods/BuildHealth/manifest.json b/GeneralMods/BuildHealth/manifest.json
index 568ac3f2..625f3023 100644
--- a/GeneralMods/BuildHealth/manifest.json
+++ b/GeneralMods/BuildHealth/manifest.json
@@ -11,4 +11,4 @@
"UniqueID": "4be88c18-b6f3-49b0-ba96-f94b1a5be890",
"PerSaveConfigs": false,
"EntryDll": "BuildHealth.dll"
-}
\ No newline at end of file
+}
diff --git a/GeneralMods/BuyBackCollectables/BuyBackCollectables.cs b/GeneralMods/BuyBackCollectables/BuyBackCollectables.cs
new file mode 100644
index 00000000..f46c8ae1
--- /dev/null
+++ b/GeneralMods/BuyBackCollectables/BuyBackCollectables.cs
@@ -0,0 +1,96 @@
+using System;
+using System.IO;
+using Omegasis.BuyBackCollectables.Framework;
+using StardewModdingAPI;
+using StardewModdingAPI.Events;
+using StardewValley;
+
+namespace Omegasis.BuyBackCollectables
+{
+ /// The mod entry point.
+ public class BuyBackCollectables : Mod
+ {
+ /*********
+ ** Properties
+ *********/
+ /// The key which shows the menu.
+ private string KeyBinding = "B";
+
+ /// The multiplier applied to the cost of buying back a collectable.
+ private double CostMultiplier = 3.0;
+
+ /// Whether the player loaded a save.
+ private bool IsGameLoaded;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// The mod entry point, called after the mod is first loaded.
+ /// Provides simplified APIs for writing mods.
+ public override void Entry(IModHelper helper)
+ {
+ SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
+ ControlEvents.KeyPressed += this.ControlEvents_KeyPressed;
+ }
+
+
+ /*********
+ ** Private methods
+ *********/
+ /// The method invoked after the player loads a save.
+ /// The event sender.
+ /// The event data.
+ public void SaveEvents_AfterLoad(object sender, EventArgs e)
+ {
+ this.IsGameLoaded = true;
+ this.LoadConfig();
+ this.WriteConfig();
+ }
+
+ /// The method invoked when the presses a keyboard button.
+ /// The event sender.
+ /// The event data.
+ public void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
+ {
+ if (Game1.player == null || Game1.player.currentLocation == null || !this.IsGameLoaded || Game1.activeClickableMenu != null)
+ return;
+
+ if (e.KeyPressed.ToString() == this.KeyBinding)
+ Game1.activeClickableMenu = new BuyBackMenu(this.CostMultiplier);
+ }
+
+ /// Load the configuration settings.
+ private void LoadConfig()
+ {
+ //loads the data to the variables upon loading the game.
+ string path = Path.Combine(Helper.DirectoryPath, "BuyBack_Config.txt");
+ if (!File.Exists(path))
+ {
+ this.KeyBinding = "B";
+ this.CostMultiplier = 3.0;
+ }
+ else
+ {
+ string[] text = File.ReadAllLines(path);
+ this.KeyBinding = Convert.ToString(text[3]);
+ this.CostMultiplier = Convert.ToDouble(text[5]);
+ }
+ }
+
+ /// Save the configuration settings.
+ private void WriteConfig()
+ {
+ //write all of my info to a text file.
+ string path = Path.Combine(Helper.DirectoryPath, "BuyBack_Config.txt");
+ string[] text = new string[20];
+ text[0] = "Config: Buy Back Collections. Feel free to mess with these settings.";
+ text[1] = "====================================================================================";
+ text[2] = "Key binding";
+ text[3] = this.KeyBinding;
+ text[4] = "Collectables Multiplier Cost: Sell Value * value listed below";
+ text[5] = this.CostMultiplier.ToString();
+ File.WriteAllLines(path, text);
+ }
+ }
+}
diff --git a/GeneralMods/BuyBackCollectables/BuyBackCollectables.csproj b/GeneralMods/BuyBackCollectables/BuyBackCollectables.csproj
index cc67c9d4..9832f159 100644
--- a/GeneralMods/BuyBackCollectables/BuyBackCollectables.csproj
+++ b/GeneralMods/BuyBackCollectables/BuyBackCollectables.csproj
@@ -34,17 +34,19 @@
-
-
+
+ Properties\GlobalAssemblyInfo.cs
+
+
-
+
-
+
diff --git a/GeneralMods/BuyBackCollectables/Class1.cs b/GeneralMods/BuyBackCollectables/Class1.cs
deleted file mode 100644
index f63114f0..00000000
--- a/GeneralMods/BuyBackCollectables/Class1.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using StardewModdingAPI;
-using StardewValley;
-using StardewValley.Menus;
-
-namespace Omegasis.BuyBackCollectables
-{
- public class Class1 : Mod
- {
- string key_binding = "B";
- public static double cost = 3.0;
- bool game_loaded = false;
-
-
- public static List debugList;
-
- public override void Entry(IModHelper helper)
- {
- //set up all of my events here
- StardewModdingAPI.Events.SaveEvents.AfterLoad+= PlayerEvents_LoadedGame;
- StardewModdingAPI.Events.ControlEvents.KeyPressed += ControlEvents_KeyPressed;
- StardewModdingAPI.Events.GameEvents.OneSecondTick += GameEvents_OneSecondTick;
- debugList = new List();
- }
-
- private void GameEvents_OneSecondTick(object sender, EventArgs e)
- {
- if (debugList.Count == 0) return;
- foreach(var v in debugList)
- {
- this.Monitor.Log(v);
- }
- debugList.Clear();
- }
-
- public void ControlEvents_KeyPressed(object sender, StardewModdingAPI.Events.EventArgsKeyPressed e)
- {
- if (Game1.player == null) return;
- if (Game1.player.currentLocation == null) return;
- if (game_loaded == false) return;
-
- if (e.KeyPressed.ToString() == key_binding) //if the key is pressed, load my cusom save function
- {
- if (Game1.activeClickableMenu != null) return;
- else
- {
- Game1.activeClickableMenu = new UpdatedCollectionsPage(Game1.viewport.Width / 2 - (800 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2, 800 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2);
- }
- }
- }
-
- public void PlayerEvents_LoadedGame(object sender, EventArgs 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(Helper.DirectoryPath, "BuyBack_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.
- {
- key_binding = "B";
- cost = 3.0;
- }
-
- else
- {
- string[] readtext = File.ReadAllLines(mylocation3);
- key_binding = Convert.ToString(readtext[3]);
- cost = Convert.ToDouble(readtext[5]);
- }
- }
-
- void MyWritter_Settings()
- {
- //write all of my info to a text file.
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath, "BuyBack_Config");
- string mylocation2 = mylocation;
- string mylocation3 = mylocation2 + ".txt";
- string[] mystring3 = new string[20];
- if (!File.Exists(mylocation3))
- {
- Monitor.Log("BuyBack Collections: Config not found. Creating it now.");
-
- mystring3[0] = "Config: Buy Back Collections. Feel free to mess with these settings.";
- mystring3[1] = "====================================================================================";
- mystring3[2] = "Key binding";
- mystring3[3] = key_binding.ToString();
- mystring3[4] = "Collectables Multiplier Cost: Sell Value * value listed below";
- mystring3[5] = cost.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: Buy Back Collections. Feel free to mess with these settings.";
- mystring3[1] = "====================================================================================";
- mystring3[2] = "Key binding";
- mystring3[3] = key_binding.ToString();
- mystring3[4] = "Collectables Multiplier Cost: Sell Value * value listed below";
- mystring3[5] = cost.ToString();
- File.WriteAllLines(mylocation3, mystring3);
- }
- }
-
- public void debugMessage(string s)
- {
- this.Monitor.Log(s);
- }
-
- }
-}
-//end class
\ No newline at end of file
diff --git a/GeneralMods/BuyBackCollectables/Collections_Buy_Back.cs b/GeneralMods/BuyBackCollectables/Collections_Buy_Back.cs
deleted file mode 100644
index 5fbbd2fb..00000000
--- a/GeneralMods/BuyBackCollectables/Collections_Buy_Back.cs
+++ /dev/null
@@ -1,445 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using StardewModdingAPI;
-using StardewValley;
-using StardewValley.Menus;
-using Object = StardewValley.Object;
-
-namespace Omegasis.BuyBackCollectables
-{
- public class Collections_Buy_Back : IClickableMenu
- {
- public const int organicsTab = 0;
-
- public const int fishTab = 1;
-
- public const int archaeologyTab = 2;
-
- public const int mineralsTab = 3;
-
- public const int cookingTab = 4;
-
- public const int achievementsTab = 5;
-
- public const int distanceFromMenuBottomBeforeNewPage = 128;
-
- public static int widthToMoveActiveTab = Game1.tileSize / 8;
-
- public string descriptionText = "";
-
- public string hoverText = "";
-
- public ClickableTextureComponent backButton;
-
- public ClickableTextureComponent forwardButton;
-
- public List sideTabs = new List();
-
- public int currentTab;
-
- public int currentPage;
-
- public Dictionary>> collections = new Dictionary>>();
-
- public int value;
-
- public Item new_item;
-
- public Collections_Buy_Back(int x, int y, int width, int height) : base(x, y, width, height, false)
- {
- this.sideTabs.Add(new ClickableTextureComponent("",new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4 + CollectionsPage.widthToMoveActiveTab, this.yPositionOnScreen + Game1.tileSize * 2, Game1.tileSize, Game1.tileSize), "", "Items Shipped (Farm & Forage)", Game1.mouseCursors, new Rectangle(640, 80, 16, 16), (float)Game1.pixelZoom));
- this.collections.Add(0, new List>());
- this.sideTabs.Add(new ClickableTextureComponent("",new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 3, Game1.tileSize, Game1.tileSize), "", "Fish", Game1.mouseCursors, new Rectangle(640, 64, 16, 16), (float)Game1.pixelZoom));
- this.collections.Add(1, new List>());
- this.sideTabs.Add(new ClickableTextureComponent("",new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 4, Game1.tileSize, Game1.tileSize), "", "Artifacts", Game1.mouseCursors, new Rectangle(656, 64, 16, 16), (float)Game1.pixelZoom));
- this.collections.Add(2, new List>());
- this.sideTabs.Add(new ClickableTextureComponent("",new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 5, Game1.tileSize, Game1.tileSize), "", "Minerals", Game1.mouseCursors, new Rectangle(672, 64, 16, 16), (float)Game1.pixelZoom));
- this.collections.Add(3, new List>());
- this.sideTabs.Add(new ClickableTextureComponent("",new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 6, Game1.tileSize, Game1.tileSize), "", "Cooking", Game1.mouseCursors, new Rectangle(688, 64, 16, 16), (float)Game1.pixelZoom));
- this.collections.Add(4, new List>());
- this.sideTabs.Add(new ClickableTextureComponent("",new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 7, Game1.tileSize, Game1.tileSize), "", "Achievements", Game1.mouseCursors, new Rectangle(656, 80, 16, 16), (float)Game1.pixelZoom));
- this.collections.Add(5, new List>());
- Collections_Buy_Back.widthToMoveActiveTab = Game1.tileSize / 8;
- this.backButton = new ClickableTextureComponent("",new Rectangle(this.xPositionOnScreen + Game1.tileSize * 3 / 4, this.yPositionOnScreen + height - 20 * Game1.pixelZoom, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), "", "", Game1.mouseCursors, new Rectangle(352, 495, 12, 11), (float)Game1.pixelZoom, false);
- this.forwardButton = new ClickableTextureComponent("",new Rectangle(this.xPositionOnScreen + width - Game1.tileSize / 2 - 15 * Game1.pixelZoom, this.yPositionOnScreen + height - 20 * Game1.pixelZoom, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), "", "", Game1.mouseCursors, new Rectangle(365, 495, 12, 11), (float)Game1.pixelZoom, false);
- int[] array = new int[this.sideTabs.Count()];
- int num = this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearSideBorder;
- int num2 = this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4;
- int num3 = 10;
- foreach (KeyValuePair current in Game1.objectInformation)
- {
- string text = current.Value.Split(new char[]
- {
- '/'
- })[3];
- bool flag = false;
- int num4;
- if (text.Contains("Arch"))
- {
- num4 = 2;
- if (Game1.player.archaeologyFound.ContainsKey(current.Key))
- {
- flag = true;
- }
- }
- else if (text.Contains("Fish"))
- {
- if (current.Key >= 167 && current.Key < 173)
- {
- continue;
- }
- num4 = 1;
- if (Game1.player.fishCaught.ContainsKey(current.Key))
- {
- flag = true;
- }
- }
- else if (text.Contains("Mineral") || text.Substring(text.Count() - 3).Equals("-2"))
- {
- num4 = 3;
- if (Game1.player.mineralsFound.ContainsKey(current.Key))
- {
- flag = true;
- }
- }
- else if (text.Contains("Cooking") || text.Substring(text.Count() - 3).Equals("-7"))
- {
- num4 = 4;
- if (Game1.player.recipesCooked.ContainsKey(current.Key))
- {
- flag = true;
- }
- if (current.Key == 217 || current.Key == 772)
- {
- continue;
- }
- if (current.Key == 773)
- {
- continue;
- }
- }
- else
- {
- if (!StardewValley.Object.isPotentialBasicShippedCategory(current.Key, text.Substring(text.Count() - 3)))
- {
- continue;
- }
- num4 = 0;
- if (Game1.player.basicShipped.ContainsKey(current.Key))
- {
- flag = true;
- }
- }
- int x2 = num + array[num4] % num3 * (Game1.tileSize + 4);
- int num5 = num2 + array[num4] / num3 * (Game1.tileSize + 4);
- if (num5 > this.yPositionOnScreen + height - 128)
- {
- this.collections[num4].Add(new List());
- array[num4] = 0;
- x2 = num;
- num5 = num2;
- }
- if (this.collections[num4].Count>() == 0)
- {
- this.collections[num4].Add(new List());
- }
- this.collections[num4].Last>().Add(new ClickableTextureComponent("",new Rectangle(x2, num5, Game1.tileSize, Game1.tileSize), current.Key + " " + flag, "", Game1.objectSpriteSheet, Game1.getSourceRectForStandardTileSheet(Game1.objectSpriteSheet, current.Key, 16, 16), (float)Game1.pixelZoom, false));
- array[num4]++;
- }
- if (this.collections[5].Count>() == 0)
- {
- this.collections[5].Add(new List());
- }
- foreach (KeyValuePair current2 in Game1.achievements)
- {
- bool flag2 = Game1.player.achievements.Contains(current2.Key);
- string[] array2 = current2.Value.Split(new char[]
- {
- '^'
- });
- if (flag2 || (array2[2].Equals("true") && (array2[3].Equals("-1") || this.farmerHasAchievements(array2[3]))))
- {
- int x3 = num + array[5] % num3 * (Game1.tileSize + 4);
- int y2 = num2 + array[5] / num3 * (Game1.tileSize + 4);
- this.collections[5][0].Add(new ClickableTextureComponent("",new Rectangle(x3, y2, Game1.tileSize, Game1.tileSize), current2.Key + " " + flag2, "", Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 25, -1, -1), 1f, false));
- array[5]++;
- }
- }
- }
-
- public virtual bool farmerHasAchievements(string listOfAchievementNumbers)
- {
- string[] array = listOfAchievementNumbers.Split(new char[]
- {
- ' '
- });
- string[] array2 = array;
- for (int i = 0; i < array2.Length; i++)
- {
- string text = array2[i];
- if (!Game1.player.achievements.Contains(Convert.ToInt32(text)))
- {
- return false;
- }
- }
- return true;
- }
-
- public override void receiveLeftClick(int x, int y, bool playSound = true)
- {
- for (int i = 0; i < this.sideTabs.Count; i++)
- {
- if (this.sideTabs[i].containsPoint(x, y) && this.currentTab != i)
- {
- Game1.playSound("smallSelect");
- ClickableTextureComponent expr_45_cp_0 = this.sideTabs[this.currentTab];
- expr_45_cp_0.bounds.X = expr_45_cp_0.bounds.X - CollectionsPage.widthToMoveActiveTab;
- this.currentTab = i;
- this.currentPage = 0;
- ClickableTextureComponent expr_75_cp_0 = this.sideTabs[i];
- expr_75_cp_0.bounds.X = expr_75_cp_0.bounds.X + CollectionsPage.widthToMoveActiveTab;
- }
- }
- if (this.currentPage > 0 && this.backButton.containsPoint(x, y))
- {
- this.currentPage--;
- Game1.playSound("shwip");
- this.backButton.scale = this.backButton.baseScale;
- this.new_item = null;
- }
- if (this.currentPage < this.collections[this.currentTab].Count>() - 1 && this.forwardButton.containsPoint(x, y))
- {
- this.currentPage++;
- Game1.playSound("shwip");
- this.forwardButton.scale = this.forwardButton.baseScale;
- this.new_item = null;
- }
-
-
- foreach (ClickableTextureComponent current2 in this.collections[this.currentTab][this.currentPage])
- {
- if (current2.containsPoint(x, y))
- {
- if (new_item != null)
- {
- if (Game1.player.money > new_item.salePrice() * Class1.cost)
- {
- Game1.player.money -= value;
- Game1.player.addItemByMenuIfNecessary(new_item);
- }
-
- }
- }
- }
-
-
-
- }
-
- public override void receiveRightClick(int x, int y, bool playSound = true)
- {
- if (new_item != null)
- {
- if (Game1.player.money > new_item.salePrice() * Class1.cost)
- {
-
- Game1.player.money -= value;
- Game1.player.addItemByMenuIfNecessary(new_item);
- }
-
- }
- }
-
-
- public override void performHoverAction(int x, int y)
- {
- this.descriptionText = "";
- this.hoverText = "";
- this.value = -1;
-
- try {
- foreach (ClickableTextureComponent current in this.sideTabs)
- {
- if (current.containsPoint(x, y))
- {
- this.hoverText = current.hoverText;
- return;
- }
- }
- }
- catch (Exception e)
- {
- Class1.debugList.Add(e.ToString());
- }
- try {
- foreach (ClickableTextureComponent current2 in this.collections[this.currentTab][this.currentPage])
- {
- if (current2.containsPoint(x, y))
- {
- current2.scale = Math.Min(current2.scale + 0.02f, current2.baseScale + 0.1f);
- if (Convert.ToBoolean(current2.name.Split(new char[]
- {
- ' '
- })[1]) || this.currentTab == 5)
- {
- this.hoverText = this.createDescription(Convert.ToInt32(current2.name.Split(new char[]
- {
- ' '
- })[0]));
- }
- else
- {
- this.hoverText = "???";
- this.new_item = null;
- }
- }
- else
- {
- current2.scale = Math.Max(current2.scale - 0.02f, current2.baseScale);
- }
- }
- }
- catch(Exception e)
- {
- Log.AsyncM(this.currentTab);
- Log.AsyncM(this.currentPage);
- Log.AsyncM(e);
- }
- this.forwardButton.tryHover(x, y, 0.5f);
- this.backButton.tryHover(x, y, 0.5f);
- }
-
- public virtual string createDescription(int index)
- {
- string text = "";
- if (this.currentTab == 5)
- {
- string[] array = Game1.achievements[index].Split(new char[]
- {
- '^'
- });
- text = text + array[0] + Environment.NewLine + Environment.NewLine;
- text += array[1];
- new_item = null;
- }
- else
- {
- string[] array2 = Game1.objectInformation[index].Split(new char[]
- {
- '/'
- });
-
- string text2 = text;
- foreach(KeyValuePair meh in Game1.objectInformation)
- {
- string[] array3 = meh.Value.Split(new char[]
- {
- '/'
- });
- if (array3[0] == array2[0])
- {
- new_item = (Item)new Object(Convert.ToInt32(meh.Key), 1, false, -1, 0);
- if (new_item.Name == "Stone" || new_item.Name=="stone") new_item = (Item)new Object(390, 1, false, -1, 0);
- }
- }
- text = string.Concat(new string[]
- {
- text2,
- array2[0],
- Environment.NewLine,
- Environment.NewLine,
- Game1.parseText(array2[4], Game1.smallFont, Game1.tileSize * 4),
- Environment.NewLine,
- Environment.NewLine
- });
- if (array2[3].Contains("Arch"))
- {
- text += (Game1.player.archaeologyFound.ContainsKey(index) ? ("Total Found: " + Game1.player.archaeologyFound[index][0]) : "");
- }
- else if (array2[3].Contains("Cooking"))
- {
- text += (Game1.player.recipesCooked.ContainsKey(index) ? ("Times Cooked: " + Game1.player.recipesCooked[index]) : "");
- }
- else if (array2[3].Contains("Fish"))
- {
- text = text + "Number Caught: " + (Game1.player.fishCaught.ContainsKey(index) ? Game1.player.fishCaught[index][0] : 0);
- if (Game1.player.fishCaught.ContainsKey(index) && Game1.player.fishCaught[index][1] > 0)
- {
- object obj = text;
- text = string.Concat(new object[]
- {
- obj,
- Environment.NewLine,
- "Biggest Catch: ",
- Game1.player.fishCaught[index][1],
- " in."
- });
- }
- }
- else if (array2[3].Contains("Minerals") || array2[3].Substring(array2[3].Count() - 3).Equals("-2"))
- {
- text = text + "Number Found: " + (Game1.player.mineralsFound.ContainsKey(index) ? Game1.player.mineralsFound[index] : 0);
- }
- else
- {
- text = text + "Number Shipped: " + (Game1.player.basicShipped.ContainsKey(index) ? Game1.player.basicShipped[index] : 0);
- }
- this.value = Convert.ToInt32(array2[1]);
- this.value =(int)(this.value * Class1.cost);
- }
- return text;
- }
-
- public override void draw(SpriteBatch b)
- {
-
- foreach (ClickableTextureComponent current in this.sideTabs)
- {
- current.draw(b);
- }
- if (this.currentPage > 0)
- {
- this.backButton.draw(b);
- }
- if (this.currentPage < this.collections[this.currentTab].Count>() - 1)
- {
- this.forwardButton.draw(b);
- }
- b.End();
- b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null);
- try
- {
- foreach (ClickableTextureComponent current2 in this.collections[1][0])
- {
- bool flag = Convert.ToBoolean(current2.name.Split(new char[]
- {
- ' '
- })[1]);
- current2.draw(b, flag ? Color.White : (Color.Black * 0.2f), 0.86f);
- if (this.currentTab == 5 && flag)
- {
- int num = new Random(Convert.ToInt32(current2.name.Split(new char[]
- {
- ' '
- })[0])).Next(12);
- b.Draw(Game1.mouseCursors, new Vector2((float)(current2.bounds.X + 16 + Game1.tileSize / 4), (float)(current2.bounds.Y + 20 + Game1.tileSize / 4)), new Rectangle?(new Rectangle(256 + num % 6 * Game1.tileSize / 2, 128 + num / 6 * Game1.tileSize / 2, Game1.tileSize / 2, Game1.tileSize / 2)), Color.White, 0f, new Vector2((float)(Game1.tileSize / 4), (float)(Game1.tileSize / 4)), current2.scale, SpriteEffects.None, 0.88f);
- }
- }
- b.End();
- b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
- if (!this.hoverText.Equals(""))
- {
- IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, 0, 0, this.value, null, -1, null, null, 0, -1, -1, -1, -1, 1f, null);
- }
- b.Draw(Game1.mouseCursors, new Vector2((float)Game1.getOldMouseX(), (float)Game1.getOldMouseY()), new Rectangle?(Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, Game1.options.gamepadControls ? 44 : 0, 16, 16)), Color.White, 0f, Vector2.Zero, (float)Game1.pixelZoom + Game1.dialogueButtonScale / 150f, SpriteEffects.None, 1f);
- }
- catch(Exception e)
- {
- Log.AsyncY(e);
- }
- }
- }
-}
diff --git a/GeneralMods/BuyBackCollectables/Framework/BuyBackMenu.cs b/GeneralMods/BuyBackCollectables/Framework/BuyBackMenu.cs
new file mode 100644
index 00000000..717ddc84
--- /dev/null
+++ b/GeneralMods/BuyBackCollectables/Framework/BuyBackMenu.cs
@@ -0,0 +1,369 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using StardewValley;
+using StardewValley.Menus;
+using Object = StardewValley.Object;
+
+namespace Omegasis.BuyBackCollectables.Framework
+{
+ /// The clickable menu which lets the player buy back collectables.
+ internal class BuyBackMenu : IClickableMenu
+ {
+ /*********
+ ** Properties
+ *********/
+ /// The organics tab ID.
+ private const int OrganicsTab = 0;
+
+ /// The fish tab ID.
+ private const int FishTab = 1;
+
+ /// The archaeology tab ID.
+ private const int ArchaeologyTab = 2;
+
+ /// The minerals tab ID.
+ private const int MineralsTab = 3;
+
+ /// The cooking tab ID.
+ private const int CookingTab = 4;
+
+ /// The achievements tab ID.
+ private const int AchievementsTab = 5;
+
+ /// The offset to apply to the selected tab.
+ private readonly int WidthToMoveActiveTab = Game1.tileSize / 8;
+
+ /// The multiplier applied to the cost of buying back a collectable.
+ private readonly double CostMultiplier;
+
+ /// The back button.
+ private readonly ClickableTextureComponent BackButton;
+
+ /// The forward button.
+ private readonly ClickableTextureComponent ForwardButton;
+
+ /// The category tabs shown along the side.
+ private readonly List SideTabs = new List();
+
+ /// The text to display in a hover tooltip.
+ private string HoverText = "";
+
+ /// The selected tab.
+ private int CurrentTab;
+
+ /// The selected page.
+ private int CurrentPage;
+
+ /// The buttons to show for each tab.
+ private readonly Dictionary>> Collections = new Dictionary>>();
+
+ /// The cost to buy back the selected item.
+ private int Value;
+
+ /// The selected item.
+ public Item NewItem;
+
+ /// The cost to buy back the selected item.
+ public int NewItemValue;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// Construct an instance.
+ /// The multiplier applied to the cost of buying back a collectable.
+ public BuyBackMenu(double costMultiplier)
+ : base(Game1.viewport.Width / 2 - (800 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2, 800 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2)
+ {
+ // initialise
+ this.CostMultiplier = costMultiplier;
+
+ // create components
+ this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4 + this.WidthToMoveActiveTab, this.yPositionOnScreen + Game1.tileSize * 2, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Shipped"), Game1.mouseCursors, new Rectangle(640, 80, 16, 16), Game1.pixelZoom));
+ this.Collections.Add(BuyBackMenu.OrganicsTab, new List>());
+ this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 3, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Fish"), Game1.mouseCursors, new Rectangle(640, 64, 16, 16), Game1.pixelZoom));
+ this.Collections.Add(BuyBackMenu.FishTab, new List>());
+ this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 4, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Artifacts"), Game1.mouseCursors, new Rectangle(656, 64, 16, 16), Game1.pixelZoom));
+ this.Collections.Add(BuyBackMenu.ArchaeologyTab, new List>());
+ this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 5, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Minerals"), Game1.mouseCursors, new Rectangle(672, 64, 16, 16), Game1.pixelZoom));
+ this.Collections.Add(BuyBackMenu.MineralsTab, new List>());
+ this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 6, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Cooking"), Game1.mouseCursors, new Rectangle(688, 64, 16, 16), Game1.pixelZoom));
+ this.Collections.Add(BuyBackMenu.CookingTab, new List>());
+ this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 7, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Achievements"), Game1.mouseCursors, new Rectangle(656, 80, 16, 16), Game1.pixelZoom));
+ this.Collections.Add(BuyBackMenu.AchievementsTab, new List>());
+ this.BackButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize * 3 / 4, this.yPositionOnScreen + this.height - 20 * Game1.pixelZoom, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(352, 495, 12, 11), Game1.pixelZoom);
+ this.ForwardButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + this.width - Game1.tileSize / 2 - 15 * Game1.pixelZoom, this.yPositionOnScreen + this.height - 20 * Game1.pixelZoom, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(365, 495, 12, 11), Game1.pixelZoom);
+ int[] array = new int[this.SideTabs.Count];
+ int num = this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearSideBorder;
+ int num2 = this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4;
+ int num3 = 10;
+ foreach (KeyValuePair entry in Game1.objectInformation)
+ {
+ string fields = entry.Value.Split('/')[3];
+ bool drawShadow = false;
+ int selectedTab;
+ if (fields.Contains("Arch"))
+ {
+ selectedTab = BuyBackMenu.ArchaeologyTab;
+ if (Game1.player.archaeologyFound.ContainsKey(entry.Key))
+ drawShadow = true;
+ }
+ else if (fields.Contains("Fish"))
+ {
+ if (entry.Key >= 167 && entry.Key < 173)
+ continue;
+ selectedTab = BuyBackMenu.FishTab;
+ if (Game1.player.fishCaught.ContainsKey(entry.Key))
+ drawShadow = true;
+ }
+ else if (fields.Contains("Mineral") || fields.Substring(fields.Length - 3).Equals("-2"))
+ {
+ selectedTab = BuyBackMenu.MineralsTab;
+ if (Game1.player.mineralsFound.ContainsKey(entry.Key))
+ drawShadow = true;
+ }
+ else if (fields.Contains("Cooking") || fields.Substring(fields.Length - 3).Equals("-7"))
+ {
+ selectedTab = BuyBackMenu.CookingTab;
+ if (Game1.player.recipesCooked.ContainsKey(entry.Key))
+ drawShadow = true;
+ if (entry.Key == 217 || entry.Key == 772 || entry.Key == 773)
+ continue;
+ }
+ else
+ {
+ if (!Object.isPotentialBasicShippedCategory(entry.Key, fields.Substring(fields.Length - 3)))
+ continue;
+ selectedTab = BuyBackMenu.OrganicsTab;
+ if (Game1.player.basicShipped.ContainsKey(entry.Key))
+ drawShadow = true;
+ }
+ int x2 = num + array[selectedTab] % num3 * (Game1.tileSize + 4);
+ int num5 = num2 + array[selectedTab] / num3 * (Game1.tileSize + 4);
+ if (num5 > this.yPositionOnScreen + this.height - 128)
+ {
+ this.Collections[selectedTab].Add(new List());
+ array[selectedTab] = 0;
+ x2 = num;
+ num5 = num2;
+ }
+ if (this.Collections[selectedTab].Count == 0)
+ this.Collections[selectedTab].Add(new List());
+ this.Collections[selectedTab].Last().Add(new ClickableTextureComponent(entry.Key + " " + drawShadow, new Rectangle(x2, num5, Game1.tileSize, Game1.tileSize), null, "", Game1.objectSpriteSheet, Game1.getSourceRectForStandardTileSheet(Game1.objectSpriteSheet, entry.Key, 16, 16), Game1.pixelZoom, drawShadow));
+ array[selectedTab]++;
+ }
+ if (this.Collections[5].Count == 0)
+ this.Collections[5].Add(new List());
+ foreach (KeyValuePair current2 in Game1.achievements)
+ {
+ bool flag = Game1.player.achievements.Contains(current2.Key);
+ string[] array2 = current2.Value.Split('^');
+ if (flag || (array2[2].Equals("true") && (array2[3].Equals("-1") || this.FarmerHasAchievements(array2[3]))))
+ {
+ int x3 = num + array[5] % num3 * (Game1.tileSize + 4);
+ int y2 = num2 + array[5] / num3 * (Game1.tileSize + 4);
+ this.Collections[5][0].Add(new ClickableTextureComponent(current2.Key + " " + flag, new Rectangle(x3, y2, Game1.tileSize, Game1.tileSize), null, "", Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 25), 1f));
+ array[5]++;
+ }
+ }
+ }
+
+
+ /*********
+ ** Private methods
+ *********/
+ /// Get whether the farmer has the given achievements.
+ /// The achievement IDs as a space-separated list.
+ private bool FarmerHasAchievements(string listOfAchievementNumbers)
+ {
+ string[] array = listOfAchievementNumbers.Split(' ');
+ foreach (string text in array)
+ {
+ if (!Game1.player.achievements.Contains(Convert.ToInt32(text)))
+ return false;
+ }
+ return true;
+ }
+
+ /// The method invoked when the player left-clicks on the menu.
+ /// The X-position of the cursor.
+ /// The Y-position of the cursor.
+ /// Whether to enable sound.
+ public override void receiveLeftClick(int x, int y, bool playSound = true)
+ {
+ for (int i = 0; i < this.SideTabs.Count; i++)
+ {
+ if (this.SideTabs[i].containsPoint(x, y) && this.CurrentTab != i)
+ {
+ Game1.playSound("smallSelect");
+ ClickableTextureComponent curTab = this.SideTabs[this.CurrentTab];
+ curTab.bounds.X = curTab.bounds.X - this.WidthToMoveActiveTab;
+ this.CurrentTab = i;
+ this.CurrentPage = 0;
+ ClickableTextureComponent newTab = this.SideTabs[i];
+ newTab.bounds.X = newTab.bounds.X + this.WidthToMoveActiveTab;
+ }
+ }
+ if (this.CurrentPage > 0 && this.BackButton.containsPoint(x, y))
+ {
+ this.CurrentPage--;
+ Game1.playSound("shwip");
+ this.BackButton.scale = this.BackButton.baseScale;
+ }
+ if (this.CurrentPage < this.Collections[this.CurrentTab].Count - 1 && this.ForwardButton.containsPoint(x, y))
+ {
+ this.CurrentPage++;
+ Game1.playSound("shwip");
+ this.ForwardButton.scale = this.ForwardButton.baseScale;
+ }
+ foreach (ClickableTextureComponent current2 in this.Collections[this.CurrentTab][this.CurrentPage])
+ {
+ if (current2.containsPoint(x, y) && this.NewItem != null && Game1.player.money >= this.Value)
+ {
+ Game1.player.money -= this.Value;
+ Game1.player.addItemByMenuIfNecessary(this.NewItem);
+ }
+ }
+ }
+
+ /// The method invoked when the player right-clicks on the lookup UI.
+ /// The X-position of the cursor.
+ /// The Y-position of the cursor.
+ /// Whether to enable sound.
+ public override void receiveRightClick(int x, int y, bool playSound = true)
+ {
+ if (this.NewItem != null && Game1.player.money >= this.Value)
+ {
+ Game1.player.money -= this.Value;
+ Game1.player.addItemByMenuIfNecessary(this.NewItem);
+ }
+ }
+
+ /// The method invoked when the player hovers the cursor over the menu.
+ /// The X-position of the cursor.
+ /// The Y-position of the cursor.
+ public override void performHoverAction(int x, int y)
+ {
+ this.HoverText = "";
+ this.Value = -1;
+ foreach (ClickableTextureComponent current in this.SideTabs)
+ {
+ if (current.containsPoint(x, y))
+ {
+ this.HoverText = current.hoverText;
+ return;
+ }
+ }
+ foreach (ClickableTextureComponent current2 in this.Collections[this.CurrentTab][this.CurrentPage])
+ {
+ if (current2.containsPoint(x, y))
+ {
+ current2.scale = Math.Min(current2.scale + 0.02f, current2.baseScale + 0.1f);
+ if (Convert.ToBoolean(current2.name.Split(' ')[1]) || this.CurrentTab == 5)
+ this.HoverText = this.CreateDescription(Convert.ToInt32(current2.name.Split(' ')[0]));
+ else
+ this.HoverText = "???";
+ }
+ else
+ {
+ current2.scale = Math.Max(current2.scale - 0.02f, current2.baseScale);
+ }
+ }
+ this.ForwardButton.tryHover(x, y, 0.5f);
+ this.BackButton.tryHover(x, y, 0.5f);
+ }
+
+ /// Generate the item description for an item ID.
+ /// The item ID.
+ private string CreateDescription(int index)
+ {
+ string text = "";
+ if (this.CurrentTab == 5)
+ {
+ string[] array = Game1.achievements[index].Split('^');
+ text = text + array[0] + Environment.NewLine + Environment.NewLine;
+ text += array[1];
+ this.NewItem = null;
+ }
+ else
+ {
+ string[] array2 = Game1.objectInformation[index].Split('/');
+ foreach (KeyValuePair meh in Game1.objectInformation)
+ {
+ string[] array3 = meh.Value.Split('/');
+ if (array3[0] == array2[0])
+ {
+ this.NewItem = new Object(Convert.ToInt32(meh.Key), 1);
+ if (this.NewItem.Name == "Stone" || this.NewItem.Name == "stone") this.NewItem = new Object(390, 1);
+ }
+ }
+ text = string.Concat(text, array2[0], Environment.NewLine, Environment.NewLine, Game1.parseText(array2[4], Game1.smallFont, Game1.tileSize * 4), Environment.NewLine, Environment.NewLine);
+ if (array2[3].Contains("Arch"))
+ {
+ text += (Game1.player.archaeologyFound.ContainsKey(index) ? Game1.content.LoadString("Strings\\UI:Collections_Description_ArtifactsFound", Game1.player.archaeologyFound[index][0]) : "");
+ }
+ else if (array2[3].Contains("Cooking"))
+ {
+ text += (Game1.player.recipesCooked.ContainsKey(index) ? Game1.content.LoadString("Strings\\UI:Collections_Description_RecipesCooked", Game1.player.recipesCooked[index]) : "");
+ }
+ else if (array2[3].Contains("Fish"))
+ {
+ text += Game1.content.LoadString("Strings\\UI:Collections_Description_FishCaught", Game1.player.fishCaught.ContainsKey(index) ? Game1.player.fishCaught[index][0] : 0);
+ if (Game1.player.fishCaught.ContainsKey(index) && Game1.player.fishCaught[index][1] > 0)
+ {
+ text = text + Environment.NewLine + Game1.content.LoadString("Strings\\UI:Collections_Description_BiggestCatch", Game1.player.fishCaught[index][1]);
+ }
+ }
+ else if (array2[3].Contains("Minerals") || array2[3].Substring(array2[3].Length - 3).Equals("-2"))
+ {
+ text += Game1.content.LoadString("Strings\\UI:Collections_Description_MineralsFound", Game1.player.mineralsFound.ContainsKey(index) ? Game1.player.mineralsFound[index] : 0);
+ }
+ else
+ {
+ text += Game1.content.LoadString("Strings\\UI:Collections_Description_NumberShipped", Game1.player.basicShipped.ContainsKey(index) ? Game1.player.basicShipped[index] : 0);
+ }
+ this.Value = Convert.ToInt32(array2[1]);
+ this.Value = (int)(this.Value * this.CostMultiplier);
+ this.NewItemValue = this.Value;
+ }
+ return text;
+ }
+
+ /// Draw the menu to the screen.
+ /// The sprite batch.
+ public override void draw(SpriteBatch b)
+ {
+ Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true);
+
+ foreach (var tab in this.SideTabs)
+ tab.draw(b);
+
+ if (this.CurrentPage > 0)
+ this.BackButton.draw(b);
+ if (this.CurrentPage < this.Collections[this.CurrentTab].Count - 1)
+ this.ForwardButton.draw(b);
+ b.End();
+ b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null);
+ foreach (ClickableTextureComponent current in this.Collections[this.CurrentTab][this.CurrentPage])
+ {
+ bool flag = Convert.ToBoolean(current.name.Split(' ')[1]);
+ current.draw(b, flag ? Color.White : (Color.Black * 0.2f), 0.86f);
+ if (this.CurrentTab == 5 & flag)
+ {
+ int num = new Random(Convert.ToInt32(current.name.Split(' ')[0])).Next(12);
+ b.Draw(Game1.mouseCursors, new Vector2(current.bounds.X + 16 + Game1.tileSize / 4, current.bounds.Y + 20 + Game1.tileSize / 4), new Rectangle(256 + num % 6 * Game1.tileSize / 2, 128 + num / 6 * Game1.tileSize / 2, Game1.tileSize / 2, Game1.tileSize / 2), Color.White, 0f, new Vector2(Game1.tileSize / 4, Game1.tileSize / 4), current.scale, SpriteEffects.None, 0.88f);
+ }
+ }
+ b.End();
+ b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
+ if (!this.HoverText.Equals(""))
+ IClickableMenu.drawHoverText(b, this.HoverText, Game1.smallFont, 0, 0, this.Value);
+ if (!Game1.options.hardwareCursor)
+ b.Draw(Game1.mouseCursors, new Vector2(Game1.getMouseX(), Game1.getMouseY()), Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 0, 16, 16), Color.White * Game1.mouseCursorTransparency, 0f, Vector2.Zero, Game1.pixelZoom + Game1.dialogueButtonScale / 150f, SpriteEffects.None, 1f);
+
+ }
+ }
+}
diff --git a/GeneralMods/BuyBackCollectables/Properties/AssemblyInfo.cs b/GeneralMods/BuyBackCollectables/Properties/AssemblyInfo.cs
index b2c46286..c3119773 100644
--- a/GeneralMods/BuyBackCollectables/Properties/AssemblyInfo.cs
+++ b/GeneralMods/BuyBackCollectables/Properties/AssemblyInfo.cs
@@ -1,36 +1,7 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("BuyBackCollectables")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("BuyBackCollectables")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a19025c4-e194-4cad-b156-4ac00bdd2aa3")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/GeneralMods/BuyBackCollectables/README.md b/GeneralMods/BuyBackCollectables/README.md
new file mode 100644
index 00000000..d01e5f55
--- /dev/null
+++ b/GeneralMods/BuyBackCollectables/README.md
@@ -0,0 +1,28 @@
+**Buy Back Collectables** is a [Stardew Valley](http://stardewvalley.net/) mod which lets you buy
+items from the collectables menu by pressing a key, at a configurable markup.
+
+Compatible with Stardew Valley 1.2+ on Linux, Mac, and Windows.
+
+## Installation
+1. [Install the latest version of SMAPI](https://github.com/Pathoschild/SMAPI/releases).
+2. Install [this mod from Nexus mods](http://www.nexusmods.com/stardewvalley/mods/507).
+3. Run the game using SMAPI.
+
+## Usage
+Press `B` to open the buy-collectibles menu. Edit `BuildHealthConfig.json` to change the key or the
+price markup.
+
+## Versions
+1.0:
+* Initial release.
+
+1.0.1:
+* Corrected price display to reflect markup.
+
+1.0.2:
+* Fixed issues where unintended items were bought.
+
+1.1:
+* Updated to Stardew Valley 1.1 and SMAPI 0.40 1.1-3.
+* Fixed mouse not appearing in menu.
+* Fixed bug where you sometimes couldn't buy an item even if you had enough money.
\ No newline at end of file
diff --git a/GeneralMods/BuyBackCollectables/ReadMe.txt b/GeneralMods/BuyBackCollectables/ReadMe.txt
deleted file mode 100644
index 12c14207..00000000
--- a/GeneralMods/BuyBackCollectables/ReadMe.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-BuyBackCollectables
-
-Version:1.1.0
-
-Published: 8/2/16 12:39 AM
-
-Updated: 10/32/16 10:38 PM
-
-Compatability:
-
-Stardew Valley 1.1.0 Windows
-
-SMAPI 0.40.0 1.1-3
-
-Description:
-
-A simple mod that allows you to buy back any collectable that you have already shiped at 3 times the shipping price. (Configurable in the config file)
-
-Usage: Press B to open up the buy back menu.
-
-Update Info:
-1.1.0
--Updated to SDV 1.1
--Fixed glitch where mouse would not show up on menu draw.
--Fixed glitch where I used a bad math algorithm and you wouldn't be able to buy an item if you had enough money.
-
-1.0.2
-
--Fixed some bugs where you would accidentally purchase some items when not intending to.
-
-1.0.1
-
--Changed price display in buy back menu to propperly reflect buy back price.
diff --git a/GeneralMods/BuyBackCollectables/UpdatedCollections.cs b/GeneralMods/BuyBackCollectables/UpdatedCollections.cs
deleted file mode 100644
index 724470ae..00000000
--- a/GeneralMods/BuyBackCollectables/UpdatedCollections.cs
+++ /dev/null
@@ -1,429 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using StardewValley;
-using StardewValley.Menus;
-using Object = StardewValley.Object;
-
-namespace Omegasis.BuyBackCollectables
-{
- public class UpdatedCollectionsPage : IClickableMenu
- {
- public static int widthToMoveActiveTab = Game1.tileSize / 8;
-
- public const int organicsTab = 0;
-
- public const int fishTab = 1;
-
- public const int archaeologyTab = 2;
-
- public const int mineralsTab = 3;
-
- public const int cookingTab = 4;
-
- public const int achievementsTab = 5;
-
- public const int distanceFromMenuBottomBeforeNewPage = 128;
-
- private string descriptionText = "";
-
- private string hoverText = "";
-
- private ClickableTextureComponent backButton;
-
- private ClickableTextureComponent forwardButton;
-
- private List sideTabs = new List();
-
- private int currentTab;
-
- private int currentPage;
-
- private Dictionary>> collections = new Dictionary>>();
-
- private int value;
-
- public Item new_item;
- public int newItemValue;
-
- public UpdatedCollectionsPage(int x, int y, int width, int height) : base(x, y, width, height, false)
- {
- this.sideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4 + UpdatedCollectionsPage.widthToMoveActiveTab, this.yPositionOnScreen + Game1.tileSize * 2, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Shipped", new object[0]), Game1.mouseCursors, new Rectangle(640, 80, 16, 16), (float)Game1.pixelZoom, false));
- this.collections.Add(0, new List>());
- this.sideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 3, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Fish", new object[0]), Game1.mouseCursors, new Rectangle(640, 64, 16, 16), (float)Game1.pixelZoom, false));
- this.collections.Add(1, new List>());
- this.sideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 4, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Artifacts", new object[0]), Game1.mouseCursors, new Rectangle(656, 64, 16, 16), (float)Game1.pixelZoom, false));
- this.collections.Add(2, new List>());
- this.sideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 5, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Minerals", new object[0]), Game1.mouseCursors, new Rectangle(672, 64, 16, 16), (float)Game1.pixelZoom, false));
- this.collections.Add(3, new List>());
- this.sideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 6, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Cooking", new object[0]), Game1.mouseCursors, new Rectangle(688, 64, 16, 16), (float)Game1.pixelZoom, false));
- this.collections.Add(4, new List>());
- this.sideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 7, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Achievements", new object[0]), Game1.mouseCursors, new Rectangle(656, 80, 16, 16), (float)Game1.pixelZoom, false));
- this.collections.Add(5, new List>());
- UpdatedCollectionsPage.widthToMoveActiveTab = Game1.tileSize / 8;
- this.backButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize * 3 / 4, this.yPositionOnScreen + height - 20 * Game1.pixelZoom, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(352, 495, 12, 11), (float)Game1.pixelZoom, false);
- this.forwardButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + width - Game1.tileSize / 2 - 15 * Game1.pixelZoom, this.yPositionOnScreen + height - 20 * Game1.pixelZoom, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(365, 495, 12, 11), (float)Game1.pixelZoom, false);
- int[] array = new int[this.sideTabs.Count];
- int num = this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearSideBorder;
- int num2 = this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4;
- int num3 = 10;
- foreach (KeyValuePair current in Game1.objectInformation)
- {
- string text = current.Value.Split(new char[]
- {
- '/'
- })[3];
- bool drawShadow = false;
- int num4;
- if (text.Contains("Arch"))
- {
- num4 = 2;
- if (Game1.player.archaeologyFound.ContainsKey(current.Key))
- {
- drawShadow = true;
- }
- }
- else if (text.Contains("Fish"))
- {
- if (current.Key >= 167 && current.Key < 173)
- {
- continue;
- }
- num4 = 1;
- if (Game1.player.fishCaught.ContainsKey(current.Key))
- {
- drawShadow = true;
- }
- }
- else if (text.Contains("Mineral") || text.Substring(text.Length - 3).Equals("-2"))
- {
- num4 = 3;
- if (Game1.player.mineralsFound.ContainsKey(current.Key))
- {
- drawShadow = true;
- }
- }
- else if (text.Contains("Cooking") || text.Substring(text.Length - 3).Equals("-7"))
- {
- num4 = 4;
- if (Game1.player.recipesCooked.ContainsKey(current.Key))
- {
- drawShadow = true;
- }
- if (current.Key == 217 || current.Key == 772)
- {
- continue;
- }
- if (current.Key == 773)
- {
- continue;
- }
- }
- else
- {
- if (!StardewValley.Object.isPotentialBasicShippedCategory(current.Key, text.Substring(text.Length - 3)))
- {
- continue;
- }
- num4 = 0;
- if (Game1.player.basicShipped.ContainsKey(current.Key))
- {
- drawShadow = true;
- }
- }
- int x2 = num + array[num4] % num3 * (Game1.tileSize + 4);
- int num5 = num2 + array[num4] / num3 * (Game1.tileSize + 4);
- if (num5 > this.yPositionOnScreen + height - 128)
- {
- this.collections[num4].Add(new List());
- array[num4] = 0;
- x2 = num;
- num5 = num2;
- }
- if (this.collections[num4].Count == 0)
- {
- this.collections[num4].Add(new List());
- }
- this.collections[num4].Last>().Add(new ClickableTextureComponent(current.Key + " " + drawShadow.ToString(), new Rectangle(x2, num5, Game1.tileSize, Game1.tileSize), null, "", Game1.objectSpriteSheet, Game1.getSourceRectForStandardTileSheet(Game1.objectSpriteSheet, current.Key, 16, 16), (float)Game1.pixelZoom, drawShadow));
- array[num4]++;
- }
- if (this.collections[5].Count == 0)
- {
- this.collections[5].Add(new List());
- }
- foreach (KeyValuePair current2 in Game1.achievements)
- {
- bool flag = Game1.player.achievements.Contains(current2.Key);
- string[] array2 = current2.Value.Split(new char[]
- {
- '^'
- });
- if (flag || (array2[2].Equals("true") && (array2[3].Equals("-1") || this.farmerHasAchievements(array2[3]))))
- {
- int x3 = num + array[5] % num3 * (Game1.tileSize + 4);
- int y2 = num2 + array[5] / num3 * (Game1.tileSize + 4);
- this.collections[5][0].Add(new ClickableTextureComponent(current2.Key + " " + flag.ToString(), new Rectangle(x3, y2, Game1.tileSize, Game1.tileSize), null, "", Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 25, -1, -1), 1f, false));
- array[5]++;
- }
- }
- }
-
- private bool farmerHasAchievements(string listOfAchievementNumbers)
- {
- string[] array = listOfAchievementNumbers.Split(new char[]
- {
- ' '
- });
- for (int i = 0; i < array.Length; i++)
- {
- string text = array[i];
- if (!Game1.player.achievements.Contains(Convert.ToInt32(text)))
- {
- return false;
- }
- }
- return true;
- }
-
- public override void receiveLeftClick(int x, int y, bool playSound = true)
- {
- for (int i = 0; i < this.sideTabs.Count; i++)
- {
- if (this.sideTabs[i].containsPoint(x, y) && this.currentTab != i)
- {
- Game1.playSound("smallSelect");
- ClickableTextureComponent expr_47_cp_0_cp_0 = this.sideTabs[this.currentTab];
- expr_47_cp_0_cp_0.bounds.X = expr_47_cp_0_cp_0.bounds.X - UpdatedCollectionsPage.widthToMoveActiveTab;
- this.currentTab = i;
- this.currentPage = 0;
- ClickableTextureComponent expr_74_cp_0_cp_0 = this.sideTabs[i];
- expr_74_cp_0_cp_0.bounds.X = expr_74_cp_0_cp_0.bounds.X + UpdatedCollectionsPage.widthToMoveActiveTab;
- }
- }
- if (this.currentPage > 0 && this.backButton.containsPoint(x, y))
- {
- this.currentPage--;
- Game1.playSound("shwip");
- this.backButton.scale = this.backButton.baseScale;
- }
- if (this.currentPage < this.collections[this.currentTab].Count - 1 && this.forwardButton.containsPoint(x, y))
- {
- this.currentPage++;
- Game1.playSound("shwip");
- this.forwardButton.scale = this.forwardButton.baseScale;
- }
- foreach (ClickableTextureComponent current2 in this.collections[this.currentTab][this.currentPage])
- {
- if (current2.containsPoint(x, y))
- {
- if (new_item != null)
- {
- if (Game1.player.money >= value)
- {
- Game1.player.money -= value;
- Game1.player.addItemByMenuIfNecessary(new_item);
- }
-
- }
- }
- }
- }
-
- public override void receiveRightClick(int x, int y, bool playSound = true)
- {
- if (new_item != null)
- {
- if (Game1.player.money >= value)
- {
-
- Game1.player.money -= value;
- Game1.player.addItemByMenuIfNecessary(new_item);
- }
-
- }
- }
-
- public override void performHoverAction(int x, int y)
- {
- this.descriptionText = "";
- this.hoverText = "";
- this.value = -1;
- foreach (ClickableTextureComponent current in this.sideTabs)
- {
- if (current.containsPoint(x, y))
- {
- this.hoverText = current.hoverText;
- return;
- }
- }
- foreach (ClickableTextureComponent current2 in this.collections[this.currentTab][this.currentPage])
- {
- if (current2.containsPoint(x, y))
- {
- current2.scale = Math.Min(current2.scale + 0.02f, current2.baseScale + 0.1f);
- if (Convert.ToBoolean(current2.name.Split(new char[]
- {
- ' '
- })[1]) || this.currentTab == 5)
- {
- this.hoverText = this.createDescription(Convert.ToInt32(current2.name.Split(new char[]
- {
- ' '
- })[0]));
- }
- else
- {
- this.hoverText = "???";
- }
- }
- else
- {
- current2.scale = Math.Max(current2.scale - 0.02f, current2.baseScale);
- }
- }
- this.forwardButton.tryHover(x, y, 0.5f);
- this.backButton.tryHover(x, y, 0.5f);
- }
-
- public string createDescription(int index)
- {
- string text = "";
- if (this.currentTab == 5)
- {
- string[] array = Game1.achievements[index].Split(new char[]
- {
- '^'
- });
- text = text + array[0] + Environment.NewLine + Environment.NewLine;
- text += array[1];
- new_item = null;
- }
- else
- {
- string[] array2 = Game1.objectInformation[index].Split(new char[]
- {
- '/'
- });
- foreach (KeyValuePair meh in Game1.objectInformation)
- {
- string[] array3 = meh.Value.Split(new char[]
- {
- '/'
- });
- if (array3[0] == array2[0])
- {
- new_item = (Item)new Object(Convert.ToInt32(meh.Key), 1, false, -1, 0);
- if (new_item.Name == "Stone" || new_item.Name == "stone") new_item = (Item)new Object(390, 1, false, -1, 0);
- }
- }
- text = string.Concat(new string[]
- {
- text,
- array2[0],
- Environment.NewLine,
- Environment.NewLine,
- Game1.parseText(array2[4], Game1.smallFont, Game1.tileSize * 4),
- Environment.NewLine,
- Environment.NewLine
- });
- if (array2[3].Contains("Arch"))
- {
- text += (Game1.player.archaeologyFound.ContainsKey(index) ? Game1.content.LoadString("Strings\\UI:Collections_Description_ArtifactsFound", new object[]
- {
- Game1.player.archaeologyFound[index][0]
- }) : "");
- }
- else if (array2[3].Contains("Cooking"))
- {
- text += (Game1.player.recipesCooked.ContainsKey(index) ? Game1.content.LoadString("Strings\\UI:Collections_Description_RecipesCooked", new object[]
- {
- Game1.player.recipesCooked[index]
- }) : "");
- }
- else if (array2[3].Contains("Fish"))
- {
- text += Game1.content.LoadString("Strings\\UI:Collections_Description_FishCaught", new object[]
- {
- Game1.player.fishCaught.ContainsKey(index) ? Game1.player.fishCaught[index][0] : 0
- });
- if (Game1.player.fishCaught.ContainsKey(index) && Game1.player.fishCaught[index][1] > 0)
- {
- text = text + Environment.NewLine + Game1.content.LoadString("Strings\\UI:Collections_Description_BiggestCatch", new object[]
- {
- Game1.player.fishCaught[index][1]
- });
- }
- }
- else if (array2[3].Contains("Minerals") || array2[3].Substring(array2[3].Length - 3).Equals("-2"))
- {
- text += Game1.content.LoadString("Strings\\UI:Collections_Description_MineralsFound", new object[]
- {
- Game1.player.mineralsFound.ContainsKey(index) ? Game1.player.mineralsFound[index] : 0
- });
- }
- else
- {
- text += Game1.content.LoadString("Strings\\UI:Collections_Description_NumberShipped", new object[]
- {
- Game1.player.basicShipped.ContainsKey(index) ? Game1.player.basicShipped[index] : 0
- });
- }
- this.value = Convert.ToInt32(array2[1]);
- this.value = (int)(this.value * Class1.cost);
- newItemValue = this.value;
- }
- return text;
- }
-
- public override void draw(SpriteBatch b)
- {
- Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true, null, false);
- using (List.Enumerator enumerator = this.sideTabs.GetEnumerator())
- {
- while (enumerator.MoveNext())
- {
- enumerator.Current.draw(b);
- }
- }
- if (this.currentPage > 0)
- {
- this.backButton.draw(b);
- }
- if (this.currentPage < this.collections[this.currentTab].Count - 1)
- {
- this.forwardButton.draw(b);
- }
- b.End();
- b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null);
- foreach (ClickableTextureComponent current in this.collections[this.currentTab][this.currentPage])
- {
- bool flag = Convert.ToBoolean(current.name.Split(new char[]
- {
- ' '
- })[1]);
- current.draw(b, flag ? Color.White : (Color.Black * 0.2f), 0.86f);
- if (this.currentTab == 5 & flag)
- {
- int num = new Random(Convert.ToInt32(current.name.Split(new char[]
- {
- ' '
- })[0])).Next(12);
- b.Draw(Game1.mouseCursors, new Vector2((float)(current.bounds.X + 16 + Game1.tileSize / 4), (float)(current.bounds.Y + 20 + Game1.tileSize / 4)), new Rectangle?(new Rectangle(256 + num % 6 * Game1.tileSize / 2, 128 + num / 6 * Game1.tileSize / 2, Game1.tileSize / 2, Game1.tileSize / 2)), Color.White, 0f, new Vector2((float)(Game1.tileSize / 4), (float)(Game1.tileSize / 4)), current.scale, SpriteEffects.None, 0.88f);
- }
- }
- b.End();
- b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
- if (!this.hoverText.Equals(""))
- {
- IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, 0, 0, this.value, null, -1, null, null, 0, -1, -1, -1, -1, 1f, null);
- }
- if (!Game1.options.hardwareCursor)
- {
- b.Draw(Game1.mouseCursors, new Vector2((float)Game1.getMouseX(), (float)Game1.getMouseY()), new Rectangle?(Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 0, 16, 16)), Color.White * Game1.mouseCursorTransparency, 0f, Vector2.Zero, (float)Game1.pixelZoom + Game1.dialogueButtonScale / 150f, SpriteEffects.None, 1f);
- }
-
- }
- }
-}
diff --git a/GeneralMods/BuyBackCollectables/manifest.json b/GeneralMods/BuyBackCollectables/manifest.json
index 3fcf78f4..75dc7c6e 100644
--- a/GeneralMods/BuyBackCollectables/manifest.json
+++ b/GeneralMods/BuyBackCollectables/manifest.json
@@ -11,4 +11,4 @@
"UniqueID": "BuyBackCollectables",
"PerSaveConfigs": false,
"EntryDll": "BuyBackCollectables.dll"
-}
\ No newline at end of file
+}
diff --git a/GeneralMods/CustomShopsRedux/Class1.cs b/GeneralMods/CustomShopsRedux/Class1.cs
deleted file mode 100644
index 597e9bed..00000000
--- a/GeneralMods/CustomShopsRedux/Class1.cs
+++ /dev/null
@@ -1,831 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Microsoft.Xna.Framework;
-using StardewModdingAPI;
-using StardewValley;
-using StardewValley.Menus;
-using StardewValley.Objects;
-using StardewValley.Tools;
-
-/*
-TO DO:
-Items
-furniture
-swords -
-hats -
-boots -
-wallpapers -
-carpets -
-ring -
-lamp-
-craftables-
-*/
-namespace Omegasis.CustomShopsRedux
-{
- public class Class1 : Mod
- {
- public static IClickableMenu mymenu;
- static int j = 0;
- static Dictionary- list_price = new Dictionary
- ();
-
- static string master_path;
- List myoptions = new List();
- string key_binding = "U";
-
- 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 (game_loaded == false) return;
-
- if (e.KeyPressed.ToString() == key_binding) //if the key is pressed, load my cusom save function
- {
-
- my_key_call();
-
-
- }
- //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, "Custom_Shop_Redux_Config");
- string mylocation2 = mylocation;
- string mylocation3 = mylocation2 + ".txt";
- master_path = PathOnDisk;
-
- Directory.CreateDirectory(Path.Combine(master_path, "Custom_Shops"));
-
- master_path = Path.Combine(master_path, "Custom_Shops");
-
-
-
- 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 = "U";
- // 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, "Custom_Shop_Redux_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: Custom_Shop_Redux. 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.
- 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: Custom_Shop_Redux. 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);
- }
- }
-
-
-
-
- public void my_key_call()
- {
- var modpath = new Class1();
-
-
- DirectoryInfo d = new DirectoryInfo(master_path);//Assuming Test is your Folder
- Log.Info(d);
- // System.Threading.Thread.Sleep(20000);
-
- FileInfo[] Files = d.GetFiles("*.txt"); //Getting Text files
- string str = "";
-
- if (Files.Length == 0)
- {
- Log.Error("No shop .txt information is found. You should create one.");
- return;
-
- }
- foreach (FileInfo file in Files)
- {
- str = file.Name;
- // Log.Info(str);
-
- myoptions.Add(str);
- }
-
- if (myoptions.Count == 0)
- {
- Log.Error("No shop .txt information is found. You should create one.");
- return;
- }
-
- StardewValley.Menus.ChooseFromListMenu mychoices = new StardewValley.Menus.ChooseFromListMenu(myoptions, new ChooseFromListMenu.actionOnChoosingListOption(shop_file_call), false);
-
- Game1.activeClickableMenu = mychoices;
-
-
-
-
-
-
-
- }
-
-
-
- static void shop_file_call(string s)
- {
- List
- list = new List
- ();
-
-
- string mylocation = Path.Combine(master_path , s);
-
- /// Log.Info(mylocation);
-
-
- string[] readtext = File.ReadAllLines(mylocation);
-
- var lineCount = File.ReadLines(mylocation).Count();
-
-
-// Log.Info(lineCount);
-
- if(s== "Custom_Shop_Redux_Config.txt")
- {
- Log.Info("Silly human. The config file is not a shop.");
- return;
- }
-
- int i = 4;
-
- int obj_id = 0;
- bool is_recipe;
- int price;
- int quality;
-
- string obj_type;
-
- obj_type = Convert.ToString(readtext[i]);
- i += 2;
-
-
-
- while (i < lineCount)
- {
- if (i >= lineCount) break;
- if (obj_type == "") break;
- if (readtext[i] == "") break;
-
- //read in a line for obj type here
- Log.Info(i);
- Log.Info(obj_type);
- if (obj_type == "item" || obj_type == "Item" || obj_type == "Object" || obj_type == "object")
- {
-
- obj_id = Convert.ToInt16(readtext[i]);
- i += 2;
-
- Log.Info(i);
- is_recipe = Convert.ToBoolean(readtext[i]);
- i += 2;
- Log.Info(i);
- price = Convert.ToInt32(readtext[i]);
- i += 2;
- Log.Info(i);
-
- quality = Convert.ToInt32(readtext[i]);
- // if (quality > 2) quality = 0;
-
-
- if (price == -1)
- {
- StardewValley.Object myobj = new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality);
-
- // Log.Info("MYPRICE");
- // Log.Info(myobj.salePrice());
- price = myobj.salePrice();
-
- }
-
-
- // list.Add((Item)new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality));
- list_price.Add((Item)new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality), new int[2] {price, int.MaxValue});
- i += 3;
- if (i >= lineCount) break;
- }
- if (obj_type == "Furniture" || obj_type == "furniture")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
-
- // list.Add((Item)new Furniture(obj_id, Vector2.Zero)); //ADD FUNCTIONALITY TO SHOP FILES TO TEST IF FURNITURE OR NOT.
- list_price.Add((Item)new Furniture(obj_id, Vector2.Zero), new int[2] { price, int.MaxValue });
- i += 3;
- if (i>= lineCount) break;
-
-
-
-
- }
-
- if (obj_type == "Boots" || obj_type == "boots" || obj_type == "shoe" || obj_type == "Shoe") //just incase someone forgets it's called boots and they type shoe.
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price= Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Boots(obj_id),new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
-
- }
-
- if (obj_type == "WallPaper" || obj_type == "Wallpaper" || obj_type == "wallPaper" || obj_type == "wallpaper") //just incase someone forgets it's called boots and they type shoe.
- {
- if (i + 3 > lineCount) break;
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Wallpaper(obj_id, false), new int[2] { price, int.MaxValue }); //add in support for wallpapers and carpets
- i += 3;
- if (i >= lineCount) break;
-
- }
-
- if (obj_type == "Carpet" || obj_type == "carpet" || obj_type == "Floor" || obj_type == "floor" || obj_type == "Rug" || obj_type == "rug")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Wallpaper(obj_id, true), new int[2] { price, int.MaxValue }); //add in support for wallpapers and carpets
- i += 3;
- if (i >= lineCount) break;
- }
-
- if (obj_type == "Ring" || obj_type == "ring")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Ring(obj_id), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
- }
- if (obj_type == "Lamp" || obj_type == "lamp" || obj_type == "Torch" || obj_type == "torch" || obj_type == "Craftable" || obj_type == "craftable" || obj_type == "BigCraftable" || obj_type == "bigcraftable")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Torch(Vector2.Zero, obj_id, true), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
- }
-
- if (obj_type == "Sword" || obj_type == "sword" || obj_type == "Weapon" || obj_type == "weapon")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new MeleeWeapon(obj_id), new int[2] { price, int.MaxValue });
-
- i += 3;
- if (i >= lineCount) break;
- }
-
- if (obj_type == "Hat" || obj_type == "hat" || obj_type == "Hats" || obj_type == "hats")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- // list_price.Add((Item)new Hat(obj_id), new int[2] { price, int.MaxValue });
- list_price.Add((Item)new Hat(obj_id), new int[2]
- {
- price,
- int.MaxValue
- });
- i += 3;
- if (i >= lineCount) break;
- }
-
-
- //TODO:
- //add in support for colored objects
- //add in support for tools
- Log.Success(i);
- if (i >= lineCount) break;
- else {
- obj_type = Convert.ToString(readtext[i]);
- i += 2;
- }
- }
-
-
- //NEED TO TEST ALL DATA FILES TO SEE WHAT CAN AND CANT BE ADDED
- //list.Add((Item)new StardewValley.Objects.ColoredObject(475,300, Color.Aqua));
- // Game1.activeClickableMenu = (IClickableMenu)new ShopMenu(list, 0, "Pierre");
-
-
-
-
- Game1.activeClickableMenu = (IClickableMenu)new ShopMenu(list_price, 0, "Pierre");
-
- } //very basic shop call with choosable menu to iterate through.
-
-
- public static void external_shop_file_call(string path, string fileName)
- {
- List
- list = new List
- ();
-
-
- string mylocation = Path.Combine(path, fileName);
-
- /// Log.Info(mylocation);
-
-
- string[] readtext = File.ReadAllLines(mylocation);
-
- var lineCount = File.ReadLines(mylocation).Count();
-
-
- // Log.Info(lineCount);
-
- int i = 4;
-
- int obj_id = 0;
- bool is_recipe;
- int price;
- int quality;
-
- string obj_type;
-
- obj_type = Convert.ToString(readtext[i]);
- i += 2;
-
-
-
- while (i < lineCount)
- {
- if (i >= lineCount) break;
- if (obj_type == "") break;
- if (readtext[i] == "") break;
-
- //read in a line for obj type here
- Log.Info(i);
- Log.Info(obj_type);
- if (obj_type == "item" || obj_type == "Item" || obj_type == "Object" || obj_type == "object")
- {
-
- obj_id = Convert.ToInt16(readtext[i]);
- i += 2;
-
- Log.Info(i);
- is_recipe = Convert.ToBoolean(readtext[i]);
- i += 2;
- Log.Info(i);
- price = Convert.ToInt32(readtext[i]);
- i += 2;
- Log.Info(i);
-
- quality = Convert.ToInt32(readtext[i]);
- // if (quality > 2) quality = 0;
-
-
- if (price == -1)
- {
- StardewValley.Object myobj = new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality);
-
- // Log.Info("MYPRICE");
- // Log.Info(myobj.salePrice());
- price = myobj.salePrice();
-
- }
-
-
- // list.Add((Item)new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality));
- list_price.Add((Item)new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
- }
- if (obj_type == "Furniture" || obj_type == "furniture")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
-
- // list.Add((Item)new Furniture(obj_id, Vector2.Zero)); //ADD FUNCTIONALITY TO SHOP FILES TO TEST IF FURNITURE OR NOT.
- list_price.Add((Item)new Furniture(obj_id, Vector2.Zero), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
-
-
-
-
- }
-
- if (obj_type == "Boots" || obj_type == "boots" || obj_type == "shoe" || obj_type == "Shoe") //just incase someone forgets it's called boots and they type shoe.
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Boots(obj_id), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
-
- }
-
- if (obj_type == "WallPaper" || obj_type == "Wallpaper" || obj_type == "wallPaper" || obj_type == "wallpaper") //just incase someone forgets it's called boots and they type shoe.
- {
- if (i + 3 > lineCount) break;
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Wallpaper(obj_id, false), new int[2] { price, int.MaxValue }); //add in support for wallpapers and carpets
- i += 3;
- if (i >= lineCount) break;
-
- }
-
- if (obj_type == "Carpet" || obj_type == "carpet" || obj_type == "Floor" || obj_type == "floor" || obj_type == "Rug" || obj_type == "rug")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Wallpaper(obj_id, true), new int[2] { price, int.MaxValue }); //add in support for wallpapers and carpets
- i += 3;
- if (i >= lineCount) break;
- }
-
- if (obj_type == "Ring" || obj_type == "ring")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Ring(obj_id), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
- }
- if (obj_type == "Lamp" || obj_type == "lamp" || obj_type == "Torch" || obj_type == "torch" || obj_type == "Craftable" || obj_type == "craftable" || obj_type == "BigCraftable" || obj_type == "bigcraftable")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Torch(Vector2.Zero, obj_id, true), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
- }
-
- if (obj_type == "Sword" || obj_type == "sword" || obj_type == "Weapon" || obj_type == "weapon")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new MeleeWeapon(obj_id), new int[2] { price, int.MaxValue });
-
- i += 3;
- if (i >= lineCount) break;
- }
-
- if (obj_type == "Hat" || obj_type == "hat" || obj_type == "Hats" || obj_type == "hats")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- // list_price.Add((Item)new Hat(obj_id), new int[2] { price, int.MaxValue });
- list_price.Add((Item)new Hat(obj_id), new int[2]
- {
- price,
- int.MaxValue
- });
- i += 3;
- if (i >= lineCount) break;
- }
-
-
- //TODO:
- //add in support for colored objects
- //add in support for tools
- Log.Success(i);
- if (i >= lineCount) break;
- else {
- obj_type = Convert.ToString(readtext[i]);
- i += 2;
- }
- }
-
-
- //NEED TO TEST ALL DATA FILES TO SEE WHAT CAN AND CANT BE ADDED
- //list.Add((Item)new StardewValley.Objects.ColoredObject(475,300, Color.Aqua));
- // Game1.activeClickableMenu = (IClickableMenu)new ShopMenu(list, 0, "Pierre");
-
-
- mymenu = (IClickableMenu)new ShopMenu(list_price, 0, "Pierre");
-
- Game1.activeClickableMenu = mymenu; //(IClickableMenu)new ShopMenu(list_price, 0, "Pierre");
-
- }//basic default of Pierre
-
-
- public static void external_shop_file_call(string path, string fileName, string shopChat, NPC my_npc )
- {
-
- List
- list = new List
- ();
-
-
- string mylocation = Path.Combine(path, fileName);
-
- /// Log.Info(mylocation);
-
-
- string[] readtext = File.ReadAllLines(mylocation);
-
- var lineCount = File.ReadLines(mylocation).Count();
-
-
- // Log.Info(lineCount);
-
- int i = 4;
-
- int obj_id = 0;
- bool is_recipe;
- int price;
- int quality;
-
- string obj_type;
-
- obj_type = Convert.ToString(readtext[i]);
- i += 2;
-
-
-
- while (i < lineCount)
- {
- if (i >= lineCount) break;
- if (obj_type == "") break;
- if (readtext[i] == "") break;
-
- //read in a line for obj type here
- Log.Info(i);
- Log.Info(obj_type);
- if (obj_type == "item" || obj_type == "Item" || obj_type == "Object" || obj_type == "object")
- {
-
- obj_id = Convert.ToInt16(readtext[i]);
- i += 2;
-
- Log.Info(i);
- is_recipe = Convert.ToBoolean(readtext[i]);
- i += 2;
- Log.Info(i);
- price = Convert.ToInt32(readtext[i]);
- i += 2;
- Log.Info(i);
-
- quality = Convert.ToInt32(readtext[i]);
- // if (quality > 2) quality = 0;
-
-
- if (price == -1)
- {
- StardewValley.Object myobj = new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality);
-
- // Log.Info("MYPRICE");
- // Log.Info(myobj.salePrice());
- price = myobj.salePrice();
-
- }
-
-
- // list.Add((Item)new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality));
- list_price.Add((Item)new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
- }
- if (obj_type == "Furniture" || obj_type == "furniture")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
-
- // list.Add((Item)new Furniture(obj_id, Vector2.Zero)); //ADD FUNCTIONALITY TO SHOP FILES TO TEST IF FURNITURE OR NOT.
- list_price.Add((Item)new Furniture(obj_id, Vector2.Zero), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
-
-
-
-
- }
-
- if (obj_type == "Boots" || obj_type == "boots" || obj_type == "shoe" || obj_type == "Shoe") //just incase someone forgets it's called boots and they type shoe.
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Boots(obj_id), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
-
- }
-
- if (obj_type == "WallPaper" || obj_type == "Wallpaper" || obj_type == "wallPaper" || obj_type == "wallpaper") //just incase someone forgets it's called boots and they type shoe.
- {
- if (i + 3 > lineCount) break;
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Wallpaper(obj_id, false), new int[2] { price, int.MaxValue }); //add in support for wallpapers and carpets
- i += 3;
- if (i >= lineCount) break;
-
- }
-
- if (obj_type == "Carpet" || obj_type == "carpet" || obj_type == "Floor" || obj_type == "floor" || obj_type == "Rug" || obj_type == "rug")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Wallpaper(obj_id, true), new int[2] { price, int.MaxValue }); //add in support for wallpapers and carpets
- i += 3;
- if (i >= lineCount) break;
- }
-
- if (obj_type == "Ring" || obj_type == "ring")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Objects.Ring(obj_id), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
- }
- if (obj_type == "Lamp" || obj_type == "lamp" || obj_type == "Torch" || obj_type == "torch" || obj_type == "Craftable" || obj_type == "craftable" || obj_type == "BigCraftable" || obj_type == "bigcraftable")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new StardewValley.Torch(Vector2.Zero, obj_id, true), new int[2] { price, int.MaxValue });
- i += 3;
- if (i >= lineCount) break;
- }
-
- if (obj_type == "Sword" || obj_type == "sword" || obj_type == "Weapon" || obj_type == "weapon")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- list_price.Add((Item)new MeleeWeapon(obj_id), new int[2] { price, int.MaxValue });
-
- i += 3;
- if (i >= lineCount) break;
- }
-
- if (obj_type == "Hat" || obj_type == "hat" || obj_type == "Hats" || obj_type == "hats")
- {
- obj_id = Convert.ToInt32(readtext[i]);
- i += 2;
- price = Convert.ToInt32(readtext[i]);
- // list_price.Add((Item)new Hat(obj_id), new int[2] { price, int.MaxValue });
- list_price.Add((Item)new Hat(obj_id), new int[2]
- {
- price,
- int.MaxValue
- });
- i += 3;
- if (i >= lineCount) break;
- }
-
-
- //TODO:
- //add in support for colored objects
- //add in support for tools
- Log.Success(i);
- if (i >= lineCount) break;
- else {
- obj_type = Convert.ToString(readtext[i]);
- i += 2;
- }
- }
-
-
- //NEED TO TEST ALL DATA FILES TO SEE WHAT CAN AND CANT BE ADDED
- //list.Add((Item)new StardewValley.Objects.ColoredObject(475,300, Color.Aqua));
- // Game1.activeClickableMenu = (IClickableMenu)new ShopMenu(list, 0, "Pierre");
-
- var shop_menu=new ShopMenu(list_price, 0, my_npc.name);
-
- shop_menu.potraitPersonDialogue = Game1.parseText(shopChat, Game1.dialogueFont, Game1.tileSize * 5 - Game1.pixelZoom * 4);
- shop_menu.portraitPerson = my_npc;
-
- mymenu = shop_menu;
-
-
- Game1.activeClickableMenu = mymenu; //(IClickableMenu)new ShopMenu(list_price, 0, "Pierre");
-
- } //uses NPCS with new dialogue and portraits
-
- //example of a shop that I don't use.
- public static List
- myshop()
- {
- List
- list = new List
- ();
- list.Add((Item)new StardewValley.Object(478, int.MaxValue, false, -1, 0)); //int parentsheet index OR object_ID/int.MaxValue, bool is recipe, price, quality
- list.Add((Item)new StardewValley.Object(486, int.MaxValue, false, -1, 0));
- list.Add((Item)new StardewValley.Object(494, int.MaxValue, false, -1, 0)); //Might be able to manipulate this code to give me recipes!!!!
- list.Add((Item)new StardewValley.Object(495, int.MaxValue, false, 800, 0)); //price is *2 of value shown. -1 means inherit default value
- switch (Game1.dayOfMonth % 7)
- {
- case 0:
- list.Add((Item)new StardewValley.Object(233, int.MaxValue, false, -1, 0));
- break;
- case 1:
- list.Add((Item)new StardewValley.Object(88, int.MaxValue, false, -1, 0));
- break;
- case 2:
- list.Add((Item)new StardewValley.Object(90, int.MaxValue, false, -1, 0));
- break;
- case 3:
- list.Add((Item)new StardewValley.Object(749, int.MaxValue, false, 500, 0));
- break;
- case 4:
- list.Add((Item)new StardewValley.Object(466, int.MaxValue, false, -1, 0));
- break;
- case 5:
- list.Add((Item)new StardewValley.Object(340, int.MaxValue, false, -1, 0));
- break;
- case 6:
- list.Add((Item)new StardewValley.Object(371, int.MaxValue, false, 100, 0));
- break;
- }
- return list;
- }
-
-
- }
-}
-//end class
\ No newline at end of file
diff --git a/GeneralMods/CustomShopsRedux/CustomShopsRedux.cs b/GeneralMods/CustomShopsRedux/CustomShopsRedux.cs
new file mode 100644
index 00000000..f0efc877
--- /dev/null
+++ b/GeneralMods/CustomShopsRedux/CustomShopsRedux.cs
@@ -0,0 +1,722 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Microsoft.Xna.Framework;
+using StardewModdingAPI;
+using StardewModdingAPI.Events;
+using StardewValley;
+using StardewValley.Menus;
+using StardewValley.Objects;
+using StardewValley.Tools;
+
+/*
+TO DO:
+Items
+furniture
+swords -
+hats -
+boots -
+wallpapers -
+carpets -
+ring -
+lamp-
+craftables-
+*/
+namespace Omegasis.CustomShopsRedux
+{
+ /// The mod entry point.
+ public class CustomShopsRedux : Mod
+ {
+ /*********
+ ** Properties
+ *********/
+ /// The prices for the items to list.
+ private readonly Dictionary
- ListPrices = new Dictionary
- ();
+
+ /// The folder path containing shop data files.
+ private string DataPath;
+
+ /// The configured shop options.
+ private readonly List Options = new List();
+
+ /// The key which shows the menu.
+ private string KeyBinding = "U";
+
+ /// Whether the player loaded a save.
+ private bool IsGameLoaded;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// The mod entry point, called after the mod is first loaded.
+ /// The mod arguments.
+ public override void Entry(params object[] args)
+ {
+ PlayerEvents.LoadedGame += this.PlayerEvents_LoadedGame;
+ ControlEvents.KeyPressed += this.ControlEvents_KeyPressed;
+ }
+
+
+ /*********
+ ** Private methods
+ *********/
+ /// The method invoked after the player loads a save.
+ /// The event sender.
+ /// The event data.
+ private void PlayerEvents_LoadedGame(object sender, EventArgsLoadedGameChanged e)
+ {
+ this.IsGameLoaded = true;
+ this.LoadConfig();
+ this.WriteConfig();
+ }
+
+ /// The method invoked when the presses a keyboard button.
+ /// The event sender.
+ /// The event data.
+ private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
+ {
+ if (!this.IsGameLoaded)
+ return;
+
+ if (e.KeyPressed.ToString() == this.KeyBinding) //if the key is pressed, load my cusom save function
+ {
+ this.OpenSelectFileMenu();
+ }
+ }
+
+ /// Load the configuration settings.
+ private void LoadConfig()
+ {
+ this.DataPath = Path.Combine(this.PathOnDisk, "Custom_Shops");
+ Directory.CreateDirectory(this.DataPath);
+
+ string path = Path.Combine(this.PathOnDisk, "Custom_Shop_Redux_Config.txt");
+ if (!File.Exists(path))
+ this.KeyBinding = "U";
+ else
+ {
+ string[] text = File.ReadAllLines(path);
+ this.KeyBinding = Convert.ToString(text[3]);
+ }
+ }
+
+ /// Save the configuration settings.
+ private void WriteConfig()
+ {
+ string path = Path.Combine(this.PathOnDisk, "Custom_Shop_Redux_Config.txt");
+ string[] text = new string[20];
+ text[0] = "Config: Custom_Shop_Redux. Feel free to mess with these settings.";
+ text[1] = "====================================================================================";
+
+ text[2] = "Key binding for saving anywhere. Press this key to save anywhere!";
+ text[3] = this.KeyBinding;
+
+ File.WriteAllLines(path, text);
+ }
+
+ /// Open the menu which lets the player choose a file.
+ private void OpenSelectFileMenu()
+ {
+ // get mod folder
+ DirectoryInfo modFolder = new DirectoryInfo(this.DataPath);
+ Log.Info(modFolder);
+
+ // get text files
+ FileInfo[] files = modFolder.GetFiles("*.txt");
+ if (!files.Any())
+ {
+ Log.Error("No shop .txt information is found. You should create one.");
+ return;
+ }
+
+ // parse options
+ foreach (FileInfo file in files)
+ this.Options.Add(file.Name);
+ if (!this.Options.Any())
+ {
+ Log.Error("No shop .txt information is found. You should create one.");
+ return;
+ }
+
+ // load menu
+ Game1.activeClickableMenu = new ChooseFromListMenu(this.Options, this.OnChoiceSelected);
+ }
+
+ /// The method called when the player chooses an option from the file list.
+ /// The selected file name.
+ private void OnChoiceSelected(string filename)
+ {
+ // read file data
+ string path = Path.Combine(this.DataPath, filename);
+ string[] text = File.ReadAllLines(path);
+ int lineCount = text.Length;
+
+ // validate
+ if (filename == "Custom_Shop_Redux_Config.txt")
+ {
+ Log.Info("Silly human. The config file is not a shop.");
+ return;
+ }
+
+ // parse data
+ string objType = Convert.ToString(text[4]);
+ int i = 6;
+ while (i < lineCount)
+ {
+ if (i >= lineCount || objType == "" || text[i] == "") break;
+
+ //read in a line for obj type here
+ Log.Info(i);
+ Log.Info(objType);
+ int objID;
+ int price;
+ if (objType == "item" || objType == "Item" || objType == "Object" || objType == "object")
+ {
+ objID = Convert.ToInt16(text[i]);
+ i += 2;
+
+ Log.Info(i);
+ bool isRecipe = Convert.ToBoolean(text[i]);
+ i += 2;
+ Log.Info(i);
+ price = Convert.ToInt32(text[i]);
+ i += 2;
+ Log.Info(i);
+
+ int quality = Convert.ToInt32(text[i]);
+
+ if (price == -1)
+ {
+ StardewValley.Object myobj = new StardewValley.Object(objID, int.MaxValue, isRecipe, price, quality);
+ price = myobj.salePrice();
+ }
+
+ this.ListPrices.Add(new StardewValley.Object(objID, int.MaxValue, isRecipe, price, quality), new[] { price, int.MaxValue });
+ i += 3;
+ if (i >= lineCount)
+ break;
+ }
+
+ if (objType == "Furniture" || objType == "furniture")
+ {
+ objID = Convert.ToInt32(text[i]);
+ i += 2;
+ price = Convert.ToInt32(text[i]);
+
+ this.ListPrices.Add(new Furniture(objID, Vector2.Zero), new[] { price, int.MaxValue });
+ i += 3;
+ if (i >= lineCount)
+ break;
+ }
+
+ if (objType == "Boots" || objType == "boots" || objType == "shoe" || objType == "Shoe") //just incase someone forgets it's called boots and they type shoe.
+ {
+ objID = Convert.ToInt32(text[i]);
+ i += 2;
+ price = Convert.ToInt32(text[i]);
+ this.ListPrices.Add(new Boots(objID), new[] { price, int.MaxValue });
+ i += 3;
+ if (i >= lineCount)
+ break;
+ }
+
+ if (objType == "WallPaper" || objType == "Wallpaper" || objType == "wallPaper" || objType == "wallpaper")
+ {
+ if (i + 3 > lineCount)
+ break;
+ objID = Convert.ToInt32(text[i]);
+ i += 2;
+ price = Convert.ToInt32(text[i]);
+ this.ListPrices.Add(new Wallpaper(objID), new[] { price, int.MaxValue }); //add in support for wallpapers and carpets
+ i += 3;
+ if (i >= lineCount)
+ break;
+
+ }
+
+ if (objType == "Carpet" || objType == "carpet" || objType == "Floor" || objType == "floor" || objType == "Rug" || objType == "rug")
+ {
+ objID = Convert.ToInt32(text[i]);
+ i += 2;
+ price = Convert.ToInt32(text[i]);
+ this.ListPrices.Add(new Wallpaper(objID, true), new[] { price, int.MaxValue }); //add in support for wallpapers and carpets
+ i += 3;
+ if (i >= lineCount)
+ break;
+ }
+
+ if (objType == "Ring" || objType == "ring")
+ {
+ objID = Convert.ToInt32(text[i]);
+ i += 2;
+ price = Convert.ToInt32(text[i]);
+ this.ListPrices.Add(new Ring(objID), new[] { price, int.MaxValue });
+ i += 3;
+ if (i >= lineCount)
+ break;
+ }
+
+ if (objType == "Lamp" || objType == "lamp" || objType == "Torch" || objType == "torch" || objType == "Craftable" || objType == "craftable" || objType == "BigCraftable" || objType == "bigcraftable")
+ {
+ objID = Convert.ToInt32(text[i]);
+ i += 2;
+ price = Convert.ToInt32(text[i]);
+ this.ListPrices.Add(new Torch(Vector2.Zero, objID, true), new[] { price, int.MaxValue });
+ i += 3;
+ if (i >= lineCount)
+ break;
+ }
+
+ if (objType == "Sword" || objType == "sword" || objType == "Weapon" || objType == "weapon")
+ {
+ objID = Convert.ToInt32(text[i]);
+ i += 2;
+ price = Convert.ToInt32(text[i]);
+ this.ListPrices.Add(new MeleeWeapon(objID), new[] { price, int.MaxValue });
+
+ i += 3;
+ if (i >= lineCount)
+ break;
+ }
+
+ if (objType == "Hat" || objType == "hat" || objType == "Hats" || objType == "hats")
+ {
+ objID = Convert.ToInt32(text[i]);
+ i += 2;
+ price = Convert.ToInt32(text[i]);
+ this.ListPrices.Add(new Hat(objID), new[] { price, int.MaxValue });
+ i += 3;
+ if (i >= lineCount)
+ break;
+ }
+
+ //TODO:
+ //add in support for colored objects
+ //add in support for tools
+ Log.Success(i);
+ if (i >= lineCount)
+ break;
+
+ objType = Convert.ToString(text[i]);
+ i += 2;
+ }
+
+ //NEED TO TEST ALL DATA FILES TO SEE WHAT CAN AND CANT BE ADDED
+ //list.Add((Item)new StardewValley.Objects.ColoredObject(475,300, Color.Aqua));
+ Game1.activeClickableMenu = new ShopMenu(this.ListPrices, 0, "Pierre");
+ }
+
+ //basic default of Pierre
+ //private void external_shop_file_call(string path, string fileName)
+ //{
+ // List
- list = new List
- ();
+
+
+ // string mylocation = Path.Combine(path, fileName);
+
+ // /// Log.Info(mylocation);
+
+
+ // string[] readtext = File.ReadAllLines(mylocation);
+
+ // var lineCount = File.ReadLines(mylocation).Count();
+
+
+ // // Log.Info(lineCount);
+
+ // int i = 4;
+
+ // int obj_id = 0;
+ // bool is_recipe;
+ // int price;
+ // int quality;
+
+ // string obj_type;
+
+ // obj_type = Convert.ToString(readtext[i]);
+ // i += 2;
+
+
+
+ // while (i < lineCount)
+ // {
+ // if (i >= lineCount) break;
+ // if (obj_type == "") break;
+ // if (readtext[i] == "") break;
+
+ // //read in a line for obj type here
+ // Log.Info(i);
+ // Log.Info(obj_type);
+ // if (obj_type == "item" || obj_type == "Item" || obj_type == "Object" || obj_type == "object")
+ // {
+
+ // obj_id = Convert.ToInt16(readtext[i]);
+ // i += 2;
+
+ // Log.Info(i);
+ // is_recipe = Convert.ToBoolean(readtext[i]);
+ // i += 2;
+ // Log.Info(i);
+ // price = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // Log.Info(i);
+
+ // quality = Convert.ToInt32(readtext[i]);
+ // // if (quality > 2) quality = 0;
+
+
+ // if (price == -1)
+ // {
+ // StardewValley.Object myobj = new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality);
+
+ // // Log.Info("MYPRICE");
+ // // Log.Info(myobj.salePrice());
+ // price = myobj.salePrice();
+
+ // }
+
+
+ // // list.Add((Item)new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality));
+ // this.ListPrices.Add(new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+ // if (obj_type == "Furniture" || obj_type == "furniture")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+
+ // // list.Add((Item)new Furniture(obj_id, Vector2.Zero)); //ADD FUNCTIONALITY TO SHOP FILES TO TEST IF FURNITURE OR NOT.
+ // this.ListPrices.Add(new Furniture(obj_id, Vector2.Zero), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+
+ // if (obj_type == "Boots" || obj_type == "boots" || obj_type == "shoe" || obj_type == "Shoe") //just incase someone forgets it's called boots and they type shoe.
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new Boots(obj_id), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+
+ // }
+
+ // if (obj_type == "WallPaper" || obj_type == "Wallpaper" || obj_type == "wallPaper" || obj_type == "wallpaper") //just incase someone forgets it's called boots and they type shoe.
+ // {
+ // if (i + 3 > lineCount) break;
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new Wallpaper(obj_id, false), new[] { price, int.MaxValue }); //add in support for wallpapers and carpets
+ // i += 3;
+ // if (i >= lineCount) break;
+
+ // }
+
+ // if (obj_type == "Carpet" || obj_type == "carpet" || obj_type == "Floor" || obj_type == "floor" || obj_type == "Rug" || obj_type == "rug")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new Wallpaper(obj_id, true), new[] { price, int.MaxValue }); //add in support for wallpapers and carpets
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+
+ // if (obj_type == "Ring" || obj_type == "ring")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new Ring(obj_id), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+ // if (obj_type == "Lamp" || obj_type == "lamp" || obj_type == "Torch" || obj_type == "torch" || obj_type == "Craftable" || obj_type == "craftable" || obj_type == "BigCraftable" || obj_type == "bigcraftable")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new Torch(Vector2.Zero, obj_id, true), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+
+ // if (obj_type == "Sword" || obj_type == "sword" || obj_type == "Weapon" || obj_type == "weapon")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new MeleeWeapon(obj_id), new[] { price, int.MaxValue });
+
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+
+ // if (obj_type == "Hat" || obj_type == "hat" || obj_type == "Hats" || obj_type == "hats")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // // list_price.Add((Item)new Hat(obj_id), new[] { price, int.MaxValue });
+ // this.ListPrices.Add(new Hat(obj_id), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+
+
+ // //TODO:
+ // //add in support for colored objects
+ // //add in support for tools
+ // Log.Success(i);
+ // if (i >= lineCount) break;
+ // else
+ // {
+ // obj_type = Convert.ToString(readtext[i]);
+ // i += 2;
+ // }
+ // }
+
+
+ // //NEED TO TEST ALL DATA FILES TO SEE WHAT CAN AND CANT BE ADDED
+ // //list.Add((Item)new StardewValley.Objects.ColoredObject(475,300, Color.Aqua));
+ // // Game1.activeClickableMenu = (IClickableMenu)new ShopMenu(list, 0, "Pierre");
+
+ // this.Menu = new ShopMenu(this.ListPrices, 0, "Pierre");
+ // Game1.activeClickableMenu = this.Menu;
+ //}
+
+
+ //uses NPCS with new dialogue and portraits
+ //private void external_shop_file_call(string path, string fileName, string shopChat, NPC my_npc)
+ //{
+
+ // List
- list = new List
- ();
+
+
+ // string mylocation = Path.Combine(path, fileName);
+
+ // /// Log.Info(mylocation);
+
+
+ // string[] readtext = File.ReadAllLines(mylocation);
+
+ // var lineCount = File.ReadLines(mylocation).Count();
+
+
+ // // Log.Info(lineCount);
+
+ // int i = 4;
+
+ // int obj_id = 0;
+ // bool is_recipe;
+ // int price;
+ // int quality;
+
+ // string obj_type;
+
+ // obj_type = Convert.ToString(readtext[i]);
+ // i += 2;
+
+
+
+ // while (i < lineCount)
+ // {
+ // if (i >= lineCount) break;
+ // if (obj_type == "") break;
+ // if (readtext[i] == "") break;
+
+ // //read in a line for obj type here
+ // Log.Info(i);
+ // Log.Info(obj_type);
+ // if (obj_type == "item" || obj_type == "Item" || obj_type == "Object" || obj_type == "object")
+ // {
+
+ // obj_id = Convert.ToInt16(readtext[i]);
+ // i += 2;
+
+ // Log.Info(i);
+ // is_recipe = Convert.ToBoolean(readtext[i]);
+ // i += 2;
+ // Log.Info(i);
+ // price = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // Log.Info(i);
+
+ // quality = Convert.ToInt32(readtext[i]);
+ // // if (quality > 2) quality = 0;
+
+
+ // if (price == -1)
+ // {
+ // StardewValley.Object myobj = new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality);
+
+ // // Log.Info("MYPRICE");
+ // // Log.Info(myobj.salePrice());
+ // price = myobj.salePrice();
+
+ // }
+
+
+ // // list.Add((Item)new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality));
+ // this.ListPrices.Add(new StardewValley.Object(obj_id, int.MaxValue, is_recipe, price, quality), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+ // if (obj_type == "Furniture" || obj_type == "furniture")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+
+ // // list.Add((Item)new Furniture(obj_id, Vector2.Zero)); //ADD FUNCTIONALITY TO SHOP FILES TO TEST IF FURNITURE OR NOT.
+ // this.ListPrices.Add(new Furniture(obj_id, Vector2.Zero), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+
+
+
+
+ // }
+
+ // if (obj_type == "Boots" || obj_type == "boots" || obj_type == "shoe" || obj_type == "Shoe") //just incase someone forgets it's called boots and they type shoe.
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new Boots(obj_id), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+
+ // }
+
+ // if (obj_type == "WallPaper" || obj_type == "Wallpaper" || obj_type == "wallPaper" || obj_type == "wallpaper") //just incase someone forgets it's called boots and they type shoe.
+ // {
+ // if (i + 3 > lineCount) break;
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new Wallpaper(obj_id, false), new[] { price, int.MaxValue }); //add in support for wallpapers and carpets
+ // i += 3;
+ // if (i >= lineCount) break;
+
+ // }
+
+ // if (obj_type == "Carpet" || obj_type == "carpet" || obj_type == "Floor" || obj_type == "floor" || obj_type == "Rug" || obj_type == "rug")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new Wallpaper(obj_id, true), new[] { price, int.MaxValue }); //add in support for wallpapers and carpets
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+
+ // if (obj_type == "Ring" || obj_type == "ring")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new Ring(obj_id), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+ // if (obj_type == "Lamp" || obj_type == "lamp" || obj_type == "Torch" || obj_type == "torch" || obj_type == "Craftable" || obj_type == "craftable" || obj_type == "BigCraftable" || obj_type == "bigcraftable")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new Torch(Vector2.Zero, obj_id, true), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+
+ // if (obj_type == "Sword" || obj_type == "sword" || obj_type == "Weapon" || obj_type == "weapon")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // this.ListPrices.Add(new MeleeWeapon(obj_id), new[] { price, int.MaxValue });
+
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+
+ // if (obj_type == "Hat" || obj_type == "hat" || obj_type == "Hats" || obj_type == "hats")
+ // {
+ // obj_id = Convert.ToInt32(readtext[i]);
+ // i += 2;
+ // price = Convert.ToInt32(readtext[i]);
+ // // list_price.Add((Item)new Hat(obj_id), new[] { price, int.MaxValue });
+ // this.ListPrices.Add(new Hat(obj_id), new[] { price, int.MaxValue });
+ // i += 3;
+ // if (i >= lineCount) break;
+ // }
+
+
+ // //TODO:
+ // //add in support for colored objects
+ // //add in support for tools
+ // Log.Success(i);
+ // if (i >= lineCount) break;
+ // else
+ // {
+ // obj_type = Convert.ToString(readtext[i]);
+ // i += 2;
+ // }
+ // }
+
+
+ // //NEED TO TEST ALL DATA FILES TO SEE WHAT CAN AND CANT BE ADDED
+ // //list.Add((Item)new StardewValley.Objects.ColoredObject(475,300, Color.Aqua));
+ // // Game1.activeClickableMenu = (IClickableMenu)new ShopMenu(list, 0, "Pierre");
+
+ // this.Menu = new ShopMenu(this.ListPrices, 0, my_npc.name)
+ // {
+ // potraitPersonDialogue = Game1.parseText(shopChat, Game1.dialogueFont, Game1.tileSize * 5 - Game1.pixelZoom * 4),
+ // portraitPerson = my_npc
+ // };
+ // Game1.activeClickableMenu = this.Menu;
+ //}
+
+ //example of a shop that I don't use.
+ //private List
- MyShop()
+ //{
+ // List
- list = new List
- ();
+ // list.Add(new StardewValley.Object(478, int.MaxValue, false, -1, 0)); //int parentsheet index OR object_ID/int.MaxValue, bool is recipe, price, quality
+ // list.Add(new StardewValley.Object(486, int.MaxValue, false, -1, 0));
+ // list.Add(new StardewValley.Object(494, int.MaxValue, false, -1, 0)); //Might be able to manipulate this code to give me recipes!!!!
+ // list.Add(new StardewValley.Object(495, int.MaxValue, false, 800, 0)); //price is *2 of value shown. -1 means inherit default value
+ // switch (Game1.dayOfMonth % 7)
+ // {
+ // case 0:
+ // list.Add(new StardewValley.Object(233, int.MaxValue, false, -1, 0));
+ // break;
+ // case 1:
+ // list.Add(new StardewValley.Object(88, int.MaxValue, false, -1, 0));
+ // break;
+ // case 2:
+ // list.Add(new StardewValley.Object(90, int.MaxValue, false, -1, 0));
+ // break;
+ // case 3:
+ // list.Add(new StardewValley.Object(749, int.MaxValue, false, 500, 0));
+ // break;
+ // case 4:
+ // list.Add(new StardewValley.Object(466, int.MaxValue, false, -1, 0));
+ // break;
+ // case 5:
+ // list.Add(new StardewValley.Object(340, int.MaxValue, false, -1, 0));
+ // break;
+ // case 6:
+ // list.Add(new StardewValley.Object(371, int.MaxValue, false, 100, 0));
+ // break;
+ // }
+ // return list;
+ //}
+ }
+}
diff --git a/GeneralMods/CustomShopsRedux/CustomShopsRedux.csproj b/GeneralMods/CustomShopsRedux/CustomShopsRedux.csproj
index 34facdb9..0c6e63ed 100644
--- a/GeneralMods/CustomShopsRedux/CustomShopsRedux.csproj
+++ b/GeneralMods/CustomShopsRedux/CustomShopsRedux.csproj
@@ -34,20 +34,27 @@
-
+
+ Properties\GlobalAssemblyInfo.cs
+
+
-
-
-
-
-
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
-
+
diff --git a/GeneralMods/CustomShopsRedux/Custom_Shop_Redux_Config.txt b/GeneralMods/CustomShopsRedux/Custom_Shop_Redux_Config.txt
deleted file mode 100644
index b2071dd4..00000000
--- a/GeneralMods/CustomShopsRedux/Custom_Shop_Redux_Config.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Config: Custom_Shop_Redux. Feel free to mess with these settings.
-====================================================================================
-Key binding for saving anywhere. Press this key to save anywhere!
-U
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/GeneralMods/CustomShopsRedux/Mod_readme.txt b/GeneralMods/CustomShopsRedux/Mod_readme.txt
deleted file mode 100644
index 6213c689..00000000
--- a/GeneralMods/CustomShopsRedux/Mod_readme.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-This is the custom shop mod!
-
-Basically making a custom shop is as simple as following the formatting in the pre-existsing custom_shops in a new text file.
-
-If you ever wish to call the mod without the menu in your own mod, simply call shop_file_call("myfilename.txt") in your Stardew Valley Mod.
-(Make sure you add a reference to this mod.)
-
-The full call would look something like.
-
-Custom_Shop_Mod_Redux.Class1.shop_file_call("file.txt");
-
-Where file.txt is the name of the shop info you wish to open.
-
-Make sure the formatting is correct otherwise you will get errors!
\ No newline at end of file
diff --git a/GeneralMods/CustomShopsRedux/Properties/AssemblyInfo.cs b/GeneralMods/CustomShopsRedux/Properties/AssemblyInfo.cs
index 0339063d..78e6b138 100644
--- a/GeneralMods/CustomShopsRedux/Properties/AssemblyInfo.cs
+++ b/GeneralMods/CustomShopsRedux/Properties/AssemblyInfo.cs
@@ -1,36 +1,7 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("CustomShopsRedux")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CustomShopsRedux")]
-[assembly: AssemblyCopyright("Copyright © 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("29f7de68-4c76-471e-86fb-873794802adc")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/GeneralMods/CustomShopsRedux/ReadMe.md b/GeneralMods/CustomShopsRedux/ReadMe.md
index 6e0aa0f5..09c9b129 100644
--- a/GeneralMods/CustomShopsRedux/ReadMe.md
+++ b/GeneralMods/CustomShopsRedux/ReadMe.md
@@ -1,80 +1,59 @@
-Custom_Shop_Mod_Redux_GUI v 1.2.0
+**Custom Shop Redux GUI** is a [Stardew Valley](http://stardewvalley.net/) mod which lets you
+create custom shops by editing text files.
-For SDV 1.0.7 and SMAPI v0.40
+Compatible with Stardew Valley 1.2+ on Linux, Mac, and Windows.
-Posted at 9:15 PM PST 5/8/16
+## Installation
+1. [Install the latest version of SMAPI](https://github.com/Pathoschild/SMAPI/releases).
+2.
Install this mod from Nexus mods (not yet released).
+3. Run the game using SMAPI.
--Updated to be able to be called from other mods for NPC shop binding and soforth.
+## Usage
+Make a custom shop by copying & editing one of the included custom shop templates, or use the
+[Custom Shops Creation Tool](https://myscccd-my.sharepoint.com/personal/0703280_my_scccd_edu/_layouts/15/guestaccess.aspx?guestaccesstoken=ZYxG9Cs8S0q%2bxCVV3fEnc8MI4SfVfe07919rhFUhRiA%3d&docid=0e51dae1da2eb43988f77f5c54ec3ee58)
+(see [demo video](https://youtu.be/bSvNTZmgeZE)).
--Fixed a bug where pressing the U key on the main menu causes the game to crash.
+You can access the custom shops by pressing `U` in-game (configurable via `Custom_Shop_Redux_Config.txt`).
-Good evening everyone. At this point I don't even know how I'm creating mods so quickly, but I think I'll strike while the iron is hot. Here is my third release of the day, the Custom Shops Mod Redux!
+Supported item types:
-The custom_shop_mod_redux is a second, much better attempt at adding custom shops into StardewValley!
-
-***Not to be confused with the custom_shop_mod which was it's predecessor and was based around the SMAPI console.
-
-Basically making a custom shop is as simple as following the formatting in the pre-existsing custom_shops in a new text file. (Or by using the super useful Custom Shop Creation Tool)
-
-You can access these custom shops by pressing a key. (The U key by default, which is configurable in the config file)
-
-I recommend that you use the Custom Shop Creation Tool that I created for everyone to create your custom shops. The link is down below. Took me a little bit of time to put together, but it works.
-
-Watch the new video to understand how it works.
-
-Have fun with this one! I hope to see all of the custom shops that you all put out!
-
-====================================================
-If you wish to call this mod in your own mod without the menu the code would be
-
-Custom_Shop_Mod_Redux.Class1.external_shop_file_call(path, filename);
-
-Where path is the directory path of the desired text file, and filename is the name of the file inside of the path directory.
-
-*Note that path will not include the file itself. The code will take care of that for you.
-
-This would be useful if you want a custom NPC to have a shop but you don't want to have to code in the shop yourself.
-=========================================================
-Some goals of mine with this mod:
-
-1. Get as many different types of items available for selling. (finished)
-
-2.Create a nice gui interface in Unity for creating custom shops so that modders don't have to deal with my icky formatting rules. The GUI will take care of that for modders. (finished)
-
-3.Make my code compatible with other mods for modders, so that they can call my shop_command_code and be able to open up a shop from text file with just path information, and file names. (This is next)
-
-4. Document the mod for future user use.
-==========================================================
-Types of Items this mod supports in shops.
-1.Items (like normal inventory items)
-
-2.Furniture- (windows, tables, chairs, etc)
-
-3.swords- Swish, swish.
-
-4.Hats -Got to look cool
-
-5.Boots - Lace up for adventure.
-
-6.Wallpapers - Make your house look nice.
-
-7.Carpets/Flooring - Like animal crossing.
-
-8.Rings - As long as they aren't evil.
-
-9.Lamps - Light up the world.
-
-10.craftables* =*note that there was some....issues adding in craftable objects. They all act like torches when you interact with them. It's kind of hilarious and I don't think I'll change it anytime soon. You can still have objects like the furnace function like normal, by right clicking it with copper. In order to get the smelted copper bar however, you would have to destroy it, as would go for all machines that behave this way. Sorry. On the plus side your scarecrows can be on fire forever.
+* inventory items;
+* furniture (windows, tables, chairs, etc);
+* swords (swish, swish);
+* gats (got to look cool);
+* boots (lace up for adventure);
+* wallpapers (make your house look nice);
+* carpets & flooring (like Animal Crossing);
+* rings (as long as they aren't evil);
+* lamps (light up the world);
+* craftables (note that there are some... issues with craftables. They all act like torches when
+ you interact with them. It's kind of hilarious and I don't think I'll change it anytime soon. You
+ can still have objects like the furnace function like normal, by right-clicking it with copper.
+ In order to get the smelted copper bar however, you would have to destroy it, as would go for all
+ machines that behave this way. Sorry. On the plus side your scarecrows can be on fire forever.)
-Link:
-Get it Here!
-Link for the Custom Shops Creation Tool.:
-https://myscccd-my.sharepoint.com/personal/0703280_my_scccd_edu/_layouts/15/guestaccess.aspx?guestaccesstoken=ZYxG9Cs8S0q%2bxCVV3fEnc8MI4SfVfe07919rhFUhRiA%3d&docid=0e51dae1da2eb43988f77f5c54ec3ee58
+## Goals
+* [x] Get as many different types of items available for selling.
+* [x] Create a nice GUI for creating custom shops so that modders don't have to deal with my icky
+ formatting rules. The GUI will take care of that for modders.
+* [x] Make my code compatible with other mods for modders, so that they can call my
+ shop_command_code and be able to open up a shop from text file with just path information,
+ and file names.
-Also here is a video demonstrating how this mod works.
+## Versions
+1.0:
+* Initial release.
-https://youtu.be/bSvNTZmgeZE
+1.0.1:
+* Corrected price display to reflect markup.
+1.0.2:
+* Fixed issues where unintended items were bought.
+
+1.1:
+* Updated to Stardew Valley 1.1 and SMAPI 0.40 1.1-3.
+* Fixed mouse not appearing in menu.
+* Fixed bug where you sometimes couldn't buy an item even if you had enough money.
\ No newline at end of file
diff --git a/GeneralMods/CustomShopsRedux/manifest.json b/GeneralMods/CustomShopsRedux/manifest.json
index 6b75feeb..2d8a6d2a 100644
--- a/GeneralMods/CustomShopsRedux/manifest.json
+++ b/GeneralMods/CustomShopsRedux/manifest.json
@@ -11,4 +11,4 @@
"UniqueID": "4be88c18-b6f3-49b0-ba96-f94b1a5be890",
"PerSaveConfigs": false,
"EntryDll": "CustomShopsRedux.dll"
-}
\ No newline at end of file
+}
diff --git a/GeneralMods/DailyQuestAnywhere/Class1.cs b/GeneralMods/DailyQuestAnywhere/Class1.cs
deleted file mode 100644
index 4eac1113..00000000
--- a/GeneralMods/DailyQuestAnywhere/Class1.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-using System;
-using System.IO;
-using StardewModdingAPI;
-using StardewValley;
-
-/*
-TO DO:
-
-*/
-namespace Omegasis.DailyQuestAnywhere
-{
- public class Class1 : Mod
- {
- string key_binding = "H";
-
- bool game_loaded = false;
-
- public override void Entry(IModHelper helper)
- {
- //set up all of my events here
- StardewModdingAPI.Events.SaveEvents.AfterLoad += PlayerEvents_LoadedGame;
- StardewModdingAPI.Events.ControlEvents.KeyPressed += ControlEvents_KeyPressed;
- }
-
-
-
- public void ControlEvents_KeyPressed(object sender, StardewModdingAPI.Events.EventArgsKeyPressed e)
- {
- if (Game1.player == null) return;
- if (Game1.player.currentLocation == null) return;
- if (game_loaded == false) return;
-
- if (e.KeyPressed.ToString() == key_binding) //if the key is pressed, load my cusom save function
- {
- if (Game1.activeClickableMenu != null) return;
- my_menu();
- }
- //DataLoader_Settings(); //update the key if players changed it while playing.
- }
-
- public void PlayerEvents_LoadedGame(object sender, EventArgs 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(Helper.DirectoryPath, "DailyQuest_Anywhere_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 = "H";
- // 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(Helper.DirectoryPath, "DailyQuest_Anywhere_Config");
- string mylocation2 = mylocation;
- string mylocation3 = mylocation2 + ".txt";
-
- string[] mystring3 = new string[20];
- if (!File.Exists(mylocation3))
- {
- Monitor.Log("DailyQuest_Anywhere: The DailyQuest Anywhere Config doesn't exist. Creating it now.");
-
- mystring3[0] = "Config: DailyQuest_Anywhere Info. Feel free to mess with these settings.";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Key binding for opening the billboard for quests anywhere. Press this key to do so";
- 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: DailyQuest_Anywhere Info. Feel free to mess with these settings.";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Key binding for opening the billboard for quests anywhere. Press this key to do so";
- mystring3[3] = key_binding.ToString();
-
- File.WriteAllLines(mylocation3, mystring3);
- }
- }
-
-
-
-
- void my_menu()
- {
-
- // 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.Billboard(true);
- }
-
- }
-}
-//end class
\ No newline at end of file
diff --git a/GeneralMods/DailyQuestAnywhere/DailyQuestAnywhere.cs b/GeneralMods/DailyQuestAnywhere/DailyQuestAnywhere.cs
new file mode 100644
index 00000000..a0ffc204
--- /dev/null
+++ b/GeneralMods/DailyQuestAnywhere/DailyQuestAnywhere.cs
@@ -0,0 +1,87 @@
+using System;
+using System.IO;
+using StardewModdingAPI;
+using StardewModdingAPI.Events;
+using StardewValley;
+using StardewValley.Menus;
+
+namespace Omegasis.DailyQuestAnywhere
+{
+ /// The mod entry point.
+ public class DailyQuestAnywhere : Mod
+ {
+ /*********
+ ** Properties
+ *********/
+ /// The key which shows the menu.
+ private string KeyBinding = "H";
+
+ /// Whether the player loaded a save.
+ private bool IsGameLoaded;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// The mod entry point, called after the mod is first loaded.
+ /// Provides simplified APIs for writing mods.
+ public override void Entry(IModHelper helper)
+ {
+ SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
+ ControlEvents.KeyPressed += this.ControlEvents_KeyPressed;
+ }
+
+
+ /*********
+ ** Private methods
+ *********/
+ /// The method invoked after the player loads a save.
+ /// The event sender.
+ /// The event data.
+ private void SaveEvents_AfterLoad(object sender, EventArgs e)
+ {
+ this.IsGameLoaded = true;
+ this.LoadConfig();
+ this.WriteConfig();
+ }
+
+ /// The method invoked when the presses a keyboard button.
+ /// The event sender.
+ /// The event data.
+ private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
+ {
+ if (Game1.player == null || Game1.player.currentLocation == null || this.IsGameLoaded == false || Game1.activeClickableMenu != null)
+ return;
+
+ if (e.KeyPressed.ToString() == this.KeyBinding)
+ Game1.activeClickableMenu = new Billboard(true);
+ }
+
+ /// Load the configuration settings.
+ void LoadConfig()
+ {
+ string path = Path.Combine(Helper.DirectoryPath, "DailyQuest_Anywhere_Config.txt");
+ if (!File.Exists(path))
+ this.KeyBinding = "H";
+ else
+ {
+ string[] text = File.ReadAllLines(path);
+ this.KeyBinding = Convert.ToString(text[3]);
+ }
+ }
+
+ /// Save the configuration settings.
+ void WriteConfig()
+ {
+ string path = Path.Combine(Helper.DirectoryPath, "DailyQuest_Anywhere_Config.txt");
+ string[] text = new string[20];
+ text[0] = "Config: DailyQuest_Anywhere Info. Feel free to mess with these settings.";
+ text[1] = "====================================================================================";
+
+ text[2] = "Key binding for opening the billboard for quests anywhere. Press this key to do so";
+ text[3] = this.KeyBinding;
+
+ File.WriteAllLines(path, text);
+ }
+ }
+}
diff --git a/GeneralMods/DailyQuestAnywhere/DailyQuestAnywhere.csproj b/GeneralMods/DailyQuestAnywhere/DailyQuestAnywhere.csproj
index e672453e..65963a04 100644
--- a/GeneralMods/DailyQuestAnywhere/DailyQuestAnywhere.csproj
+++ b/GeneralMods/DailyQuestAnywhere/DailyQuestAnywhere.csproj
@@ -34,7 +34,10 @@
-
+
+ Properties\GlobalAssemblyInfo.cs
+
+
@@ -42,7 +45,7 @@
-
+
diff --git a/GeneralMods/DailyQuestAnywhere/Properties/AssemblyInfo.cs b/GeneralMods/DailyQuestAnywhere/Properties/AssemblyInfo.cs
index 2c5101a0..4b026daf 100644
--- a/GeneralMods/DailyQuestAnywhere/Properties/AssemblyInfo.cs
+++ b/GeneralMods/DailyQuestAnywhere/Properties/AssemblyInfo.cs
@@ -1,36 +1,7 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("DailyQuest Anywhere")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("DailyQuest Anywhere")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: AssemblyTitle("DailyQuestAnywhere")]
[assembly: Guid("ac4b84f5-31e4-4a55-b13f-a5189c552343")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/GeneralMods/DailyQuestAnywhere/README.md b/GeneralMods/DailyQuestAnywhere/README.md
new file mode 100644
index 00000000..c719b2f8
--- /dev/null
+++ b/GeneralMods/DailyQuestAnywhere/README.md
@@ -0,0 +1,19 @@
+**Daily Quest Anywhere** is a [Stardew Valley](http://stardewvalley.net/) mod which lets you open
+the daily quest menu from anywhere in-game.
+
+Compatible with Stardew Valley 1.2+ on Linux, Mac, and Windows.
+
+## Installation
+1. [Install the latest version of SMAPI](https://github.com/Pathoschild/SMAPI/releases).
+2. Install [this mod from Nexus mods](http://www.nexusmods.com/stardewvalley/mods/513).
+3. Run the game using SMAPI.
+
+## Usage
+Press `H` to open the daily quest menu. Edit `DailyQuest_Anywhere_Config.txt` to change the key.
+
+## Versions
+1.0:
+* Initial release.
+
+1.1:
+* Updated to Stardew Valley 1.1 and SMAPI 0.40 1.1-3.
diff --git a/GeneralMods/DailyQuestAnywhere/ReadMe.txt b/GeneralMods/DailyQuestAnywhere/ReadMe.txt
deleted file mode 100644
index db5cdd2d..00000000
--- a/GeneralMods/DailyQuestAnywhere/ReadMe.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-DailyQuest_Anywhere
-
-Version:1.1.0
-
-Published: 8/14/16 12:50 PM
-
-Updated: 10/14/16 12:27 AM
-
-Compatability:
-
-Stardew Valley 1.1.0 Windows
-
-SMAPI 0.40.0 1.1-3
-
-Description:
-
-A simple mod that allows you to open the daily quest menu from anywhere.
-
-Usage: Press H to open up the buy back menu.
-
-Update Info:
-1.1.0
--Updated to SDV 1.1
-1.0.0
--Initial Release
diff --git a/GeneralMods/DailyQuestAnywhere/manifest.json b/GeneralMods/DailyQuestAnywhere/manifest.json
index 7d1f4afd..6c08cff4 100644
--- a/GeneralMods/DailyQuestAnywhere/manifest.json
+++ b/GeneralMods/DailyQuestAnywhere/manifest.json
@@ -11,4 +11,4 @@
"UniqueID": "DailyQuest",
"PerSaveConfigs": false,
"EntryDll": "DailyQuestAnywhere.dll"
-}
\ No newline at end of file
+}
diff --git a/GeneralMods/Fall28SnowDay/Class1.cs b/GeneralMods/Fall28SnowDay/Class1.cs
deleted file mode 100644
index d736404e..00000000
--- a/GeneralMods/Fall28SnowDay/Class1.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using StardewModdingAPI;
-using StardewValley;
-
-namespace Omegasis.Fall28SnowDay
-{
- public class Class1:Mod
- {
- public override void Entry(IModHelper helper)
- {
- StardewModdingAPI.Events.TimeEvents.DayOfMonthChanged += TimeEvents_DayOfMonthChanged;
- }
-
- public void TimeEvents_DayOfMonthChanged(object sender, StardewModdingAPI.Events.EventArgsIntChanged e)
- {
- if (StardewValley.Game1.dayOfMonth == 27 && Game1.IsFall == true)
- {
- // Log.Success("Weather checker now!!!");
- Game1.weatherForTomorrow = Game1.weather_snow;
- }
- }
- }
-}
diff --git a/GeneralMods/Fall28SnowDay/Fall28SnowDay.cs b/GeneralMods/Fall28SnowDay/Fall28SnowDay.cs
new file mode 100644
index 00000000..71a66016
--- /dev/null
+++ b/GeneralMods/Fall28SnowDay/Fall28SnowDay.cs
@@ -0,0 +1,33 @@
+using StardewModdingAPI;
+using StardewModdingAPI.Events;
+using StardewValley;
+
+namespace Omegasis.Fall28SnowDay
+{
+ /// The mod entry point.
+ public class Fall28SnowDay : Mod
+ {
+ /*********
+ ** Public methods
+ *********/
+ /// The mod entry point, called after the mod is first loaded.
+ /// Provides simplified APIs for writing mods.
+ public override void Entry(IModHelper helper)
+ {
+ TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
+ }
+
+
+ /*********
+ ** Private methods
+ *********/
+ /// The method invoked when changes.
+ /// The event sender.
+ /// The event data.
+ public void TimeEvents_DayOfMonthChanged(object sender, EventArgsIntChanged e)
+ {
+ if (Game1.dayOfMonth == 27 && Game1.IsFall)
+ Game1.weatherForTomorrow = Game1.weather_snow;
+ }
+ }
+}
diff --git a/GeneralMods/Fall28SnowDay/Fall28SnowDay.csproj b/GeneralMods/Fall28SnowDay/Fall28SnowDay.csproj
index 7a7763b6..94da970f 100644
--- a/GeneralMods/Fall28SnowDay/Fall28SnowDay.csproj
+++ b/GeneralMods/Fall28SnowDay/Fall28SnowDay.csproj
@@ -34,7 +34,10 @@
-
+
+ Properties\GlobalAssemblyInfo.cs
+
+
@@ -42,7 +45,7 @@
-
+
diff --git a/GeneralMods/Fall28SnowDay/Properties/AssemblyInfo.cs b/GeneralMods/Fall28SnowDay/Properties/AssemblyInfo.cs
index 7dc4e1d4..ff8922ac 100644
--- a/GeneralMods/Fall28SnowDay/Properties/AssemblyInfo.cs
+++ b/GeneralMods/Fall28SnowDay/Properties/AssemblyInfo.cs
@@ -1,36 +1,7 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("Fall28SnowDay")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Fall28SnowDay")]
-[assembly: AssemblyCopyright("Copyright © 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1dbb583d-4a4f-4a46-8cc5-42017c93d292")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/GeneralMods/Fall28SnowDay/README.md b/GeneralMods/Fall28SnowDay/README.md
new file mode 100644
index 00000000..7fa8c3b9
--- /dev/null
+++ b/GeneralMods/Fall28SnowDay/README.md
@@ -0,0 +1,19 @@
+**Daily Quest Anywhere** is a [Stardew Valley](http://stardewvalley.net/) mod which makes snow fall
+on the last day of fall, which would explain why the town is covered in snow on the next day.
+
+Compatible with Stardew Valley 1.2+ on Linux, Mac, and Windows.
+
+## Installation
+1. [Install the latest version of SMAPI](https://github.com/Pathoschild/SMAPI/releases).
+2. Install [this mod from Nexus mods](http://www.nexusmods.com/stardewvalley/mods/486).
+3. Run the game using SMAPI.
+
+## Usage
+It automatically snows on fall 28.
+
+## Versions
+1.0:
+* Initial release.
+
+1.1:
+* Updated to Stardew Valley 1.1 and SMAPI 0.40 1.1-3.
diff --git a/GeneralMods/Fall28SnowDay/Readme.txt b/GeneralMods/Fall28SnowDay/Readme.txt
deleted file mode 100644
index f5c910c9..00000000
--- a/GeneralMods/Fall28SnowDay/Readme.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Fall 28 Snow Day 1.1.0
-
-Posted on 7/9/16
-Updated 10/21/16 12:26 AM
-
-Compatability:
-SDV 1.1
-SMAPI 0.40.0 1.1-3
-Windows
-
-Descritption:
-
--Just a small mod that makes it snow on Fall 28th, which would explain why the town is covered in snow come the 1st of Winter.
-
-Updates:
-1.1.0
--Updated to SDV 1.1
-
-1.0.0
--Initial release.
\ No newline at end of file
diff --git a/GeneralMods/Fall28SnowDay/manifest.json b/GeneralMods/Fall28SnowDay/manifest.json
index 651016ab..31ee6b47 100644
--- a/GeneralMods/Fall28SnowDay/manifest.json
+++ b/GeneralMods/Fall28SnowDay/manifest.json
@@ -11,4 +11,4 @@
"UniqueID": "Fall28 Snow Day",
"PerSaveConfigs": false,
"EntryDll": "Fall28SnowDay.dll"
-}
\ No newline at end of file
+}
diff --git a/GeneralMods/GlobalAssemblyInfo.cs b/GeneralMods/GlobalAssemblyInfo.cs
new file mode 100644
index 00000000..5c97d967
--- /dev/null
+++ b/GeneralMods/GlobalAssemblyInfo.cs
@@ -0,0 +1,11 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: ComVisible(false)]
diff --git a/GeneralMods/HappyBirthday/Birthday_Menu.cs b/GeneralMods/HappyBirthday/Birthday_Menu.cs
deleted file mode 100644
index 9d84354a..00000000
--- a/GeneralMods/HappyBirthday/Birthday_Menu.cs
+++ /dev/null
@@ -1,436 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input;
-using StardewValley;
-using StardewValley.Menus;
-using StardewValley.Minigames;
-
-namespace Omegasis.HappyBirthday
-{
- public class Birthday_Menu : IClickableMenu
- {
- public const int colorPickerTimerDelay = 100;
-
- public List shirtOptions;
-
- public List hairStyleOptions;
-
- public List accessoryOptions;
-
- public int currentShirt;
-
- public int currentHair;
-
- public int currentAccessory;
-
- public int colorPickerTimer;
-
- public ColorPicker pantsColorPicker;
-
- public ColorPicker hairColorPicker;
-
- public ColorPicker eyeColorPicker;
-
- public List labels = new List();
-
-
- public List seasonButtons = new List();
-
- public List seasonTitleButtons = new List();
-
- public ClickableTextureComponent okButton;
-
- public ClickableTextureComponent skipIntroButton;
-
- // public ClickableTextureComponent randomButton;
-
- public TextBox nameBox;
-
- public TextBox farmnameBox;
-
- public TextBox favThingBox;
-
- public bool skipIntro;
-
- public bool wizardSource;
-
- public ColorPicker lastHeldColorPicker;
-
- public int timesRandom;
-
- public Birthday_Menu(bool wizardSource = false) : base(Game1.viewport.Width / 2 - (632 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2 - Game1.tileSize, 632 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2 + Game1.tileSize, false)
- {
-
- this.wizardSource = wizardSource;
- this.setUpPositions();
- Game1.player.faceDirection(2);
- Game1.player.FarmerSprite.StopAnimation();
- }
-
- public override void gameWindowSizeChanged(Rectangle oldBounds, Rectangle newBounds)
- {
- base.gameWindowSizeChanged(oldBounds, newBounds);
- this.xPositionOnScreen = Game1.viewport.Width / 2 - (632 + IClickableMenu.borderWidth * 2) / 2;
- this.yPositionOnScreen = Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2 - Game1.tileSize;
- this.setUpPositions();
- }
-
- public virtual void setUpPositions()
- {
- this.labels.Clear();
- this.seasonButtons.Clear();
- this.okButton = new ClickableTextureComponent("OK", new Rectangle(this.xPositionOnScreen + this.width - IClickableMenu.borderWidth - IClickableMenu.spaceToClearSideBorder - Game1.tileSize, this.yPositionOnScreen + this.height - IClickableMenu.borderWidth - IClickableMenu.spaceToClearTopBorder + Game1.tileSize / 4, Game1.tileSize, Game1.tileSize), "", null, Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46, -1, -1), 1f, false);
-
-
-
- // this.randomButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + Game1.pixelZoom * 12, this.yPositionOnScreen + Game1.tileSize + Game1.pixelZoom * 14, Game1.pixelZoom * 10, Game1.pixelZoom * 10), "", "", Game1.mouseCursors, new Rectangle(381, 361, 10, 10), (float)Game1.pixelZoom);
- int num = Game1.tileSize * 2;
- //new ClickableComponent(new Rectangle(x2, y, Game1.tileSize * 3 / 4 - 4, Game1.tileSize * 3 / 4 - 4), string.Concat((object) (index * 5))) //allows you to make numbers into buttons: Taken from elevator menu
- this.labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 8, 1, 1),"Birthday Season: "+ HappyBirthday.Class1.player_birthday_season));
- this.labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize, Game1.tileSize * 2, Game1.tileSize), "Birthday Date: " + HappyBirthday.Class1.player_birthday_date));
- this.seasonTitleButtons.Add(new ClickableTextureComponent("Spring", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize*2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(188, 438, 32, 9), (float)Game1.pixelZoom, false));
- this.seasonTitleButtons.Add(new ClickableTextureComponent("Summer", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize*2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(220, 438, 32, 8), (float)Game1.pixelZoom, false));
- this.seasonTitleButtons.Add(new ClickableTextureComponent("Fall", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize*2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(188, 447, 32, 10), (float)Game1.pixelZoom, false));
- this.seasonTitleButtons.Add(new ClickableTextureComponent("Winter", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 7 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize*2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(220, 448, 32, 8), (float)Game1.pixelZoom, false));
-
-
- this.seasonButtons.Add(new ClickableTextureComponent("1", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("2",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 2 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false ));
- this.seasonButtons.Add(new ClickableTextureComponent("3",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(24, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("4",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 4 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(32, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("5",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(40, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("6",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 6 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(48, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("7",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 7 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(56, 16, 8, 12), (float)Game1.pixelZoom, false));
-
- this.seasonButtons.Add(new ClickableTextureComponent("8",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(64, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("9",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 2 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(72, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("10",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize *2.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize /2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("10",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize/2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(0, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("11",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("11",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("12",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("12",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("13",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("13",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(24, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("14",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("14",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 7.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(32, 16, 8, 12), (float)Game1.pixelZoom, false));
- // this.seasonButtons.Add(new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 4 - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "11", "11", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(32, 16, 8, 12), (float)Game1.pixelZoom, false, false));
-
-
- this.seasonButtons.Add(new ClickableTextureComponent("15",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 0.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("15",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 1.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(40, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("16",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 1.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("16",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 2.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(48, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("17",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 2.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("17",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(56, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("18",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("18",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(64, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("19",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("19",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(72, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("20",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("20",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(0, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("21",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("21",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 7.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), (float)Game1.pixelZoom, false));
-
-
- this.seasonButtons.Add(new ClickableTextureComponent("22",new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 0.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("22", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 1.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("23", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 1.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("23", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 2.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(24, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("24", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 2.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("24", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(32, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("25", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("25", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(40, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("26", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("26", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(48, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("27", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("27", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(56, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("28", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), (float)Game1.pixelZoom, false));
- this.seasonButtons.Add(new ClickableTextureComponent("28", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 7.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(64, 16, 8, 12), (float)Game1.pixelZoom, false));
- num = Game1.tileSize * 4 + 8;
-
- }
-
- public virtual void optionButtonClick(string name)
- {
- if (name != null)
- {
- if (name == "Spring")
- {
- HappyBirthday.Class1.player_birthday_season = "spring";
- Game1.activeClickableMenu = new Birthday_Menu();
- }
- else if (name == "Summer")
- {
- HappyBirthday.Class1.player_birthday_season = "summer";
- Game1.activeClickableMenu = new Birthday_Menu();
- }
- else if (name == "Fall")
- {
- HappyBirthday.Class1.player_birthday_season = "fall";
- Game1.activeClickableMenu = new Birthday_Menu();
- }
- else if (name == "Winter")
- {
- HappyBirthday.Class1.player_birthday_season = "winter";
- Game1.activeClickableMenu = new Birthday_Menu();
- }
-
-
- else if (name == "OK" && (HappyBirthday.Class1.player_birthday_date >= 1 || HappyBirthday.Class1.player_birthday_date <= 28))
- {
-
- if (!this.canLeaveMenu())
- {
- return;
- }
- //Game1.player.Name = this.nameBox.Text.Trim();
- // Game1.player.favoriteThing = this.favThingBox.Text.Trim();
- if (Game1.activeClickableMenu is TitleMenu)
- {
- // (Game1.activeClickableMenu as TitleMenu).createdNewCharacter(this.skipIntro);
- }
- else
- {
- Game1.exitActiveMenu();
- if (Game1.currentMinigame != null && Game1.currentMinigame is Intro)
- {
- (Game1.currentMinigame as Intro).doneCreatingCharacter();
- }
- else if (this.wizardSource)
- {
- Game1.flashAlpha = 1f;
- Game1.playSound("yoba");
- }
- }
- }
- else
- {
- HappyBirthday.Class1.player_birthday_date = Convert.ToInt32(name);
- Game1.activeClickableMenu = new Birthday_Menu();
- }
-
- }
- Game1.playSound("coin");
- }
-
- public virtual void selectionClick(string name, int change)
- {
- if (name != null)
- {
- Game1.player.faceDirection((Game1.player.facingDirection - change + 4) % 4);
- Game1.player.FarmerSprite.StopAnimation();
- Game1.player.completelyStopAnimatingOrDoingAction();
- Game1.playSound("pickUpItem");
- }
- }
-
- public override void receiveLeftClick(int x, int y, bool playSound = true)
- {
-
- foreach (ClickableComponent current2 in this.seasonButtons)
- {
- if (current2.containsPoint(x, y))
- {
- this.optionButtonClick(current2.name);
- current2.scale -= 0.5f;
- current2.scale = Math.Max(3.5f, current2.scale);
- }
- }
- foreach (ClickableComponent current2 in this.seasonTitleButtons)
- {
- if (current2.containsPoint(x, y))
- {
- this.optionButtonClick(current2.name);
- current2.scale -= 0.5f;
- current2.scale = Math.Max(3.5f, current2.scale);
- }
- }
-
- if (this.okButton.containsPoint(x, y) && this.canLeaveMenu())
- {
- this.optionButtonClick(this.okButton.name);
- this.okButton.scale -= 0.25f;
- this.okButton.scale = Math.Max(0.75f, this.okButton.scale);
- }
-
- if (!this.wizardSource)
- {
- }
-
-
- }
-
- public override void leftClickHeld(int x, int y)
- {
-
- }
-
- public override void releaseLeftClick(int x, int y)
- {
-
- }
-
- public override void receiveRightClick(int x, int y, bool playSound = true)
- {
- }
-
- public override void receiveKeyPress(Keys key)
- {
-
- }
-
- public override void performHoverAction(int x, int y)
- {
-
-
- if (!this.wizardSource)
- {
-
- using (List.Enumerator enumerator4 = this.seasonButtons.GetEnumerator())
- {
- while (enumerator4.MoveNext())
- {
- ClickableTextureComponent clickableTextureComponent4 = (ClickableTextureComponent)enumerator4.Current;
- if (clickableTextureComponent4.containsPoint(x, y))
- {
- clickableTextureComponent4.scale = Math.Min(clickableTextureComponent4.scale + 0.02f, clickableTextureComponent4.baseScale + 0.1f);
- }
- else
- {
- clickableTextureComponent4.scale = Math.Max(clickableTextureComponent4.scale - 0.02f, clickableTextureComponent4.baseScale);
- }
- }
- }
-
- using (List.Enumerator enumerator4 = this.seasonTitleButtons.GetEnumerator())
- {
- while (enumerator4.MoveNext())
- {
- ClickableTextureComponent clickableTextureComponent4 = (ClickableTextureComponent)enumerator4.Current;
- if (clickableTextureComponent4.containsPoint(x, y))
- {
- clickableTextureComponent4.scale = Math.Min(clickableTextureComponent4.scale + 0.02f, clickableTextureComponent4.baseScale + 0.1f);
- }
- else
- {
- clickableTextureComponent4.scale = Math.Max(clickableTextureComponent4.scale - 0.02f, clickableTextureComponent4.baseScale);
- }
- }
- }
- }
- if (this.okButton.containsPoint(x, y) && this.canLeaveMenu())
- {
- this.okButton.scale = Math.Min(this.okButton.scale + 0.02f, this.okButton.baseScale + 0.1f);
- }
- else
- {
- this.okButton.scale = Math.Max(this.okButton.scale - 0.02f, this.okButton.baseScale);
- }
-
- }
-
- public virtual bool canLeaveMenu()
- {
- return this.wizardSource || (Game1.player.name.Length > 0 && Game1.player.farmName.Length > 0 && Game1.player.favoriteThing.Length > 0);
- }
-
- public override void draw(SpriteBatch b)
- {
- Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true, (string)null, false);
- b.Draw(Game1.daybg, new Vector2((float)(this.xPositionOnScreen + Game1.tileSize + Game1.tileSize * 2 / 3 - 2), (float)(this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4)), Color.White);
- Game1.player.FarmerRenderer.draw(b, Game1.player.FarmerSprite.CurrentAnimationFrame, Game1.player.FarmerSprite.CurrentFrame, Game1.player.FarmerSprite.SourceRect, new Vector2((float)(this.xPositionOnScreen - 2 + Game1.tileSize * 2 / 3 + Game1.tileSize * 2 - Game1.tileSize / 2), (float)(this.yPositionOnScreen + IClickableMenu.borderWidth - Game1.tileSize / 4 + IClickableMenu.spaceToClearTopBorder + Game1.tileSize / 2)), Vector2.Zero, 0.8f, Color.White, 0.0f, 1f, Game1.player);
- if (!this.wizardSource)
- {
-
- if(HappyBirthday.Class1.player_birthday_season=="spring" || HappyBirthday.Class1.player_birthday_season == "summer" || HappyBirthday.Class1.player_birthday_season == "fall" || HappyBirthday.Class1.player_birthday_season == "winter"){
- foreach (ClickableTextureComponent textureComponent in this.seasonButtons)
- {
- textureComponent.draw(b);
- // b.Draw(Game1.mouseCursors, textureComponent.bounds, new Rectangle?(Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 34, -1, -1)), Color.White);
- }
- }
- foreach (ClickableTextureComponent textureComponent in this.seasonTitleButtons)
- {
- textureComponent.draw(b);
- // b.Draw(Game1.mouseCursors, textureComponent.bounds, new Rectangle?(Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 34, -1, -1)), Color.White);
- }
- foreach (ClickableComponent clickableComponent in this.labels)
- {
- Color color = Color.Violet;
- Utility.drawTextWithShadow(b, clickableComponent.name, Game1.smallFont, new Vector2((float)clickableComponent.bounds.X, (float)clickableComponent.bounds.Y), color, 1f, -1f, -1, -1, 1f, 3);
- // b.Draw(Game1.mouseCursors, textureComponent.bounds, new Rectangle?(Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 34, -1, -1)), Color.White);
- }
-
- }
- foreach (ClickableComponent clickableComponent in this.labels)
- {
- string text = "";
- Color color = Game1.textColor;
- switch (clickableComponent.name.Substring(0, 4))
- {
- case "Name":
- color = Game1.player.name.Length < 1 ? Color.Red : Game1.textColor;
- if (!this.wizardSource)
- break;
- continue;
- case "Farm":
- color = Game1.player.farmName.Length < 1 ? Color.Red : Game1.textColor;
- if (!this.wizardSource)
- break;
- continue;
- case "Favo":
- color = Game1.player.favoriteThing.Length < 1 ? Color.Red : Game1.textColor;
- if (!this.wizardSource)
- break;
- continue;
- case "Shir":
- text = string.Concat((object)(Game1.player.shirt + 1));
- break;
- case "Skin":
- text = string.Concat((object)(Game1.player.skin + 1));
- break;
- case "Hair":
- if (!clickableComponent.name.Contains("Color"))
- {
- text = string.Concat((object)(Game1.player.hair + 1));
- break;
- }
- break;
- case "Acc.":
- text = string.Concat((object)(Game1.player.accessory + 2));
- break;
- default:
- color = Game1.textColor;
- break;
- }
- Utility.drawTextWithShadow(b, clickableComponent.name, Game1.smallFont, new Vector2((float)clickableComponent.bounds.X, (float)clickableComponent.bounds.Y), color, 1f, -1f, -1, -1, 1f, 3);
- if (Enumerable.Count((IEnumerable)text) > 0)
- Utility.drawTextWithShadow(b, text, Game1.smallFont, new Vector2((float)(clickableComponent.bounds.X + Game1.tileSize / 3) - Game1.smallFont.MeasureString(text).X / 2f, (float)(clickableComponent.bounds.Y + Game1.tileSize / 2)), color, 1f, -1f, -1, -1, 1f, 3);
- }
-
- if (this.canLeaveMenu())
- {
- if(HappyBirthday.Class1.player_birthday_date!=0 && HappyBirthday.Class1.player_birthday_season!="") this.okButton.draw(b);
- }
- else
- {
- this.okButton.draw(b);
- this.okButton.draw(b, Color.Black * 0.5f, 0.97f);
- }
- if (!this.wizardSource)
- {
-
- if (this.skipIntroButton != null)
- {
-
- }
-
- }
- this.drawMouse(b);
- }
- }
-}
diff --git a/GeneralMods/HappyBirthday/Class1.cs b/GeneralMods/HappyBirthday/Class1.cs
deleted file mode 100644
index a39b6430..00000000
--- a/GeneralMods/HappyBirthday/Class1.cs
+++ /dev/null
@@ -1,929 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Omegasis.HappyBirthday.PatchedUtilities;
-using StardewModdingAPI;
-using StardewValley;
-
-namespace Omegasis.HappyBirthday
-{
- public class Class1 :Mod
- {
- public List npc_name_list;
- bool game_loaded;
- public string key_binding= "O";
- public List- possible_birthday_gifts;
- public Item birthday_gift_to_receive;
- bool once;
- bool has_input_birthday;
-
- public static IMonitor thisMonitor;
-
- Dictionary popedDialogue;
-
- bool seenEvent;
-
- public string folder_name ="Player_Birthdays";
- public string birthdays_path;
-
- public static int player_birthday_date;
- public static string player_birthday_season;
- public override void Entry(IModHelper helper)
- {
- StardewModdingAPI.Events.TimeEvents.DayOfMonthChanged += Day_Update;
- StardewModdingAPI.Events.TimeEvents.DayOfMonthChanged += TimeEvents_DayOfMonthChanged;
- StardewModdingAPI.Events.GameEvents.UpdateTick += GameEvents_UpdateTick;
- StardewModdingAPI.Events.SaveEvents.AfterLoad += PlayerEvents_LoadedGame;
-
- StardewModdingAPI.Events.ControlEvents.KeyPressed += ControlEvents_KeyPressed;
- npc_name_list = new List();
- possible_birthday_gifts = new List
- ();
- birthdays_path = Path.Combine(Helper.DirectoryPath, folder_name);
- if (!Directory.Exists(birthdays_path))
- {
- Directory.CreateDirectory(birthdays_path);
- }
- thisMonitor = Monitor;
- }
-
- public void TimeEvents_DayOfMonthChanged(object sender, StardewModdingAPI.Events.EventArgsIntChanged e)
- {
- if (isplayersbirthday() == true)
- {
- }
- if (Game1.player == null) return;
- if (has_input_birthday == true) MyWritter_Birthday();
- MyWritter_Settings();
- once = false;
- }
-
- public void ControlEvents_KeyPressed(object sender, StardewModdingAPI.Events.EventArgsKeyPressed e)
- {
- if (Game1.player == null) return;
- if (Game1.player.currentLocation == null) return;
- if (game_loaded == false) return;
- if (has_input_birthday == true) return;
- if (e.KeyPressed.ToString() == key_binding) //if the key is pressed, load my cusom save function
- {
- if (Game1.activeClickableMenu != null) return;
- Game1.activeClickableMenu = new Birthday_Menu();
- }
- //DataLoader_Settings(); //update the key if players changed it while playing.
- }
-
- public void PlayerEvents_LoadedGame(object sender, EventArgs e)
- {
- game_loaded = true;
- DataLoader_Birthday();
- DataLoader_Settings();
- seenEvent = false;
- popedDialogue = new Dictionary();
- }
-
- public void GameEvents_UpdateTick(object sender, EventArgs e)
- {
- if (Game1.eventUp == true) return;
- if (Game1.isFestival() == true) return;
- if (Game1.player == null) return;
- if (game_loaded == false) return;
- if (Game1.player.isMoving()==true && once == false)
-
- {
- //Log.AsyncM("Is it my birthday? "+isplayersbirthday());
- if (isplayersbirthday() == true)
- {
- OmegasisUtility.Messages.showStarMessage("It's your birthday today! Happy birthday!");
- // Game1.addMailForTomorrow("birthdayMom", false, false);
- // Game1.addMailForTomorrow("birthdayDad", false, false);
- // Game1.mailbox.Enqueue("\n Dear @,^ Happy birthday sweetheart. It's been amazing watching you grow into the kind, hard working person that I've always dreamed that you would become. I hope you continue to make many more fond memories with the ones you love. ^ Love, Mom ^ P.S. Here's a little something that I made for you. %item object 221 1 %");
- // Game1.mailbox.Enqueue("\n Dear @,^ Happy birthday kiddo. It's been a little quiet around here on your birthday since you aren't around, but your mother and I know that you are making both your grandpa and us proud. We both know that living on your own can be tough but we believe in you one hundred percent, just keep following your dreams.^ Love, Dad ^ P.S. Here's some spending money to help you out on the farm. Good luck! %item money 5000 5001 %");
- Game1.mailbox.Enqueue("birthdayMom");
- Game1.mailbox.Enqueue("birthdayDad");
-
- try
- {
- updateNPCList();
- }
- catch(Exception eee)
- {
- thisMonitor.Log(eee.ToString(), LogLevel.Error);
- }
- foreach (var location in Game1.locations)
- {
- // Log.AsyncC(location.name);
- foreach (NPC npc in location.characters)
- {
- // Log.AsyncC(npc.name);
- try
- {
- if (npc is StardewValley.Characters.Cat || npc is StardewValley.Characters.Child || npc is StardewValley.Characters.Dog || npc is StardewValley.Characters.Horse || npc is StardewValley.Characters.Junimo || npc is StardewValley.Characters.Pet) continue;
- if (npc is StardewValley.Monsters.Bat || npc is StardewValley.Monsters.BigSlime || npc is StardewValley.Monsters.Bug || npc is StardewValley.Monsters.Cat || npc is StardewValley.Monsters.Crow || npc is StardewValley.Monsters.Duggy || npc is StardewValley.Monsters.DustSpirit || npc is StardewValley.Monsters.Fireball || npc is StardewValley.Monsters.Fly || npc is StardewValley.Monsters.Ghost || npc is StardewValley.Monsters.GoblinPeasant || npc is StardewValley.Monsters.GoblinWizard || npc is StardewValley.Monsters.GreenSlime || npc is StardewValley.Monsters.Grub || npc is StardewValley.Monsters.LavaCrab || npc is StardewValley.Monsters.MetalHead || npc is StardewValley.Monsters.Monster || npc is StardewValley.Monsters.Mummy || npc is StardewValley.Monsters.RockCrab || npc is StardewValley.Monsters.RockGolem || npc is StardewValley.Monsters.Serpent || npc is StardewValley.Monsters.ShadowBrute || npc is StardewValley.Monsters.ShadowGirl || npc is StardewValley.Monsters.ShadowGuy || npc is StardewValley.Monsters.ShadowShaman || npc is StardewValley.Monsters.Skeleton || npc is StardewValley.Monsters.SkeletonMage || npc is StardewValley.Monsters.SkeletonWarrior || npc is StardewValley.Monsters.Spiker || npc is StardewValley.Monsters.SquidKid) continue;
- Dialogue d =new Dialogue(Game1.content.Load>("Data\\FarmerBirthdayDialogue")[npc.name], npc);
- npc.CurrentDialogue.Push(d);
- if (npc.CurrentDialogue.ElementAt(0) != d) npc.setNewDialogue(Game1.content.Load>("Data\\FarmerBirthdayDialogue")[npc.name]);
- }
- // npc.setNewDialogue(Game1.content.Load>("Data\\FarmerBirthdayDialogue")[npc.name], true, false);
- catch
- {
- if (npc is StardewValley.Characters.Cat || npc is StardewValley.Characters.Child || npc is StardewValley.Characters.Dog || npc is StardewValley.Characters.Horse || npc is StardewValley.Characters.Junimo || npc is StardewValley.Characters.Pet) continue;
- if (npc is StardewValley.Monsters.Bat || npc is StardewValley.Monsters.BigSlime || npc is StardewValley.Monsters.Bug || npc is StardewValley.Monsters.Cat || npc is StardewValley.Monsters.Crow || npc is StardewValley.Monsters.Duggy || npc is StardewValley.Monsters.DustSpirit || npc is StardewValley.Monsters.Fireball || npc is StardewValley.Monsters.Fly || npc is StardewValley.Monsters.Ghost || npc is StardewValley.Monsters.GoblinPeasant || npc is StardewValley.Monsters.GoblinWizard || npc is StardewValley.Monsters.GreenSlime || npc is StardewValley.Monsters.Grub || npc is StardewValley.Monsters.LavaCrab || npc is StardewValley.Monsters.MetalHead || npc is StardewValley.Monsters.Monster || npc is StardewValley.Monsters.Mummy || npc is StardewValley.Monsters.RockCrab || npc is StardewValley.Monsters.RockGolem || npc is StardewValley.Monsters.Serpent || npc is StardewValley.Monsters.ShadowBrute || npc is StardewValley.Monsters.ShadowGirl || npc is StardewValley.Monsters.ShadowGuy || npc is StardewValley.Monsters.ShadowShaman || npc is StardewValley.Monsters.Skeleton || npc is StardewValley.Monsters.SkeletonMage || npc is StardewValley.Monsters.SkeletonWarrior || npc is StardewValley.Monsters.Spiker || npc is StardewValley.Monsters.SquidKid) continue;
- // npc.setNewDialogue("Happy birthday @!", true, false);
- Dialogue d = new Dialogue("Happy Birthday @!", npc);
- npc.CurrentDialogue.Push(d);
- if (npc.CurrentDialogue.ElementAt(0) != d) npc.setNewDialogue("Happy Birthday @!");
- }
- }
- }
- //end birthday check
- }
- once = true;
- if (player_birthday_season == "" || player_birthday_season == null || player_birthday_date == 0)
- {
- Game1.activeClickableMenu = new Birthday_Menu();
- once = false;
- }
- }
-
- if (Game1.eventUp == true)
- {
- foreach(string npcName in npc_name_list)
- {
- NPC npc = Game1.getCharacterFromName(npcName);
-
- try {
- popedDialogue.Add(npcName, npc.CurrentDialogue.Pop());
- }
- catch (Exception err)
- {
- thisMonitor.Log(err.ToString(), LogLevel.Error);
- popedDialogue.Add(npcName, npc.CurrentDialogue.ElementAt(0));
- npc.loadSeasonalDialogue();
- }
-
- seenEvent = true;
- }
- }
-
- if (Game1.eventUp == false && seenEvent == true)
- {
- foreach (KeyValuePair v in popedDialogue)
- {
- NPC npc = Game1.getCharacterFromName(v.Key);
- npc.CurrentDialogue.Push(v.Value);
- }
- popedDialogue.Clear();
- seenEvent = false;
- }
- if (Game1.currentSpeaker != null)
- {
- if (isplayersbirthday()==true)
- {
-
- // Log.AsyncC("ITS MY BIRTDHAY");
- try
- {
- //Game1.currentSpeaker.setNewDialogue(Game1.content.Load>("Data\\FarmerBirthdayDialogue")[Game1.currentSpeaker.name], true, false);
- foreach (var ehh in npc_name_list)
- {
- if (ehh == Game1.currentSpeaker.name)
- {
- try
- {
- birthday_gift();
- // Log.AsyncG("GOT THE GIFT");
- npc_name_list.Remove(Game1.currentSpeaker.name);
- }
- catch(Exception r)
- {
- thisMonitor.Log(r.ToString(), LogLevel.Error);
- }
-
- }
- }
- }
- catch
- {
- // Game1.currentSpeaker.setNewDialogue("Happy birthday @!", true, false);
- foreach (var ehh in npc_name_list)
- {
- if (ehh == Game1.currentSpeaker.name)
- {
- birthday_gift();
- npc_name_list.Remove(Game1.currentSpeaker.name);
- }
- }
- }
- }
- }
-
- if (birthday_gift_to_receive != null && Game1.currentSpeaker==null)
- {
- while (birthday_gift_to_receive.Name=="Error Item"|| birthday_gift_to_receive.Name=="Rock"|| birthday_gift_to_receive.Name == "???")
- {
- birthday_gift();
- }
- Game1.player.addItemByMenuIfNecessaryElseHoldUp(birthday_gift_to_receive);
- birthday_gift_to_receive = null;
- }
-
- if (player_birthday_season != "" && player_birthday_season != null && player_birthday_date != 0)
- {
- if (has_input_birthday == false)
- {
- MyWritter_Settings();
- MyWritter_Birthday();
- has_input_birthday = true;
- }
- }
- }
-
- public void Day_Update(object sender, StardewModdingAPI.Events.EventArgsIntChanged e)
- {
- // Log.AsyncC("is this running?");
- // foreach (var bleh in npc_name_list) npc_name_list.Remove(bleh);
-
- }
-
-
- public void updateNPCList()
-
- {
- //Log.AsyncO("Step 1");
- npc_name_list.Clear();
-
- foreach (var location in Game1.locations)
- {
- // Log.AsyncO("Step 2" + location.name);
- foreach (var npc in location.characters)
- {
- // Log.AsyncO("Step 3 " + npc.name);
- if (npc is StardewValley.Characters.Cat || npc is StardewValley.Characters.Child || npc is StardewValley.Characters.Dog || npc is StardewValley.Characters.Horse || npc is StardewValley.Characters.Junimo || npc is StardewValley.Characters.Pet) continue;
- if (npc is StardewValley.Monsters.Bat || npc is StardewValley.Monsters.BigSlime || npc is StardewValley.Monsters.Bug || npc is StardewValley.Monsters.Cat || npc is StardewValley.Monsters.Crow || npc is StardewValley.Monsters.Duggy || npc is StardewValley.Monsters.DustSpirit || npc is StardewValley.Monsters.Fireball || npc is StardewValley.Monsters.Fly || npc is StardewValley.Monsters.Ghost || npc is StardewValley.Monsters.GoblinPeasant || npc is StardewValley.Monsters.GoblinWizard || npc is StardewValley.Monsters.GreenSlime || npc is StardewValley.Monsters.Grub || npc is StardewValley.Monsters.LavaCrab || npc is StardewValley.Monsters.MetalHead || npc is StardewValley.Monsters.Monster || npc is StardewValley.Monsters.Mummy || npc is StardewValley.Monsters.RockCrab || npc is StardewValley.Monsters.RockGolem || npc is StardewValley.Monsters.Serpent || npc is StardewValley.Monsters.ShadowBrute || npc is StardewValley.Monsters.ShadowGirl || npc is StardewValley.Monsters.ShadowGuy || npc is StardewValley.Monsters.ShadowShaman || npc is StardewValley.Monsters.Skeleton || npc is StardewValley.Monsters.SkeletonMage || npc is StardewValley.Monsters.SkeletonWarrior || npc is StardewValley.Monsters.Spiker || npc is StardewValley.Monsters.SquidKid) continue;
- if (npc_name_list.Contains(npc.name))
- {
- continue;
- }
- npc_name_list.Add(npc.name);
- // Log.AsyncO("Added in " + npc.name);
- }
- //Log.AsyncM("NO SERIOUSLY");
- }
- }
-
- public virtual void birthday_gift()
- {
-
- //grab 0~3 hearts //Neutral
- //grab 4~6 //Good
- //grab 7~10 //Best
- Item farmers_birthday_gift;
- if (this.possible_birthday_gifts.Count > 0)
- {
- Random rnd = new Random();
- int r = rnd.Next(this.possible_birthday_gifts.Count);
- farmers_birthday_gift = this.possible_birthday_gifts.ElementAt(r);
- if (Game1.player.isInventoryFull() == true)
- {
- Game1.createItemDebris(farmers_birthday_gift, Game1.player.getStandingPosition(), Game1.player.getDirection());
- }
- else {
- birthday_gift_to_receive = farmers_birthday_gift;
- }
- return;
- }
-
- this.get_default_birthday_gifts();
-
- Random rnd2 = new Random();
- int r2 = rnd2.Next(this.possible_birthday_gifts.Count);
- farmers_birthday_gift = this.possible_birthday_gifts.ElementAt(r2);
- if (Game1.player.isInventoryFull() == true)
- {
- Game1.createItemDebris(farmers_birthday_gift, Game1.player.getStandingPosition(), Game1.player.getDirection());
- }
- else {
- birthday_gift_to_receive = farmers_birthday_gift;
- //Game1.player.addItemByMenuIfNecessaryElseHoldUp(farmers_birthday_gift);
- }
- this.possible_birthday_gifts.Clear();
- // Log.AsyncO("IS THIS EVER WORKING????");
- return;
- }
-
- public virtual void get_default_birthday_gifts()
- {
- Dictionary dictionary = null;
- try
- {
- dictionary = Game1.content.Load>("Data\\PossibleBirthdayGifts");
-
-
- string text;
- dictionary.TryGetValue(Game1.currentSpeaker.name, out text);
- if (text != null)
- {
- string[] array = text.Split(new char[]
- {
- '/'
- });
- //love
- if (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) >= 7)
- {
-
- string[] array2 = array[1].Split(new char[]
- {
- ' '
- });
- for (int i = 0; i < array2.Count(); i += 2)
- {
- try
- {
- if (Convert.ToInt32(array2[i]) > 0) this.possible_birthday_gifts.Add((Item)new StardewValley.Object(Convert.ToInt32(array2[i]), Convert.ToInt32(array2[i + 1]), false, -1, 0));
- else
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array2[i]));
- foreach (var obj in some_object_list)
- {
- StardewValley.Object new_obj = new StardewValley.Object(obj.parentSheetIndex, Convert.ToInt32(array2[i + 1]), false, -1, 0);
- this.possible_birthday_gifts.Add((Item)new_obj);
- }
- }
- // this.itemsRequired.Add(Convert.ToInt32(array2[i]), Convert.ToInt32(array2[i + 1]));
- }
- catch
- {
-
- }
- }
- }
- //Like
- if (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) >= 4 && Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) <= 6)
- {
-
- string[] array3 = array[3].Split(new char[]
- {
- ' '
- });
- for (int i = 0; i < array3.Count(); i += 2)
- {
- try
- {
-
-
- if (Convert.ToInt32(array3[i]) > 0) this.possible_birthday_gifts.Add((Item)new StardewValley.Object(Convert.ToInt32(array3[i]), Convert.ToInt32(array3[i + 1]), false, -1, 0));
- else
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array3[i]));
- foreach (var obj in some_object_list)
- {
- StardewValley.Object new_obj = new StardewValley.Object(obj.parentSheetIndex, Convert.ToInt32(array3[i + 1]), false, -1, 0);
- this.possible_birthday_gifts.Add((Item)new_obj);
- }
- }
- // this.itemsRequired.Add(Convert.ToInt32(array2[i]), Convert.ToInt32(array2[i + 1]));
- }
- catch
- {
-
- }
- }
- }
- //Neutral
- if (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) >= 0 && Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) <= 3)
- {
-
- string[] array4 = array[5].Split(new char[]
- {
- ' '
- });
-
- for (int i = 0; i < array4.Count(); i += 2)
- {
- try
- {
- if (Convert.ToInt32(array4[i]) > 0) this.possible_birthday_gifts.Add((Item)new StardewValley.Object(Convert.ToInt32(array4[i]), Convert.ToInt32(array4[i + 1]), false, -1, 0));
- else
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array4[i]));
- foreach (var obj in some_object_list)
- {
- StardewValley.Object new_obj = new StardewValley.Object(obj.parentSheetIndex, Convert.ToInt32(array4[i + 1]), false, -1, 0);
- this.possible_birthday_gifts.Add((Item)new_obj);
- }
- }
- // this.itemsRequired.Add(Convert.ToInt32(array2[i]), Convert.ToInt32(array2[i + 1]));
- }
- catch
- {
-
- }
- }
- }
- } //text !=null
- //grabs from //Data//PossibleBirthdayGifts
- if (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) >= 7) getAllUniversalLovedItems(true);
- if (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) >= 4 && Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) <= 6) getAllUniversalLikedItems(true);
- if (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) >= 0 && Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) <= 3) getAllUniversalNeutralItems(true);
- return;
-
-
- }
- catch
- {
- //grabs from NPCGiftTastes
- if (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) >= 7)
- {
- getAllUniversalLovedItems(false);
- getAllSpecifiedLovedItems();
- }
- if (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) >= 4 && Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) <= 6)
- {
- getAllSpecifiedLikedItems();
- getAllUniversalLikedItems(false);
- }
- if (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) >= 0 && Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.name) <= 3)
- {
- getAllUniversalNeutralItems(false);
- }
- return;
- }
-
-
- //TODO: Make different tiers of gifts depending on the friendship, and if it is the spouse.
- /*
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(198, 1));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(204, 1));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(220, 1));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(221, 1));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(223, 1));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(233, 1));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(234, 1));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(286, 5));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(368, 5));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(608, 1));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(612, 1));
- this.possible_birthday_gifts.Add((Item)new SytardewValley.Object(773, 1));
- */
-
- }
- public virtual void getAllUniversalNeutralItems(bool is_birthday_gift_list)
- {
- string text;
- if (is_birthday_gift_list == false)
- {
- Game1.NPCGiftTastes.TryGetValue("Universal_Neutral", out text);
- if (text != null)
- {
-
- string[] array = text.Split(new char[]
- {
- ' '
- });
-
-
- for (int i = 0; i < array.Count(); i++)
- {
- int parentSheetIndex = Convert.ToInt32(array[i]);
- if (parentSheetIndex < 0)
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array[i]));
- foreach (var obj in some_object_list)
- {
- this.possible_birthday_gifts.Add((Item)obj);
- }
- continue;
- }
- else
- {
- this.possible_birthday_gifts.Add((Item)new StardewValley.Object(parentSheetIndex, 1, false, -1, 0));
- }
- //this.itemsRequired.Add(Convert.ToInt32(array[i]), Convert.ToInt32(array[i + 1]));
- }
-
-
- return;// new SytardewValley.Object(parentSheetIndex, 1, false, -1, 0);
- }
- }
- else
- {
- Dictionary dictionary = Game1.content.Load>("Data\\PossibleBirthdayGifts");
- string text2;
- dictionary.TryGetValue("Universal_Neutral_Gift", out text2);
- string[] array = text2.Split(new char[]
- {
- ' '
- });
-
-
- for (int i = 0; i < array.Count(); i += 2)
- {
- int parentSheetIndex = Convert.ToInt32(array[i]);
- if (parentSheetIndex < 0)
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array[i]));
- foreach (var obj in some_object_list)
- {
- StardewValley.Object new_obj = new StardewValley.Object(obj.parentSheetIndex, Convert.ToInt32(array[i + 1]), false, -1, 0);
- this.possible_birthday_gifts.Add((Item)new_obj);
- }
- continue;
- }
- else
- {
- this.possible_birthday_gifts.Add((Item)new StardewValley.Object(parentSheetIndex, Convert.ToInt32(array[i + 1]), false, -1, 0));
- }
- //this.itemsRequired.Add(Convert.ToInt32(array[i]), Convert.ToInt32(array[i + 1]));
- }
-
-
- return;// new StardewValley.Object(parentSheetIndex, 1, false, -1, 0);
- }
- return;// null;
- }
- public virtual void getAllUniversalLikedItems(bool is_birthday_gift_list)
- {
- string text;
- if (is_birthday_gift_list == false)
- {
- Game1.NPCGiftTastes.TryGetValue("Universal_Like", out text);
- if (text != null)
- {
-
- string[] array = text.Split(new char[]
- {
- ' '
- });
-
-
- for (int i = 0; i < array.Count(); i++)
- {
- int parentSheetIndex = Convert.ToInt32(array[i]);
- if (parentSheetIndex < 0)
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array[i]));
- foreach (var obj in some_object_list)
- {
- this.possible_birthday_gifts.Add((Item)obj);
- }
- continue;
- }
- else
- {
- this.possible_birthday_gifts.Add((Item)new StardewValley.Object(parentSheetIndex, 1, false, -1, 0));
- }
- //this.itemsRequired.Add(Convert.ToInt32(array[i]), Convert.ToInt32(array[i + 1]));
- }
-
-
- return;// new StardewValley.Object(parentSheetIndex, 1, false, -1, 0);
- }
- }
- else
- {
- Dictionary dictionary = Game1.content.Load>("Data\\PossibleBirthdayGifts");
- string text2;
- dictionary.TryGetValue("Universal_Like_Gift", out text2);
- string[] array = text2.Split(new char[]
- {
- ' '
- });
-
-
- for (int i = 0; i < array.Count(); i += 2)
- {
- int parentSheetIndex = Convert.ToInt32(array[i]);
- if (parentSheetIndex < 0)
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array[i]));
- foreach (var obj in some_object_list)
- {
- StardewValley.Object new_obj = new StardewValley.Object(obj.parentSheetIndex, Convert.ToInt32(array[i + 1]), false, -1, 0);
- this.possible_birthday_gifts.Add((Item)new_obj);
- }
- continue;
- }
- else
- {
- this.possible_birthday_gifts.Add((Item)new StardewValley.Object(parentSheetIndex, Convert.ToInt32(array[i + 1]), false, -1, 0));
- }
- //this.itemsRequired.Add(Convert.ToInt32(array[i]), Convert.ToInt32(array[i + 1]));
- }
-
-
- return;// new StardewValley.Object(parentSheetIndex, 1, false, -1, 0);
- }
- return;// null;
- }
- public virtual void getAllUniversalLovedItems(bool is_birthday_gift_list)
- {
- string text;
- if (is_birthday_gift_list == false)
- {
- Game1.NPCGiftTastes.TryGetValue("Universal_Neutral", out text);
- if (text != null)
- {
-
- string[] array = text.Split(new char[]
- {
- ' '
- });
-
-
- for (int i = 0; i < array.Count(); i++)
- {
- int parentSheetIndex = Convert.ToInt32(array[i]);
- if (parentSheetIndex < 0)
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array[i]));
- foreach (var obj in some_object_list)
- {
- this.possible_birthday_gifts.Add((Item)obj);
- }
- continue;
- }
- else
- {
- this.possible_birthday_gifts.Add((Item)new StardewValley.Object(parentSheetIndex, 1, false, -1, 0));
- }
- //this.itemsRequired.Add(Convert.ToInt32(array[i]), Convert.ToInt32(array[i + 1]));
- }
-
-
- return;// new StardewValley.Object(parentSheetIndex, 1, false, -1, 0);
- }
- }
- else
- {
- Dictionary dictionary = Game1.content.Load>("Data\\PossibleBirthdayGifts");
- string text2;
- dictionary.TryGetValue("Universal_Love_Gift", out text2);
- string[] array = text2.Split(new char[]
- {
- ' '
- });
-
-
- for (int i = 0; i < array.Count(); i += 2)
- {
- int parentSheetIndex = Convert.ToInt32(array[i]);
- if (parentSheetIndex < 0)
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array[i]));
- foreach (var obj in some_object_list)
- {
- StardewValley.Object new_obj = new StardewValley.Object(obj.parentSheetIndex, Convert.ToInt32(array[i + 1]), false, -1, 0);
- this.possible_birthday_gifts.Add((Item)new_obj);
- }
- continue;
- }
- else
- {
- this.possible_birthday_gifts.Add((Item)new StardewValley.Object(parentSheetIndex, Convert.ToInt32(array[i + 1]), false, -1, 0));
- }
- //this.itemsRequired.Add(Convert.ToInt32(array[i]), Convert.ToInt32(array[i + 1]));
- }
-
-
- return;// new StardewValley.Object(parentSheetIndex, 1, false, -1, 0);
- }
- return;// null;
- }
-
-
- public virtual void getAllSpecifiedLikedItems()
- {
- string text;
- Game1.NPCGiftTastes.TryGetValue(Game1.currentSpeaker.name, out text);
- if (text != null)
- {
-
- string[] array = text.Split(new char[]
- {
- '/'
- });
-
- string[] array2 = array[3].Split(new char[]
- {
- ' '
- });
-
- for (int i = 0; i < array2.Count(); i++)
- {
- int parentSheetIndex = Convert.ToInt32(array2[i]);
- if (parentSheetIndex < 0)
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array2[i]));
- foreach (var obj in some_object_list)
- {
- this.possible_birthday_gifts.Add((Item)obj);
- }
- continue;
- }
- else
- {
- this.possible_birthday_gifts.Add((Item)new StardewValley.Object(parentSheetIndex, 1, false, -1, 0));
- }
- //this.itemsRequired.Add(Convert.ToInt32(array[i]), Convert.ToInt32(array[i + 1]));
- }
-
-
- return;// new Object(parentSheetIndex, 1, false, -1, 0);
- }
- return;// null;
- }
- public virtual void getAllSpecifiedLovedItems()
- {
- string text;
- Game1.NPCGiftTastes.TryGetValue(Game1.currentSpeaker.name, out text);
- if (text != null)
- {
-
- string[] array = text.Split(new char[]
- {
- '/'
- });
-
- string[] array2 = array[1].Split(new char[]
- {
- ' '
- });
-
- for (int i = 0; i < array2.Count(); i++)
- {
- int parentSheetIndex = Convert.ToInt32(array2[i]);
- if (parentSheetIndex < 0)
- {
- List some_object_list = ObjectUtility.getAllObjectsAssociatedWithCategory(Convert.ToInt32(array2[i]));
- foreach (var obj in some_object_list)
- {
- this.possible_birthday_gifts.Add((Item)obj);
- }
- continue;
- }
- else
- {
- this.possible_birthday_gifts.Add((Item)new StardewValley.Object(parentSheetIndex, 1, false, -1, 0));
- }
- //this.itemsRequired.Add(Convert.ToInt32(array[i]), Convert.ToInt32(array[i + 1]));
- }
-
-
- return;// new StardewValley.Object(parentSheetIndex, 1, false, -1, 0);
- }
- return;// null;
- }
-
- public virtual bool isplayersbirthday()
- {
- if (player_birthday_date.Equals(Game1.dayOfMonth) && player_birthday_season.Equals(Game1.currentSeason)) return true;
- else return false;
- }
-
- void DataLoader_Settings()
- {
- //loads the data to the variables upon loading the game.
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(Helper.DirectoryPath, "HappyBirthday_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 = "O";
- // Monitor.Log("KEY TIME");
- }
-
- else
- {
- // Console.WriteLine("HEY THERE IM LOADING DATA");
- string[] readtext = File.ReadAllLines(mylocation3);
- key_binding = Convert.ToString(readtext[3]);
-
-
- // Monitor.Log(key_binding);
- // Monitor.Log(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(Helper.DirectoryPath, "HappyBirthday_Config");
- string mylocation2 = mylocation;
- string mylocation3 = mylocation2 + ".txt";
-
- string[] mystring3 = new string[20];
- if (!File.Exists(mylocation3))
- {
- Monitor.Log("HappyBirthday: The HappyBirthday Config doesn't exist. Creating it now.");
-
- mystring3[0] = "Config: HappyBirthday Info. Feel free to mess with these settings.";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Key binding for opening the birthday menu. Press this key to do so.";
- 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: HappyBirthday Info. Feel free to mess with these settings.";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Key binding for opening the birthday menu. Press this key to do so.";
- mystring3[3] = key_binding.ToString();
-
- File.WriteAllLines(mylocation3, mystring3);
- }
- }
-
-
-
- void DataLoader_Birthday()
- {
- //loads the data to the variables upon loading the game.
- string myname = StardewValley.Game1.player.name;
- string mylocation = Path.Combine(birthdays_path, "HappyBirthday_");
- string mylocation2 = mylocation+myname;
- 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.");
-
-
- // Monitor.Log("KEY TIME");
- }
-
- else
- {
- // Console.WriteLine("HEY THERE IM LOADING DATA");
- string[] readtext = File.ReadAllLines(mylocation3);
- player_birthday_season = Convert.ToString(readtext[3]);
- player_birthday_date = Convert.ToInt32(readtext[5]);
-
- // Monitor.Log(key_binding);
- // Monitor.Log(Convert.ToString(readtext[3]));
-
- }
- }
-
- void MyWritter_Birthday()
- {
-
- //write all of my info to a text file.
- string myname = StardewValley.Game1.player.name;
-
- string mylocation = Path.Combine(birthdays_path, "HappyBirthday_");
- string mylocation2 = mylocation + myname;
- string mylocation3 = mylocation2 + ".txt";
-
- string[] mystring3 = new string[20];
- if (!File.Exists(mylocation3))
- {
- Monitor.Log("HappyBirthday: The HappyBirthday Player Info doesn't exist. Creating it now.");
-
- mystring3[0] = "Player Info: Modifying these values could be considered cheating or an exploit. Edit at your own risk.";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Player's Birthday Season";
- mystring3[3] = player_birthday_season;
- mystring3[4] = "Player's Birthday Date";
- mystring3[5] = player_birthday_date.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] = "Player Info: Modifying these values could be considered cheating or an exploit. Edit at your own risk.";
- mystring3[1] = "====================================================================================";
-
- mystring3[2] = "Player's Birthday Season";
- mystring3[3] = player_birthday_season.ToString();
- mystring3[4] = "Player's Birthday Date";
- mystring3[5] = player_birthday_date.ToString();
-
- File.WriteAllLines(mylocation3, mystring3);
- }
- }
-
-
- }
-}
diff --git a/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs b/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs
new file mode 100644
index 00000000..909a403c
--- /dev/null
+++ b/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs
@@ -0,0 +1,279 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using StardewValley;
+using StardewValley.Menus;
+
+namespace Omegasis.HappyBirthday.Framework
+{
+ /// The menu which lets the player choose their birthday.
+ internal class BirthdayMenu : IClickableMenu
+ {
+ /*********
+ ** Properties
+ *********/
+ /// The labels to draw.
+ private readonly List Labels = new List();
+
+ /// The season buttons to draw.
+ private readonly List SeasonButtons = new List();
+
+ /// The day buttons to draw.
+ private readonly List DayButtons = new List();
+
+ /// The OK button to draw.
+ private ClickableTextureComponent OkButton;
+
+ /// The player's current birthday season.
+ private string BirthdaySeason;
+
+ /// The player's current birthday day.
+ private int BirthdayDay;
+
+ /// The callback to invoke when the birthday value changes.
+ private readonly Action OnChanged;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// Construct an instance.
+ /// The initial birthday season.
+ /// The initial birthday day.
+ /// The callback to invoke when the birthday value changes.
+ public BirthdayMenu(string season, int day, Action onChanged)
+ : base(Game1.viewport.Width / 2 - (632 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2 - Game1.tileSize, 632 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2 + Game1.tileSize)
+ {
+ this.BirthdaySeason = season;
+ this.BirthdayDay = day;
+ this.OnChanged = onChanged;
+ this.SetUpPositions();
+ }
+
+ /// The method called when the game window changes size.
+ /// The former viewport.
+ /// The new viewport.
+ public override void gameWindowSizeChanged(Rectangle oldBounds, Rectangle newBounds)
+ {
+ base.gameWindowSizeChanged(oldBounds, newBounds);
+ this.xPositionOnScreen = Game1.viewport.Width / 2 - (632 + IClickableMenu.borderWidth * 2) / 2;
+ this.yPositionOnScreen = Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2 - Game1.tileSize;
+ this.SetUpPositions();
+ }
+
+
+ /*********
+ ** Private methods
+ *********/
+ /// Regenerate the UI.
+ private void SetUpPositions()
+ {
+ this.Labels.Clear();
+ this.DayButtons.Clear();
+ this.OkButton = new ClickableTextureComponent("OK", new Rectangle(this.xPositionOnScreen + this.width - IClickableMenu.borderWidth - IClickableMenu.spaceToClearSideBorder - Game1.tileSize, this.yPositionOnScreen + this.height - IClickableMenu.borderWidth - IClickableMenu.spaceToClearTopBorder + Game1.tileSize / 4, Game1.tileSize, Game1.tileSize), "", null, Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46), 1f);
+
+ this.Labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 8, 1, 1), "Birthday Season: " + this.BirthdaySeason));
+ this.Labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize, Game1.tileSize * 2, Game1.tileSize), "Birthday Date: " + this.BirthdayDay));
+ this.SeasonButtons.Add(new ClickableTextureComponent("Spring", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(188, 438, 32, 9), Game1.pixelZoom));
+ this.SeasonButtons.Add(new ClickableTextureComponent("Summer", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(220, 438, 32, 8), Game1.pixelZoom));
+ this.SeasonButtons.Add(new ClickableTextureComponent("Fall", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(188, 447, 32, 10), Game1.pixelZoom));
+ this.SeasonButtons.Add(new ClickableTextureComponent("Winter", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 7 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(220, 448, 32, 8), Game1.pixelZoom));
+
+
+ this.DayButtons.Add(new ClickableTextureComponent("1", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("2", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 2 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("3", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(24, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("4", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 4 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(32, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("5", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(40, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("6", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 6 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(48, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("7", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 7 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(56, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("8", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(64, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("9", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 2 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(72, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("10", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 2.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("10", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(0, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("11", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("11", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("12", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("12", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("13", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("13", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(24, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("14", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("14", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 7.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 5 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(32, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("15", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 0.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("15", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 1.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(40, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("16", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 1.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("16", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 2.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(48, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("17", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 2.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("17", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(56, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("18", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("18", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(64, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("19", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("19", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(72, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("20", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("20", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(0, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("21", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("21", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 7.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 6 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("22", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 0.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("22", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 1.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("23", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 1.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("23", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 2.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(24, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("24", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 2.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("24", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(32, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("25", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 3.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("25", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(40, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("26", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 4.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("26", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(48, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("27", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 5.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("27", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(56, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("28", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
+ this.DayButtons.Add(new ClickableTextureComponent("28", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 7.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load("LooseSprites\\font_bold"), new Rectangle(64, 16, 8, 12), Game1.pixelZoom));
+ }
+
+ /// Handle a button click.
+ /// The button name that was clicked.
+ private void HandleButtonClick(string name)
+ {
+ if (name == null)
+ return;
+
+ switch (name)
+ {
+ // season button
+ case "Spring":
+ case "Summer":
+ case "Fall":
+ case "Winter":
+ this.BirthdaySeason = name.ToLower();
+ this.OnChanged(this.BirthdaySeason, this.BirthdayDay);
+ Game1.activeClickableMenu = new BirthdayMenu(this.BirthdaySeason, this.BirthdayDay, this.OnChanged);
+ break;
+
+ // OK button
+ case "OK":
+ if (this.BirthdayDay >= 1 || this.BirthdayDay <= 28)
+ Game1.exitActiveMenu();
+ break;
+
+ default:
+ this.BirthdayDay = Convert.ToInt32(name);
+ this.OnChanged(this.BirthdaySeason, this.BirthdayDay);
+ Game1.activeClickableMenu = new BirthdayMenu(this.BirthdaySeason, this.BirthdayDay, this.OnChanged);
+ break;
+ }
+ Game1.playSound("coin");
+ }
+
+ /// The method invoked when the player left-clicks on the menu.
+ /// The X-position of the cursor.
+ /// The Y-position of the cursor.
+ /// Whether to enable sound.
+ public override void receiveLeftClick(int x, int y, bool playSound = true)
+ {
+ foreach (ClickableTextureComponent button in this.DayButtons)
+ {
+ if (button.containsPoint(x, y))
+ {
+ this.HandleButtonClick(button.name);
+ button.scale -= 0.5f;
+ button.scale = Math.Max(3.5f, button.scale);
+ }
+ }
+
+ foreach (ClickableTextureComponent button in this.SeasonButtons)
+ {
+ if (button.containsPoint(x, y))
+ {
+ this.HandleButtonClick(button.name);
+ button.scale -= 0.5f;
+ button.scale = Math.Max(3.5f, button.scale);
+ }
+ }
+
+ if (this.OkButton.containsPoint(x, y))
+ {
+ this.HandleButtonClick(this.OkButton.name);
+ this.OkButton.scale -= 0.25f;
+ this.OkButton.scale = Math.Max(0.75f, this.OkButton.scale);
+ }
+ }
+
+ /// The method invoked when the player right-clicks on the lookup UI.
+ /// The X-position of the cursor.
+ /// The Y-position of the cursor.
+ /// Whether to enable sound.
+ public override void receiveRightClick(int x, int y, bool playSound = true) { }
+
+ /// The method invoked when the player hovers the cursor over the menu.
+ /// The X-position of the cursor.
+ /// The Y-position of the cursor.
+ public override void performHoverAction(int x, int y)
+ {
+ foreach (ClickableTextureComponent button in this.DayButtons)
+ {
+ button.scale = button.containsPoint(x, y)
+ ? Math.Min(button.scale + 0.02f, button.baseScale + 0.1f)
+ : Math.Max(button.scale - 0.02f, button.baseScale);
+ }
+
+ foreach (ClickableTextureComponent button in this.SeasonButtons)
+ {
+ button.scale = button.containsPoint(x, y)
+ ? Math.Min(button.scale + 0.02f, button.baseScale + 0.1f)
+ : Math.Max(button.scale - 0.02f, button.baseScale);
+ }
+
+ this.OkButton.scale = this.OkButton.containsPoint(x, y)
+ ? Math.Min(this.OkButton.scale + 0.02f, this.OkButton.baseScale + 0.1f)
+ : Math.Max(this.OkButton.scale - 0.02f, this.OkButton.baseScale);
+
+ }
+
+ /// Draw the menu to the screen.
+ /// The sprite batch.
+ public override void draw(SpriteBatch b)
+ {
+ // draw menu box
+ Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true);
+ b.Draw(Game1.daybg, new Vector2((this.xPositionOnScreen + Game1.tileSize + Game1.tileSize * 2 / 3 - 2), (this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4)), Color.White);
+
+ // draw day buttons
+ if (this.BirthdaySeason == "spring" || this.BirthdaySeason == "summer" || this.BirthdaySeason == "fall" || this.BirthdaySeason == "winter")
+ {
+ foreach (ClickableTextureComponent button in this.DayButtons)
+ button.draw(b);
+ }
+
+ // draw season buttons
+ foreach (ClickableTextureComponent button in this.SeasonButtons)
+ button.draw(b);
+
+ // draw labels
+ foreach (ClickableComponent label in this.Labels)
+ {
+ Color color = Color.Violet;
+ Utility.drawTextWithShadow(b, label.name, Game1.smallFont, new Vector2(label.bounds.X, label.bounds.Y), color);
+ }
+ foreach (ClickableComponent label in this.Labels)
+ {
+ string text = "";
+ Color color = Game1.textColor;
+ Utility.drawTextWithShadow(b, label.name, Game1.smallFont, new Vector2(label.bounds.X, label.bounds.Y), color);
+ if (text.Length > 0)
+ Utility.drawTextWithShadow(b, text, Game1.smallFont, new Vector2((label.bounds.X + Game1.tileSize / 3) - Game1.smallFont.MeasureString(text).X / 2f, (label.bounds.Y + Game1.tileSize / 2)), color);
+ }
+
+ // draw OK button
+ if (this.BirthdayDay != 0 && this.BirthdaySeason != "")
+ this.OkButton.draw(b);
+ else
+ {
+ this.OkButton.draw(b);
+ this.OkButton.draw(b, Color.Black * 0.5f, 0.97f);
+ }
+
+ // draw cursor
+ this.drawMouse(b);
+ }
+ }
+}
diff --git a/GeneralMods/HappyBirthday/Framework/Messages.cs b/GeneralMods/HappyBirthday/Framework/Messages.cs
new file mode 100644
index 00000000..8d2c1c04
--- /dev/null
+++ b/GeneralMods/HappyBirthday/Framework/Messages.cs
@@ -0,0 +1,28 @@
+using StardewValley;
+
+namespace Omegasis.HappyBirthday.Framework
+{
+ /// Provides utility methods for displaying messages to the user.
+ internal class Messages
+ {
+ /*********
+ ** Public methods
+ *********/
+ /// Show a message to the user with a star icon.
+ /// The message to display.
+ public static void ShowStarMessage(string message)
+ {
+ Game1.addHUDMessage(new HUDMessage(message, 1));
+ if (!message.Contains("Inventory"))
+ {
+ Game1.playSound("cancel");
+ return;
+ }
+ if (!Game1.player.mailReceived.Contains("BackpackTip"))
+ {
+ Game1.player.mailReceived.Add("BackpackTip");
+ Game1.addMailForTomorrow("pierreBackpack", false, false);
+ }
+ }
+ }
+}
diff --git a/GeneralMods/HappyBirthday/Framework/ObjectUtility.cs b/GeneralMods/HappyBirthday/Framework/ObjectUtility.cs
new file mode 100644
index 00000000..bd86d3d4
--- /dev/null
+++ b/GeneralMods/HappyBirthday/Framework/ObjectUtility.cs
@@ -0,0 +1,46 @@
+using System.Collections.Generic;
+using System.Linq;
+using StardewValley;
+using Object = StardewValley.Object;
+
+namespace Omegasis.HappyBirthday.Framework
+{
+ /// Provides utility methods for managing in-game objects.
+ internal class ObjectUtility
+ {
+ /*********
+ ** Properties
+ *********/
+ /// The cached object data.
+ private static readonly Object[] ObjectList = ObjectUtility.GetAllObjects().ToArray();
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// Get objects with the given category.
+ /// The category for which to find objects.
+ public static IEnumerable