Compare commits
258 Commits
master
...
Revitalize
Author | SHA1 | Date |
---|---|---|
janavarr95 | 0129d292d3 | |
Joshua Navarro | e6843e7094 | |
janavarr95 | 799ece0d6f | |
JoshuaNavarro | 9584d2e247 | |
Joshua Navarro | 56313d7505 | |
JoshuaNavarro | 1453812b50 | |
JoshuaNavarro | b4b1f79816 | |
JoshuaNavarro | ad88e5537d | |
JoshuaNavarro | 64ffd48c8d | |
JoshuaNavarro | c4864c3e15 | |
JoshuaNavarro | ba00754be1 | |
JoshuaNavarro | 4e0662abe9 | |
JoshuaNavarro | 50151b2e69 | |
JoshuaNavarro | c69c05aa93 | |
JoshuaNavarro | 4c4fc7900b | |
JoshuaNavarro | 765e0860ce | |
JoshuaNavarro | e4913d9720 | |
JoshuaNavarro | fe794e7861 | |
JoshuaNavarro | 3da95865a3 | |
JoshuaNavarro | 650bfdc84b | |
JoshuaNavarro | aed54a63ff | |
JoshuaNavarro | 69170b6d54 | |
JoshuaNavarro | 373773906d | |
JoshuaNavarro | 2609f3339a | |
JoshuaNavarro | b553aff0d2 | |
JoshuaNavarro | 03e338e279 | |
JoshuaNavarro | b184c654f4 | |
JoshuaNavarro | 1b1b6d227a | |
JoshuaNavarro | f11ce9bb2f | |
JoshuaNavarro | 7c8d0bc6bd | |
JoshuaNavarro | f5db7501f4 | |
JoshuaNavarro | 267ed77092 | |
JoshuaNavarro | ca61342f98 | |
JoshuaNavarro | 381c13f67f | |
JoshuaNavarro | e190c9e664 | |
JoshuaNavarro | 7e17ae90a7 | |
JoshuaNavarro | 71ca6a1938 | |
JoshuaNavarro | 0db4c5452c | |
JoshuaNavarro | f450efdcc7 | |
JoshuaNavarro | b550f66233 | |
JoshuaNavarro | b5b6f500f9 | |
JoshuaNavarro | ac5e291492 | |
JoshuaNavarro | 717900d3e3 | |
JoshuaNavarro | f4060c8c88 | |
JoshuaNavarro | 612bb94cbd | |
JoshuaNavarro | e7e1ff2de5 | |
JoshuaNavarro | 059b2d57be | |
JoshuaNavarro | 3d50d2e38a | |
JoshuaNavarro | 28adb69bbc | |
JoshuaNavarro | dca4d497bb | |
JoshuaNavarro | d28c210d9b | |
JoshuaNavarro | 9c12eedefb | |
JoshuaNavarro | 4dc641afce | |
JoshuaNavarro | c3c467b818 | |
JoshuaNavarro | eb0d681abe | |
JoshuaNavarro | 49267030a5 | |
JoshuaNavarro | 3ce3f57220 | |
Joshua Navarro | d77df1f88c | |
JoshuaNavarro | 20acb522ef | |
JoshuaNavarro | 89ef844ab3 | |
JoshuaNavarro | 106b7a9474 | |
JoshuaNavarro | 70518a1d38 | |
JoshuaNavarro | 5604f46a74 | |
JoshuaNavarro | 53428ae962 | |
JoshuaNavarro | 6c7f0e8099 | |
JoshuaNavarro | 09c32bf96f | |
JoshuaNavarro | 720ac67216 | |
JoshuaNavarro | 1acfc40639 | |
JoshuaNavarro | 9dfe8a3783 | |
JoshuaNavarro | 90523d61da | |
JoshuaNavarro | 54e560f4a2 | |
JoshuaNavarro | 57665d5e8c | |
JoshuaNavarro | 822ef651f5 | |
JoshuaNavarro | 486529f250 | |
JoshuaNavarro | b41da3b9de | |
JoshuaNavarro | 32e1c9d3ac | |
JoshuaNavarro | ecfc595751 | |
JoshuaNavarro | 43eb60e9b9 | |
JoshuaNavarro | 0a676166f5 | |
JoshuaNavarro | a33a39a785 | |
JoshuaNavarro | d8b144eac9 | |
JoshuaNavarro | 95593e93ed | |
JoshuaNavarro | 68bfaa38c9 | |
JoshuaNavarro | caa7653b32 | |
JoshuaNavarro | 4eda84e57d | |
JoshuaNavarro | 0d373b5d83 | |
JoshuaNavarro | 1c6e04929c | |
JoshuaNavarro | 3ca7468fb9 | |
JoshuaNavarro | f0cd3ec80e | |
JoshuaNavarro | 885436c2b2 | |
JoshuaNavarro | d37606844b | |
JoshuaNavarro | 259f386471 | |
JoshuaNavarro | c0ecee5d9d | |
JoshuaNavarro | d059017a72 | |
JoshuaNavarro | 7209fec308 | |
JoshuaNavarro | b76a5ef39d | |
JoshuaNavarro | f93fac1637 | |
JoshuaNavarro | 0d252799de | |
JoshuaNavarro | cd87139168 | |
JoshuaNavarro | e20d593c7f | |
JoshuaNavarro | 0de19a904f | |
JoshuaNavarro | 620c1b4b70 | |
JoshuaNavarro | 505eaf1c2f | |
JoshuaNavarro | 3251d194f7 | |
JoshuaNavarro | ea100b1084 | |
JoshuaNavarro | 72da92e842 | |
JoshuaNavarro | 5435157853 | |
JoshuaNavarro | 45aad966c0 | |
JoshuaNavarro | fcf27bdc52 | |
JoshuaNavarro | 5e5c15f692 | |
JoshuaNavarro | 048dfc9dc0 | |
JoshuaNavarro | a2b66afb65 | |
JoshuaNavarro | 1a63bcc34d | |
JoshuaNavarro | c7b6ba8495 | |
JoshuaNavarro | 82d4fceabf | |
JoshuaNavarro | 0f5eb5b60b | |
JoshuaNavarro | 877e40ae39 | |
JoshuaNavarro | a89cbc2c82 | |
JoshuaNavarro | 50dcdf0eb6 | |
JoshuaNavarro | b6a817608f | |
JoshuaNavarro | f4828fae49 | |
JoshuaNavarro | 4b3b1dbaff | |
JoshuaNavarro | 9c7c3ace2a | |
JoshuaNavarro | 36e7b5e6ef | |
JoshuaNavarro | a4d8a4c1a8 | |
JoshuaNavarro | 4bfdef4383 | |
JoshuaNavarro | cf3029306b | |
JoshuaNavarro | 733461ecde | |
JoshuaNavarro | 010e705b6a | |
JoshuaNavarro | cbf2efc690 | |
JoshuaNavarro | dd4b4a0ee3 | |
JoshuaNavarro | 85592f1b53 | |
JoshuaNavarro | 5f48f54079 | |
JoshuaNavarro | bd03736e65 | |
JoshuaNavarro | 70edc9acf0 | |
JoshuaNavarro | 0d760f5cfe | |
JoshuaNavarro | a3c0e4f8a0 | |
JoshuaNavarro | 5be5222b19 | |
JoshuaNavarro | 2dab29c6ba | |
JoshuaNavarro | 6aa741b689 | |
JoshuaNavarro | e849e05161 | |
JoshuaNavarro | b42dfffde4 | |
JoshuaNavarro | 7143d4548c | |
JoshuaNavarro | 44d63f0a13 | |
JoshuaNavarro | 9a1fbd8ab3 | |
JoshuaNavarro | dae750bf7c | |
JoshuaNavarro | 288912d046 | |
JoshuaNavarro | acca21e511 | |
JoshuaNavarro | a752503964 | |
JoshuaNavarro | b53379736d | |
JoshuaNavarro | 19732ad2bf | |
JoshuaNavarro | e0d61f19cc | |
JoshuaNavarro | 2f07190926 | |
JoshuaNavarro | b5ce25d141 | |
JoshuaNavarro | 9950a6d0c0 | |
JoshuaNavarro | 94d1595efa | |
JoshuaNavarro | 50b77b44e2 | |
JoshuaNavarro | 36528407ba | |
JoshuaNavarro | 36e657db5b | |
JoshuaNavarro | d5b16d96de | |
JoshuaNavarro | e1a9644128 | |
JoshuaNavarro | 0f7252e2c5 | |
JoshuaNavarro | b70b4f1813 | |
JoshuaNavarro | 6d2d31ce23 | |
JoshuaNavarro | f3f4f4da27 | |
JoshuaNavarro | f194b5eb4f | |
JoshuaNavarro | a558c15f26 | |
JoshuaNavarro | 449c3a99ae | |
JoshuaNavarro | 1d07d15ac8 | |
JoshuaNavarro | a09a246153 | |
JoshuaNavarro | b65fdeb38d | |
JoshuaNavarro | 9d3be07daa | |
JoshuaNavarro | c7770cb8d7 | |
JoshuaNavarro | b24420d368 | |
JoshuaNavarro | bfb0194a66 | |
JoshuaNavarro | 14fb72fdb9 | |
JoshuaNavarro | ff9aa226f7 | |
JoshuaNavarro | 0cbae77d28 | |
JoshuaNavarro | c51ffa84b6 | |
JoshuaNavarro | eb5231e81a | |
JoshuaNavarro | 16d35e2d42 | |
JoshuaNavarro | 01cc1d29ec | |
JoshuaNavarro | 5ce0e5fb19 | |
JoshuaNavarro | 8f16593894 | |
JoshuaNavarro | 47c50b6c18 | |
JoshuaNavarro | 5cf0211339 | |
JoshuaNavarro | 768e09cf43 | |
JoshuaNavarro | 9b8c469eb6 | |
JoshuaNavarro | ce904efef3 | |
JoshuaNavarro | 746d1e1613 | |
JoshuaNavarro | 1a6ee664b7 | |
JoshuaNavarro | d6fa1672db | |
JoshuaNavarro | b022947542 | |
JoshuaNavarro | 5af8e025bd | |
JoshuaNavarro | 9ab33bba38 | |
JoshuaNavarro | c7633a2a04 | |
JoshuaNavarro | d0b9b1f1cd | |
JoshuaNavarro | bda8c38c7d | |
JoshuaNavarro | 9caaae43b8 | |
JoshuaNavarro | 87f0ddcb2c | |
JoshuaNavarro | 1c8d973a14 | |
JoshuaNavarro | 1838c80ccb | |
JoshuaNavarro | c5e4b5ecdc | |
JoshuaNavarro | 1a629e5b47 | |
JoshuaNavarro | a75a156757 | |
JoshuaNavarro | 75feed842c | |
JoshuaNavarro | 0a2c1ee11b | |
JoshuaNavarro | 76737c3c7e | |
JoshuaNavarro | 5a2f708e08 | |
JoshuaNavarro | e1553ca6d8 | |
JoshuaNavarro | b11a37df31 | |
JoshuaNavarro | fac35e0f9d | |
JoshuaNavarro | 4ac1473d9e | |
JoshuaNavarro | 71868bd0b6 | |
JoshuaNavarro | feb5302c39 | |
JoshuaNavarro | 650a852f8a | |
JoshuaNavarro | 384d69aafe | |
JoshuaNavarro | b81037bcb5 | |
JoshuaNavarro | c3b439766e | |
JoshuaNavarro | 632de2c1a3 | |
JoshuaNavarro | 0e1483605a | |
JoshuaNavarro | 7c170ade98 | |
JoshuaNavarro | a63d6a88bb | |
JoshuaNavarro | 9d58b4b15e | |
JoshuaNavarro | 7dd02b8b0d | |
JoshuaNavarro | bac0f12dc5 | |
JoshuaNavarro | 02e6bd7e49 | |
JoshuaNavarro | a75503637d | |
JoshuaNavarro | 054077e94d | |
JoshuaNavarro | 01f239f371 | |
JoshuaNavarro | d8e7fa3ddb | |
JoshuaNavarro | 251cf49114 | |
JoshuaNavarro | 04b245d41a | |
JoshuaNavarro | 5c8a7d8abb | |
JoshuaNavarro | 9072c57013 | |
JoshuaNavarro | 6b172bb3e8 | |
JoshuaNavarro | bc7cc885f7 | |
JoshuaNavarro | 332358f48a | |
JoshuaNavarro | 9595ece1bb | |
JoshuaNavarro | bff69c2a96 | |
JoshuaNavarro | 2252aa952a | |
JoshuaNavarro | 824486d3b8 | |
JoshuaNavarro | c1509c9371 | |
JoshuaNavarro | 76aa7f7894 | |
JoshuaNavarro | d3fc042b82 | |
JoshuaNavarro | 03d230c4af | |
JoshuaNavarro | 072c3d511b | |
JoshuaNavarro | 596aedac77 | |
JoshuaNavarro | c026702f09 | |
JoshuaNavarro | 6c02af4596 | |
JoshuaNavarro | 05aeabed12 | |
JoshuaNavarro | 42f8d2595b | |
JoshuaNavarro | e63b48ab6a | |
JoshuaNavarro | 7eaaa44910 | |
JoshuaNavarro | c8a1ce8e86 | |
JoshuaNavarro | c2f5657ef0 | |
JoshuaNavarro | e4c734a1d7 | |
JoshuaNavarro | e62610631d |
|
@ -66,7 +66,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|
|
@ -2,7 +2,6 @@ using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using Omegasis.SaveBackup.Framework;
|
using Omegasis.SaveBackup.Framework;
|
||||||
using StardewModdingAPI;
|
using StardewModdingAPI;
|
||||||
using StardewModdingAPI.Events;
|
using StardewModdingAPI.Events;
|
||||||
|
@ -16,16 +15,16 @@ namespace Omegasis.SaveBackup
|
||||||
** Fields
|
** Fields
|
||||||
*********/
|
*********/
|
||||||
/// <summary>The folder path containing the game's app data.</summary>
|
/// <summary>The folder path containing the game's app data.</summary>
|
||||||
private static string AppDataPath => Constants.TargetPlatform != GamePlatform.Android ? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StardewValley") : Constants.DataPath;
|
private static readonly string AppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StardewValley");
|
||||||
|
|
||||||
/// <summary>The folder path containing the game's saves.</summary>
|
/// <summary>The folder path containing the game's saves.</summary>
|
||||||
private static string SavesPath => Constants.TargetPlatform != GamePlatform.Android ? Path.Combine(SaveBackup.AppDataPath, "Saves") : Constants.CurrentSavePath;
|
private static readonly string SavesPath = Path.Combine(SaveBackup.AppDataPath, "Saves");
|
||||||
|
|
||||||
/// <summary>The folder path containing backups of the save before the player starts playing.</summary>
|
/// <summary>The folder path containing backups of the save before the player starts playing.</summary>
|
||||||
private static readonly string PrePlayBackupsPath = Path.Combine(SaveBackup.AppDataPath, "Backed_Up_Saves", "Pre_Play_Saves");
|
private static readonly string PrePlayBackupsPath = Path.Combine(SaveBackup.AppDataPath, "Backed_Up_Saves", "Pre_Play_Saves");
|
||||||
|
|
||||||
/// <summary>The folder path containing nightly backups of the save.</summary>
|
/// <summary>The folder path containing nightly backups of the save.</summary>
|
||||||
private static string NightlyBackupsPath => Constants.TargetPlatform != GamePlatform.Android ? Path.Combine(SaveBackup.AppDataPath, "Backed_Up_Saves", "Nightly_InGame_Saves") : Path.Combine(SaveBackup.AppDataPath, "Backed_Up_Saves", Constants.SaveFolderName, "Nightly_InGame_Saves");
|
private static readonly string NightlyBackupsPath = Path.Combine(SaveBackup.AppDataPath, "Backed_Up_Saves", "Nightly_InGame_Saves");
|
||||||
|
|
||||||
/// <summary>The mod configuration.</summary>
|
/// <summary>The mod configuration.</summary>
|
||||||
private ModConfig Config;
|
private ModConfig Config;
|
||||||
|
@ -40,8 +39,7 @@ namespace Omegasis.SaveBackup
|
||||||
{
|
{
|
||||||
this.Config = helper.ReadConfig<ModConfig>();
|
this.Config = helper.ReadConfig<ModConfig>();
|
||||||
|
|
||||||
if(Constants.TargetPlatform != GamePlatform.Android)
|
this.BackupSaves(SaveBackup.PrePlayBackupsPath);
|
||||||
this.BackupSaves(SaveBackup.PrePlayBackupsPath);
|
|
||||||
|
|
||||||
helper.Events.GameLoop.Saving += this.OnSaving;
|
helper.Events.GameLoop.Saving += this.OnSaving;
|
||||||
}
|
}
|
||||||
|
@ -58,108 +56,21 @@ namespace Omegasis.SaveBackup
|
||||||
this.BackupSaves(SaveBackup.NightlyBackupsPath);
|
this.BackupSaves(SaveBackup.NightlyBackupsPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Recursively copy a directory or file.</summary>
|
|
||||||
/// <param name="source">The file or folder to copy.</param>
|
|
||||||
/// <param name="targetFolder">The folder to copy into.</param>
|
|
||||||
/// <param name="copyRoot">Whether to copy the root folder itself, or <c>false</c> to only copy its contents.</param>
|
|
||||||
/// <param name="filter">A filter which matches the files or directories to copy, or <c>null</c> to copy everything.</param>
|
|
||||||
/// <remarks>Derived from the SMAPI installer code.</remarks>
|
|
||||||
/// <returns>Returns whether any files were copied.</returns>
|
|
||||||
private bool RecursiveCopy(FileSystemInfo source, DirectoryInfo targetFolder, bool copyRoot = true)
|
|
||||||
{
|
|
||||||
if (!source.Exists)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
bool anyCopied = false;
|
|
||||||
|
|
||||||
switch (source)
|
|
||||||
{
|
|
||||||
case FileInfo sourceFile:
|
|
||||||
targetFolder.Create();
|
|
||||||
sourceFile.CopyTo(Path.Combine(targetFolder.FullName, sourceFile.Name));
|
|
||||||
anyCopied = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DirectoryInfo sourceDir:
|
|
||||||
DirectoryInfo targetSubfolder = copyRoot ? new DirectoryInfo(Path.Combine(targetFolder.FullName, sourceDir.Name)) : targetFolder;
|
|
||||||
foreach (var entry in sourceDir.EnumerateFileSystemInfos())
|
|
||||||
anyCopied = this.RecursiveCopy(entry, targetSubfolder) || anyCopied;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
throw new NotSupportedException($"Unknown filesystem info type '{source.GetType().FullName}'.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return anyCopied;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Create a zip using the .NET compression library.</summary>
|
|
||||||
/// <param name="sourcePath">The file or directory path to zip.</param>
|
|
||||||
/// <param name="destination">The destination file to create.</param>
|
|
||||||
/// <exception cref="NotSupportedException">The compression libraries aren't available on this system.</exception>
|
|
||||||
private void CompressUsingNetFramework(string sourcePath, FileInfo destination)
|
|
||||||
{
|
|
||||||
// get compress method
|
|
||||||
MethodInfo createFromDirectory;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// create compressed backup
|
|
||||||
Assembly coreAssembly = Assembly.Load("System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") ?? throw new InvalidOperationException("Can't load System.IO.Compression assembly.");
|
|
||||||
Assembly fsAssembly = Assembly.Load("System.IO.Compression.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") ?? throw new InvalidOperationException("Can't load System.IO.Compression assembly.");
|
|
||||||
Type compressionLevelType = coreAssembly.GetType("System.IO.Compression.CompressionLevel") ?? throw new InvalidOperationException("Can't load CompressionLevel type.");
|
|
||||||
Type zipFileType = fsAssembly.GetType("System.IO.Compression.ZipFile") ?? throw new InvalidOperationException("Can't load ZipFile type.");
|
|
||||||
createFromDirectory = zipFileType.GetMethod("CreateFromDirectory", new[] { typeof(string), typeof(string), compressionLevelType, typeof(bool) }) ?? throw new InvalidOperationException("Can't load ZipFile.CreateFromDirectory method.");
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException("Couldn't load the .NET compression libraries on this system.", ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
// compress file
|
|
||||||
createFromDirectory.Invoke(null, new object[] { sourcePath, destination.FullName, CompressionLevel.Fastest, false });
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OriginCompressLogic(string folderPath)
|
|
||||||
{
|
|
||||||
ZipFile.CreateFromDirectory(SaveBackup.SavesPath, Path.Combine(folderPath, $"backup-{DateTime.Now:yyyyMMdd'-'HHmmss}.zip"));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Back up saves to the specified folder.</summary>
|
/// <summary>Back up saves to the specified folder.</summary>
|
||||||
/// <param name="folderPath">The folder path in which to generate saves.</param>
|
/// <param name="folderPath">The folder path in which to generate saves.</param>
|
||||||
private void BackupSaves(string folderPath)
|
private void BackupSaves(string folderPath)
|
||||||
{
|
{
|
||||||
// back up saves
|
// back up saves
|
||||||
Directory.CreateDirectory(folderPath);
|
Directory.CreateDirectory(folderPath);
|
||||||
if(Constants.TargetPlatform == GamePlatform.Android)
|
ZipFile.CreateFromDirectory(SaveBackup.SavesPath, Path.Combine(folderPath, $"backup-{DateTime.Now:yyyyMMdd'-'HHmmss}.zip"));
|
||||||
{
|
|
||||||
FileInfo targetFile = new FileInfo(Path.Combine(folderPath, $"backup-{DateTime.Now:yyyyMMdd'-'HHmmss}.zip"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.CompressUsingNetFramework(folderPath, targetFile);
|
|
||||||
}
|
|
||||||
catch (NotSupportedException)
|
|
||||||
{
|
|
||||||
this.RecursiveCopy(new DirectoryInfo(SaveBackup.SavesPath), new DirectoryInfo(Path.Combine(folderPath, $"backup-{DateTime.Now:yyyyMMdd'-'HHmmss}")), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.OriginCompressLogic(folderPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete old backups
|
// delete old backups
|
||||||
new DirectoryInfo(folderPath)
|
new DirectoryInfo(folderPath)
|
||||||
.GetFileSystemInfos()
|
.EnumerateFiles()
|
||||||
.OrderByDescending(f => f.CreationTime)
|
.OrderByDescending(f => f.CreationTime)
|
||||||
.Skip(this.Config.SaveCount)
|
.Skip(this.Config.SaveCount)
|
||||||
.ToList()
|
.ToList()
|
||||||
.ForEach(file =>
|
.ForEach(file => file.Delete());
|
||||||
{
|
|
||||||
if (file is DirectoryInfo folder)
|
|
||||||
folder.Delete(recursive: true);
|
|
||||||
else
|
|
||||||
file.Delete();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"Name": "Advanced Save Backup",
|
"Name": "Advanced Save Backup",
|
||||||
"Author": "Alpha_Omegasis",
|
"Author": "Alpha_Omegasis",
|
||||||
"Version": "1.7.0",
|
"Version": "1.7.1",
|
||||||
"Description": "Backs up your save files when loading SMAPI and every in game night when saving.",
|
"Description": "Backs up your save files when loading SMAPI and every in game night when saving.",
|
||||||
"UniqueID": "Omegasis.AdvancedSaveBackup",
|
"UniqueID": "Omegasis.AdvancedSaveBackup",
|
||||||
"EntryDll": "AdvancedSaveBackup.dll",
|
"EntryDll": "AdvancedSaveBackup.dll",
|
||||||
"MinimumApiVersion": "2.10.1",
|
"MinimumApiVersion": "3.0.0",
|
||||||
"UpdateKeys": [ "Nexus:435" ]
|
"UpdateKeys": [ "Nexus:435" ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using Omegasis.AutoSpeed.Framework;
|
using Omegasis.AutoSpeed.Framework;
|
||||||
using StardewModdingAPI;
|
using StardewModdingAPI;
|
||||||
using StardewModdingAPI.Events;
|
using StardewModdingAPI.Events;
|
||||||
|
@ -8,12 +10,24 @@ namespace Omegasis.AutoSpeed
|
||||||
/// <summary>The mod entry point.</summary>
|
/// <summary>The mod entry point.</summary>
|
||||||
public class AutoSpeed : Mod
|
public class AutoSpeed : Mod
|
||||||
{
|
{
|
||||||
|
/*********
|
||||||
|
**Static Fields
|
||||||
|
*********/
|
||||||
|
/// <summary>
|
||||||
|
/// All of the speed that is added together for auto speed. This is used for mod authors to hook in their speed boosts before auto speed applies the default speed boost.
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, int> combinedAddedSpeed;
|
||||||
|
|
||||||
/*********
|
/*********
|
||||||
** Fields
|
** Fields
|
||||||
*********/
|
*********/
|
||||||
/// <summary>The mod configuration.</summary>
|
/// <summary>The mod configuration.</summary>
|
||||||
private ModConfig Config;
|
private ModConfig Config;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A static reference to expose public fields.
|
||||||
|
/// </summary>
|
||||||
|
public static AutoSpeed Instance;
|
||||||
|
|
||||||
/*********
|
/*********
|
||||||
** Public methods
|
** Public methods
|
||||||
|
@ -24,6 +38,17 @@ namespace Omegasis.AutoSpeed
|
||||||
{
|
{
|
||||||
helper.Events.GameLoop.UpdateTicked += this.OnUpdateTicked;
|
helper.Events.GameLoop.UpdateTicked += this.OnUpdateTicked;
|
||||||
this.Config = helper.ReadConfig<ModConfig>();
|
this.Config = helper.ReadConfig<ModConfig>();
|
||||||
|
this.combinedAddedSpeed = new Dictionary<string, int>();
|
||||||
|
Instance = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a copy of the mods' api.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override object GetApi()
|
||||||
|
{
|
||||||
|
return new AutoSpeedAPI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +61,10 @@ namespace Omegasis.AutoSpeed
|
||||||
private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
|
private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
|
||||||
{
|
{
|
||||||
if (Context.IsPlayerFree)
|
if (Context.IsPlayerFree)
|
||||||
Game1.player.addedSpeed = this.Config.Speed;
|
{
|
||||||
|
int addedSpeed = this.combinedAddedSpeed.Values.Sum();
|
||||||
|
Game1.player.addedSpeed = this.Config.Speed+addedSpeed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -77,6 +77,8 @@
|
||||||
<Link>Properties\GlobalAssemblyInfo.cs</Link>
|
<Link>Properties\GlobalAssemblyInfo.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="AutoSpeed.cs" />
|
<Compile Include="AutoSpeed.cs" />
|
||||||
|
<Compile Include="Framework\AutoSpeedAPI.cs" />
|
||||||
|
<Compile Include="Framework\IAutoSpeedAPI.cs" />
|
||||||
<Compile Include="Framework\ModConfig.cs" />
|
<Compile Include="Framework\ModConfig.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Omegasis.AutoSpeed.Framework
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// API for auto speed to hook into the Game1.player.addedSpeed function.
|
||||||
|
/// </summary>
|
||||||
|
public class AutoSpeedAPI
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows adding a speed for Auto Speed to take acount for when calculating Game1.player.addedSpeed; Will fail if a unique key has already been added.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ID"></param>
|
||||||
|
/// <param name="Amount"></param>
|
||||||
|
public void addSpeedBoost(string ID, int Amount)
|
||||||
|
{
|
||||||
|
AutoSpeed.Instance.combinedAddedSpeed.Add(ID, Amount);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Removes an added speed boost by passing in the unique key.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ID"></param>
|
||||||
|
/// <param name="Amount"></param>
|
||||||
|
public void remvoveSpeedBoost(string ID, int Amount)
|
||||||
|
{
|
||||||
|
AutoSpeed.Instance.combinedAddedSpeed.Remove(ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Omegasis.AutoSpeed.Framework
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interface used to interface AutoSpeed's API class.
|
||||||
|
/// </summary>
|
||||||
|
public interface IAutoSpeedAPI
|
||||||
|
{
|
||||||
|
void addSpeedBoost(string ID, int Amount);
|
||||||
|
/// <summary>
|
||||||
|
/// Removes an added speed boost by passing in the unique key.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ID"></param>
|
||||||
|
/// <param name="Amount"></param>
|
||||||
|
void remvoveSpeedBoost(string ID, int Amount);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"Name": "Auto Speed",
|
"Name": "Auto Speed",
|
||||||
"Author": "Alpha_Omegasis",
|
"Author": "Alpha_Omegasis",
|
||||||
"Version": "1.8.0",
|
"Version": "1.9.0",
|
||||||
"Description": "Got to go fast!",
|
"Description": "Got to go fast!",
|
||||||
"UniqueID": "Omegasis.AutoSpeed",
|
"UniqueID": "Omegasis.AutoSpeed",
|
||||||
"EntryDll": "AutoSpeed.dll",
|
"EntryDll": "AutoSpeed.dll",
|
||||||
"MinimumApiVersion": "2.10.1",
|
"MinimumApiVersion": "3.0.0",
|
||||||
"UpdateKeys": [ "Nexus:443" ]
|
"UpdateKeys": [ "Nexus:443" ]
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 916 B |
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
|
@ -1,3 +1,7 @@
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Omegasis.BillboardAnywhere.Framework;
|
using Omegasis.BillboardAnywhere.Framework;
|
||||||
using StardewModdingAPI;
|
using StardewModdingAPI;
|
||||||
using StardewModdingAPI.Events;
|
using StardewModdingAPI.Events;
|
||||||
|
@ -15,6 +19,23 @@ namespace Omegasis.BillboardAnywhere
|
||||||
/// <summary>The mod configuration.</summary>
|
/// <summary>The mod configuration.</summary>
|
||||||
private ModConfig Config;
|
private ModConfig Config;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The texture for the calendar button.
|
||||||
|
/// </summary>
|
||||||
|
private Texture2D calendarTexture;
|
||||||
|
/// <summary>
|
||||||
|
/// The texture for the quest button.
|
||||||
|
/// </summary>
|
||||||
|
private Texture2D questTexture;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The button for the calendar menu.
|
||||||
|
/// </summary>
|
||||||
|
public ClickableTextureComponent billboardButton;
|
||||||
|
/// <summary>
|
||||||
|
/// The button for the quest menu.
|
||||||
|
/// </summary>
|
||||||
|
public ClickableTextureComponent questButton;
|
||||||
|
|
||||||
/*********
|
/*********
|
||||||
** Public methods
|
** Public methods
|
||||||
|
@ -25,9 +46,24 @@ namespace Omegasis.BillboardAnywhere
|
||||||
{
|
{
|
||||||
this.Config = helper.ReadConfig<ModConfig>();
|
this.Config = helper.ReadConfig<ModConfig>();
|
||||||
|
|
||||||
|
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.ReloadConfig", "Reloads the config file for BillboardAnywhere to reposition the button for the inventory menu page.", this.reloadConfig);
|
||||||
|
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonX", "<int>Sets the x position for the calendar button in the game menu.", this.setcalendarButtonX);
|
||||||
|
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonY", "<int> Sets the y position for the calendar button in the game menu.", this.setcalendarButtonY);
|
||||||
|
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonPosition", "<int,int> Sets the position for the calendar button in the game menu.", this.setcalendarButtonPosition);
|
||||||
|
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonX", "<int>Sets the x position for the quest button in the game menu.", this.setQuestButtonX);
|
||||||
|
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonY", "<int> Sets the y position for the quest button in the game menu.", this.setQuestButtonX);
|
||||||
|
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonPosition", "<int,int> Sets the position for the quest button in the game menu.", this.setQuestButtonPosition);
|
||||||
|
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonVisibility", "<bool> Sets the visibility for the billboard button in the game menu.", this.setcalendarButtonVisibility);
|
||||||
|
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonVisibility", "<bool> Sets the visibility for the quest button in the game menu.", this.setQuestButtonVisibility);
|
||||||
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
|
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
|
||||||
}
|
helper.Events.Display.RenderedActiveMenu += this.RenderBillboardMenuButton;
|
||||||
|
helper.Events.Input.ButtonPressed += this.Input_ButtonPressed;
|
||||||
|
|
||||||
|
this.calendarTexture = helper.Content.Load<Texture2D>(Path.Combine("Assets", "Billboard.png"));
|
||||||
|
this.questTexture= helper.Content.Load<Texture2D>(Path.Combine("Assets", "Quest.png"));
|
||||||
|
this.billboardButton = new ClickableTextureComponent(new Rectangle((int)this.Config.CalendarOffsetFromMenu.X, (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height), this.calendarTexture, new Rectangle(0, 0, this.calendarTexture.Width, this.calendarTexture.Height), 1f, false);
|
||||||
|
this.questButton = new ClickableTextureComponent(new Rectangle((int)this.Config.QuestOffsetFromMenu.X, (int)this.Config.QuestOffsetFromMenu.Y, this.questTexture.Width, this.questTexture.Height), this.questTexture, new Rectangle(0, 0, this.questTexture.Width, this.questTexture.Height), 1f, false);
|
||||||
|
}
|
||||||
|
|
||||||
/*********
|
/*********
|
||||||
** Private methods
|
** Private methods
|
||||||
|
@ -38,8 +74,214 @@ namespace Omegasis.BillboardAnywhere
|
||||||
public void OnButtonPressed(object sender, ButtonPressedEventArgs e)
|
public void OnButtonPressed(object sender, ButtonPressedEventArgs e)
|
||||||
{
|
{
|
||||||
// load menu if key pressed
|
// load menu if key pressed
|
||||||
if (Context.IsPlayerFree && e.Button == this.Config.KeyBinding)
|
if (Context.IsPlayerFree && e.Button == this.Config.CalendarKeyBinding)
|
||||||
Game1.activeClickableMenu = new Billboard();
|
Game1.activeClickableMenu = new Billboard();
|
||||||
|
if (Context.IsPlayerFree && e.Button == this.Config.QuestBoardKeyBinding)
|
||||||
|
{
|
||||||
|
Game1.RefreshQuestOfTheDay();
|
||||||
|
Game1.activeClickableMenu = new Billboard(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks to see if the billboard button is clicked.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void Input_ButtonPressed(object sender, ButtonPressedEventArgs e)
|
||||||
|
{
|
||||||
|
if (Game1.activeClickableMenu == null) return;
|
||||||
|
if (e.Button == SButton.MouseLeft)
|
||||||
|
{
|
||||||
|
if (this.isInventoryPage())
|
||||||
|
{
|
||||||
|
if (this.billboardButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
|
||||||
|
{
|
||||||
|
if (this.Config.EnableInventoryCalendarButton == false) return;
|
||||||
|
Game1.activeClickableMenu = new Billboard(false);
|
||||||
|
}
|
||||||
|
if (this.questButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
|
||||||
|
{
|
||||||
|
if (this.Config.EnableInventoryQuestButton == false) return;
|
||||||
|
Game1.activeClickableMenu = new Billboard(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Renders the billboard button to the menu.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void RenderBillboardMenuButton(object sender, RenderedActiveMenuEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.isInventoryPage())
|
||||||
|
{
|
||||||
|
this.billboardButton.bounds = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + (int)this.Config.CalendarOffsetFromMenu.X, Game1.activeClickableMenu.yPositionOnScreen + (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height);
|
||||||
|
this.questButton.bounds = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + (int)this.Config.QuestOffsetFromMenu.X, Game1.activeClickableMenu.yPositionOnScreen + (int)this.Config.QuestOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height);
|
||||||
|
if(this.Config.EnableInventoryQuestButton) this.questButton.draw(Game1.spriteBatch);
|
||||||
|
if (this.Config.EnableInventoryCalendarButton) this.billboardButton.draw(Game1.spriteBatch);
|
||||||
|
GameMenu activeMenu = (Game1.activeClickableMenu as GameMenu);
|
||||||
|
activeMenu.drawMouse(Game1.spriteBatch);
|
||||||
|
|
||||||
|
if (this.billboardButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
|
||||||
|
{
|
||||||
|
//My deepest appologies for not being able to personally translate more text.
|
||||||
|
if (Game1.content.GetCurrentLanguage() == LocalizedContentManager.LanguageCode.en)
|
||||||
|
{
|
||||||
|
if (this.Config.EnableInventoryCalendarButton == false) return;
|
||||||
|
IClickableMenu.drawHoverText(Game1.spriteBatch, "Open Billboard Menu", Game1.smallFont);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.questButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
|
||||||
|
{
|
||||||
|
//My deepest appologies once again for not being able to personally translate more text.
|
||||||
|
if (Game1.content.GetCurrentLanguage() == LocalizedContentManager.LanguageCode.en)
|
||||||
|
{
|
||||||
|
if (this.Config.EnableInventoryQuestButton == false) return;
|
||||||
|
IClickableMenu.drawHoverText(Game1.spriteBatch, "Open Quest Menu", Game1.smallFont);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks to see if the current active menu is the game menu and the current page is the inventory page.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private bool isInventoryPage()
|
||||||
|
{
|
||||||
|
if (Game1.activeClickableMenu == null) return false;
|
||||||
|
if (Game1.activeClickableMenu is StardewValley.Menus.GameMenu)
|
||||||
|
{
|
||||||
|
GameMenu activeMenu = (Game1.activeClickableMenu as GameMenu);
|
||||||
|
IClickableMenu currentTab = activeMenu.GetCurrentPage();
|
||||||
|
if (currentTab is InventoryPage)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reloads the mod's config and repositions the menu button as necessary.
|
||||||
|
/// </summary>
|
||||||
|
private void reloadConfig(string Name, string[] Params)
|
||||||
|
{
|
||||||
|
this.Config = this.Helper.ReadConfig<ModConfig>();
|
||||||
|
this.billboardButton = new ClickableTextureComponent(new Rectangle((int)this.Config.CalendarOffsetFromMenu.X, (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height), this.calendarTexture, new Rectangle(0, 0, this.calendarTexture.Width, this.calendarTexture.Height), 1f, false);
|
||||||
|
this.questButton = new ClickableTextureComponent(new Rectangle((int)this.Config.QuestOffsetFromMenu.X, (int)this.Config.QuestOffsetFromMenu.Y, this.questTexture.Width, this.questTexture.Height), this.questTexture, new Rectangle(0, 0, this.questTexture.Width, this.questTexture.Height), 1f, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reloads the mod's config and repositions the menu button as necessary.
|
||||||
|
/// </summary>
|
||||||
|
private void reloadConfig()
|
||||||
|
{
|
||||||
|
this.Config = this.Helper.ReadConfig<ModConfig>();
|
||||||
|
this.billboardButton = new ClickableTextureComponent(new Rectangle((int)this.Config.CalendarOffsetFromMenu.X, (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height), this.calendarTexture, new Rectangle(0, 0, this.calendarTexture.Width, this.calendarTexture.Height), 1f, false);
|
||||||
|
this.questButton = new ClickableTextureComponent(new Rectangle((int)this.Config.QuestOffsetFromMenu.X, (int)this.Config.QuestOffsetFromMenu.Y, this.questTexture.Width, this.questTexture.Height), this.questTexture, new Rectangle(0, 0, this.questTexture.Width, this.questTexture.Height), 1f, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the x position of the menu button.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Name">The name of the command.</param>
|
||||||
|
/// <param name="Params">The parameters passed into the command.</param>
|
||||||
|
private void setcalendarButtonX(string Name, string[] Params)
|
||||||
|
{
|
||||||
|
this.Config.CalendarOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), this.Config.CalendarOffsetFromMenu.Y);
|
||||||
|
this.Helper.WriteConfig<ModConfig>(this.Config);
|
||||||
|
this.reloadConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the y position of the menu button.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Name">The name of the command.</param>
|
||||||
|
/// <param name="Params">The parameters passed into the command.</param>
|
||||||
|
private void setcalendarButtonY(string Name, string[] Params)
|
||||||
|
{
|
||||||
|
this.Config.CalendarOffsetFromMenu = new Vector2(this.Config.CalendarOffsetFromMenu.X, Convert.ToInt32(Params[0]));
|
||||||
|
this.Helper.WriteConfig<ModConfig>(this.Config);
|
||||||
|
this.reloadConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the position of the menu button.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Name">The name of the command.</param>
|
||||||
|
/// <param name="Params">The parameters passed into the command.</param>
|
||||||
|
private void setcalendarButtonPosition(string Name, string[] Params)
|
||||||
|
{
|
||||||
|
this.Config.CalendarOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), Convert.ToInt32(Params[1]));
|
||||||
|
this.Helper.WriteConfig<ModConfig>(this.Config);
|
||||||
|
this.reloadConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the x position of the quest menu button.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Name">The name of the command.</param>
|
||||||
|
/// <param name="Params">The parameters passed into the command.</param>
|
||||||
|
private void setQuestButtonX(string Name, string[] Params)
|
||||||
|
{
|
||||||
|
this.Config.QuestOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), this.Config.QuestOffsetFromMenu.Y);
|
||||||
|
this.Helper.WriteConfig<ModConfig>(this.Config);
|
||||||
|
this.reloadConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the y position of the quest menu button.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Name">The name of the command.</param>
|
||||||
|
/// <param name="Params">The parameters passed into the command.</param>
|
||||||
|
private void setQuestButtonY(string Name, string[] Params)
|
||||||
|
{
|
||||||
|
this.Config.QuestOffsetFromMenu = new Vector2(this.Config.QuestOffsetFromMenu.X, Convert.ToInt32(Params[0]));
|
||||||
|
this.Helper.WriteConfig<ModConfig>(this.Config);
|
||||||
|
this.reloadConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the position of the quest menu button.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Name">The name of the command.</param>
|
||||||
|
/// <param name="Params">The parameters passed into the command.</param>
|
||||||
|
private void setQuestButtonPosition(string Name, string[] Params)
|
||||||
|
{
|
||||||
|
this.Config.QuestOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), Convert.ToInt32(Params[1]));
|
||||||
|
this.Helper.WriteConfig<ModConfig>(this.Config);
|
||||||
|
this.reloadConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the visibility and functionality of the billboard menu button.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Name">The name of the command.</param>
|
||||||
|
/// <param name="Params">The parameters passed into the command.</param>
|
||||||
|
private void setcalendarButtonVisibility(string Name, string[] Params)
|
||||||
|
{
|
||||||
|
this.Config.EnableInventoryCalendarButton = Convert.ToBoolean(Params[0]);
|
||||||
|
this.Helper.WriteConfig<ModConfig>(this.Config);
|
||||||
|
this.reloadConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the visibility and functionality of the quest menu button.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Name">The name of the command.</param>
|
||||||
|
/// <param name="Params">The parameters passed into the command.</param>
|
||||||
|
private void setQuestButtonVisibility(string Name, string[] Params)
|
||||||
|
{
|
||||||
|
this.Config.EnableInventoryQuestButton = Convert.ToBoolean(Params[0]);
|
||||||
|
this.Helper.WriteConfig<ModConfig>(this.Config);
|
||||||
|
this.reloadConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -86,6 +86,14 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="README.md" />
|
<None Include="README.md" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Assets\Billboard.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Assets\Quest.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(SolutionDir)\deploy.targets" />
|
<Import Project="$(SolutionDir)\deploy.targets" />
|
||||||
</Project>
|
</Project>
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
using StardewModdingAPI;
|
using StardewModdingAPI;
|
||||||
|
|
||||||
namespace Omegasis.BillboardAnywhere.Framework
|
namespace Omegasis.BillboardAnywhere.Framework
|
||||||
|
@ -6,6 +7,21 @@ namespace Omegasis.BillboardAnywhere.Framework
|
||||||
internal class ModConfig
|
internal class ModConfig
|
||||||
{
|
{
|
||||||
/// <summary>The key which shows the billboard menu.</summary>
|
/// <summary>The key which shows the billboard menu.</summary>
|
||||||
public SButton KeyBinding { get; set; } = SButton.B;
|
public SButton CalendarKeyBinding { get; set; } = SButton.B;
|
||||||
|
/// <summary>The key which shows the quest menu.</summary>
|
||||||
|
public SButton QuestBoardKeyBinding { get; set; } = SButton.H;
|
||||||
|
/// <summary>The offset for the calendar button from the active menu</summary>
|
||||||
|
public Vector2 CalendarOffsetFromMenu { get; set; } = new Vector2(-100, 0);
|
||||||
|
/// <summary>The offset for the quest button from the active menu</summary>
|
||||||
|
public Vector2 QuestOffsetFromMenu { get; set; } = new Vector2(-200, 0);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If true the calendar button is enabled for the in-game menu.
|
||||||
|
/// </summary>
|
||||||
|
public bool EnableInventoryCalendarButton { get; set; } = true;
|
||||||
|
/// <summary>
|
||||||
|
/// If true the quest button is enabled for the in-game menu.
|
||||||
|
/// </summary>
|
||||||
|
public bool EnableInventoryQuestButton { get; set; } = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"Name": "Billboard Anywhere",
|
"Name": "Billboard Anywhere",
|
||||||
"Author": "Alpha_Omegasis",
|
"Author": "Alpha_Omegasis",
|
||||||
"Version": "1.8.0",
|
"Version": "1.10.1",
|
||||||
"Description": "Lets you view the billboard from anywhere.",
|
"Description": "Lets you view the billboard from anywhere.",
|
||||||
"UniqueID": "Omegasis.BillboardAnywhere",
|
"UniqueID": "Omegasis.BillboardAnywhere",
|
||||||
"EntryDll": "BillboardAnywhere.dll",
|
"EntryDll": "BillboardAnywhere.dll",
|
||||||
"MinimumApiVersion": "2.10.1",
|
"MinimumApiVersion": "3.0.0",
|
||||||
"UpdateKeys": [ "Nexus:492" ]
|
"UpdateKeys": [ "Nexus:492" ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ namespace Omegasis.BuildEndurance
|
||||||
|
|
||||||
if (this.PlayerData.CurrentLevel < this.Config.MaxLevel)
|
if (this.PlayerData.CurrentLevel < this.Config.MaxLevel)
|
||||||
{
|
{
|
||||||
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel)
|
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel && this.PlayerData.CurrentLevel<this.Config.MaxLevel)
|
||||||
{
|
{
|
||||||
this.PlayerData.CurrentLevel += 1;
|
this.PlayerData.CurrentLevel += 1;
|
||||||
this.PlayerData.CurrentExp = this.PlayerData.CurrentExp - this.PlayerData.ExpToNextLevel;
|
this.PlayerData.CurrentExp = this.PlayerData.CurrentExp - this.PlayerData.ExpToNextLevel;
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"Name": "Build Endurance",
|
"Name": "Build Endurance",
|
||||||
"Author": "Alpha_Omegasis",
|
"Author": "Alpha_Omegasis",
|
||||||
"Version": "1.8.0",
|
"Version": "1.8.2",
|
||||||
"Description": "Increase your health as you play.",
|
"Description": "Increase your health as you play.",
|
||||||
"UniqueID": "Omegasis.BuildEndurance",
|
"UniqueID": "Omegasis.BuildEndurance",
|
||||||
"EntryDll": "BuildEndurance.dll",
|
"EntryDll": "BuildEndurance.dll",
|
||||||
"MinimumApiVersion": "2.10.1",
|
"MinimumApiVersion": "3.0.0",
|
||||||
"UpdateKeys": [ "Nexus:445" ]
|
"UpdateKeys": [ "Nexus:445" ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ namespace Omegasis.BuildHealth
|
||||||
|
|
||||||
if (this.PlayerData.CurrentLevel < this.Config.MaxLevel)
|
if (this.PlayerData.CurrentLevel < this.Config.MaxLevel)
|
||||||
{
|
{
|
||||||
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel)
|
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel && this.PlayerData.CurrentLevel<this.Config.MaxLevel)
|
||||||
{
|
{
|
||||||
this.PlayerData.CurrentLevel += 1;
|
this.PlayerData.CurrentLevel += 1;
|
||||||
this.PlayerData.CurrentExp = this.PlayerData.CurrentExp - this.PlayerData.ExpToNextLevel;
|
this.PlayerData.CurrentExp = this.PlayerData.CurrentExp - this.PlayerData.ExpToNextLevel;
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"Name": "Build Health",
|
"Name": "Build Health",
|
||||||
"Author": "Alpha_Omegasis",
|
"Author": "Alpha_Omegasis",
|
||||||
"Version": "1.8.0",
|
"Version": "1.8.1",
|
||||||
"Description": "Increase your health as you play.",
|
"Description": "Increase your health as you play.",
|
||||||
"UniqueID": "Omegasis.BuildHealth",
|
"UniqueID": "Omegasis.BuildHealth",
|
||||||
"EntryDll": "BuildHealth.dll",
|
"EntryDll": "BuildHealth.dll",
|
||||||
"MinimumApiVersion": "2.10.1",
|
"MinimumApiVersion": "3.0.0",
|
||||||
"UpdateKeys": [ "Nexus:446" ]
|
"UpdateKeys": [ "Nexus:446" ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|
|
@ -92,8 +92,8 @@ namespace Omegasis.BuyBackCollectables.Framework
|
||||||
this.Collections.Add(BuyBackMenu.MineralsTab, new List<List<ClickableTextureComponent>>());
|
this.Collections.Add(BuyBackMenu.MineralsTab, new List<List<ClickableTextureComponent>>());
|
||||||
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.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<List<ClickableTextureComponent>>());
|
this.Collections.Add(BuyBackMenu.CookingTab, new List<List<ClickableTextureComponent>>());
|
||||||
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.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<List<ClickableTextureComponent>>());
|
//this.Collections.Add(BuyBackMenu.AchievementsTab, new List<List<ClickableTextureComponent>>());
|
||||||
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.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);
|
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[] array = new int[this.SideTabs.Count];
|
||||||
|
@ -155,8 +155,9 @@ namespace Omegasis.BuyBackCollectables.Framework
|
||||||
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));
|
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]++;
|
array[selectedTab]++;
|
||||||
}
|
}
|
||||||
if (this.Collections[5].Count == 0)
|
/*
|
||||||
this.Collections[5].Add(new List<ClickableTextureComponent>());
|
//if (this.Collections[5].Count == 0)
|
||||||
|
//this.Collections[5].Add(new List<ClickableTextureComponent>());
|
||||||
foreach (KeyValuePair<int, string> current2 in Game1.achievements)
|
foreach (KeyValuePair<int, string> current2 in Game1.achievements)
|
||||||
{
|
{
|
||||||
bool flag = Game1.player.achievements.Contains(current2.Key);
|
bool flag = Game1.player.achievements.Contains(current2.Key);
|
||||||
|
@ -169,6 +170,7 @@ namespace Omegasis.BuyBackCollectables.Framework
|
||||||
array[5]++;
|
array[5]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -221,9 +223,9 @@ namespace Omegasis.BuyBackCollectables.Framework
|
||||||
}
|
}
|
||||||
foreach (ClickableTextureComponent current2 in this.Collections[this.CurrentTab][this.CurrentPage])
|
foreach (ClickableTextureComponent current2 in this.Collections[this.CurrentTab][this.CurrentPage])
|
||||||
{
|
{
|
||||||
if (current2.containsPoint(x, y) && this.NewItem != null && Game1.player.money >= this.Value)
|
if (current2.containsPoint(x, y) && this.NewItem != null && Game1.player.Money >= this.Value)
|
||||||
{
|
{
|
||||||
Game1.player.money -= this.Value;
|
Game1.player.Money -= this.Value;
|
||||||
Game1.playSound("coin");
|
Game1.playSound("coin");
|
||||||
Game1.player.addItemByMenuIfNecessary(this.NewItem);
|
Game1.player.addItemByMenuIfNecessary(this.NewItem);
|
||||||
}
|
}
|
||||||
|
@ -236,9 +238,9 @@ namespace Omegasis.BuyBackCollectables.Framework
|
||||||
/// <param name="playSound">Whether to enable sound.</param>
|
/// <param name="playSound">Whether to enable sound.</param>
|
||||||
public override void receiveRightClick(int x, int y, bool playSound = true)
|
public override void receiveRightClick(int x, int y, bool playSound = true)
|
||||||
{
|
{
|
||||||
if (this.NewItem != null && Game1.player.money >= this.Value)
|
if (this.NewItem != null && Game1.player.Money >= this.Value)
|
||||||
{
|
{
|
||||||
Game1.player.money -= this.Value;
|
Game1.player.Money -= this.Value;
|
||||||
Game1.player.addItemByMenuIfNecessary(this.NewItem);
|
Game1.player.addItemByMenuIfNecessary(this.NewItem);
|
||||||
Game1.playSound("coin");
|
Game1.playSound("coin");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"Name": "Buy Back Collectables",
|
"Name": "Buy Back Collectables",
|
||||||
"Author": "Alpha_Omegasis",
|
"Author": "Alpha_Omegasis",
|
||||||
"Version": "1.7.0",
|
"Version": "1.8.0",
|
||||||
"Description": "Lets you buy back any obtained collectable.",
|
"Description": "Lets you buy back any obtained collectable.",
|
||||||
"UniqueID": "Omegasis.BuyBackCollectables",
|
"UniqueID": "Omegasis.BuyBackCollectables",
|
||||||
"EntryDll": "BuyBackCollectables.dll",
|
"EntryDll": "BuyBackCollectables.dll",
|
||||||
"MinimumApiVersion": "2.10.1",
|
"MinimumApiVersion": "3.0.0",
|
||||||
"UpdateKeys": [ "Nexus:507" ]
|
"UpdateKeys": [ "Nexus:507" ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"Name": "Fall 28 Snow Day",
|
"Name": "Fall 28 Snow Day",
|
||||||
"Author": "Alpha_Omegasis",
|
"Author": "Alpha_Omegasis",
|
||||||
"Version": "1.7.0",
|
"Version": "1.7.1",
|
||||||
"Description": "Makes it snow on Fall 28, which makes a good explanation for all the snow on the next day.",
|
"Description": "Makes it snow on Fall 28, which makes a good explanation for all the snow on the next day.",
|
||||||
"UniqueID": "Omegasis.Fall28SnowDay",
|
"UniqueID": "Omegasis.Fall28SnowDay",
|
||||||
"EntryDll": "Fall28SnowDay.dll",
|
"EntryDll": "Fall28SnowDay.dll",
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
using StardewValley;
|
|
||||||
|
|
||||||
namespace Omegasis.HappyBirthday
|
|
||||||
{
|
|
||||||
// TODO: Make all the events
|
|
||||||
// Resources:https://stardewvalleywiki.com/Modding:Event_data
|
|
||||||
public class BirthdayEvents
|
|
||||||
{
|
|
||||||
public Event communityCenterJunimoEvent;
|
|
||||||
public Event marriedNoKidsEvent;
|
|
||||||
public Event surpriseBirthdayPartyEvent;
|
|
||||||
public Event marriedWithOneKidEvent;
|
|
||||||
public Event marriedWithTwoKidsEvent;
|
|
||||||
|
|
||||||
public BirthdayEvents()
|
|
||||||
{
|
|
||||||
this.initializeEvents();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initializeEvents()
|
|
||||||
{
|
|
||||||
Event e = new Event("", -1, Game1.player);
|
|
||||||
Game1.player.currentLocation.currentEvent = new Event();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,35 +0,0 @@
|
||||||
{
|
|
||||||
"Robin": "嘿,@,生日快乐!我很高兴你选择搬到这里来。",
|
|
||||||
"Demetrius": "生日快乐@!记得偶尔要抽出时间来好好享受一下。$h",
|
|
||||||
"Maru": "生日快乐@。我本来想给我做个永恒不灭的蜡烛,但是好像行不通。也许明年再给你吧?$h",
|
|
||||||
"Sebastian": "生日快乐@。又是平静的一年。",
|
|
||||||
"Linus": "生日快乐@。谢谢你在你生日的这天依旧来看我。这让我很开心。",
|
|
||||||
"Pierre": "嘿@,生日快乐!希望你的下一年会更好!",
|
|
||||||
"Caroline": "生日快乐@。谢谢你为这个社区做的一切。我相信你的父母一定都很为你骄傲。$h",
|
|
||||||
"Abigail": "生日快乐@!希望之后的一年我们可以一起去更多的地方冒险!$h",
|
|
||||||
"Alex": "哟@,生日快乐!也许这会是你有生以来最棒的一年。$h",
|
|
||||||
"George": "等你到我的年纪,生日就像其他的日子一样来去匆匆。不过还是祝你生日快乐,@。",
|
|
||||||
"Evelyn": "生日快乐@。你成长成为了一个优秀的人,我相信你还会继续成长的。",
|
|
||||||
"Lewis": "生日快乐@!我很感激你为这个小镇做的一切,我相信你爷爷也会为你骄傲的。",
|
|
||||||
"Clint": "嘿生日快乐@。我相信接下来对你来说会是很棒的一年。",
|
|
||||||
"Penny": "生日快乐@。希望你这一年都能得到所有的祝福。",
|
|
||||||
"Pam": "生日快乐孩子。我们应该一起去喝一杯,庆祝你生命的又一年。",
|
|
||||||
"Emily": "我今天感受到了很多关于你的正能量,所以一定是你的生日到了。生日快乐@!$h",
|
|
||||||
"Haley": "生日快乐@。希望你今年能收到些很棒的礼物!$h",
|
|
||||||
"Jas": "生日快乐@。希望你过个愉快的生日。",
|
|
||||||
"Vincent": "嘿@,你是来玩的……哦今天是你的生日?生日快乐!",
|
|
||||||
"Jodi": "你好啊@。听说今天是你的生日。既然如此,祝你生日快乐!$h",
|
|
||||||
"Kent": "乔迪告诉我今天是你的生日,@。生日快乐,记得要珍惜每一天。",
|
|
||||||
"Sam": "哟@,生日快乐!有机会我们来给你办个生日派对吧!$h",
|
|
||||||
"Leah": "嘿@,生日快乐!我们今晚去酒吧庆祝一下吧!$h",
|
|
||||||
"Shane": "生日快乐@。继续努力工作,我相信你接下来的这一年会更好。",
|
|
||||||
"Marnie": "你好@。今天大家都在谈论你的生日,我也想跟你说一声生日快乐,那么,生日快乐!$h",
|
|
||||||
"Elliott": "真是美好的一天不是吗,@?尤其今天是你的生日。我本想给你写一首诗,但我觉得简单的才是最好的,生日快乐。$h",
|
|
||||||
"Gus": "嘿@,生日快乐!希望你今天过得愉快,酒吧永远都欢迎你!",
|
|
||||||
"Dwarf": "生日快乐@。我希望我给你的东西是人类可以接受的。",
|
|
||||||
"Wizard": "有精灵告诉我今天是你的生日。这么说,生日快乐@。希望你下一年辉煌灿烂!",
|
|
||||||
"Harvey": "嘿@,生日快乐!有空记得到我这来做检查,这能让你多活很多年!",
|
|
||||||
"Sandy": "你好啊@。我听说今天是你的生日,我可不想让你觉得被冷落了。生日快乐!",
|
|
||||||
"Willy": "哎@,生日快乐。看到你让我想起了我曾经一个人漂在海上的日子。继续享受青春吧年轻人。$h",
|
|
||||||
"Krobus": "我听说在别人生日的时候送一份礼物是传统。那么,生日快乐@。"
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
{
|
|
||||||
"Robin": "Hey @, happy birthday! I'm glad you choose this town to move here to. ",
|
|
||||||
"Demetrius": "Happy birthday @! Make sure you take some time off today to enjoy yourself. $h",
|
|
||||||
"Maru": "Happy birthday @. I tried to make you an everlasting candle for you, but sadly that didn't work out. Maybe next year right? $h",
|
|
||||||
"Sebastian": "Happy birthday @. Here's to another year of chilling. ",
|
|
||||||
"Linus": "Happy birthday @. Thanks for visiting me even on your birthday. It makes me really happy. ",
|
|
||||||
"Pierre": "Hey @, happy birthday! Hopefully this next year for you will be a great one! ",
|
|
||||||
"Caroline": "Happy birthday @. Thank you for all that you've done for our community. I'm sure your parents must be proud of you.$h",
|
|
||||||
"Abigail": "Happy birthday @! Hopefully this year we can go on even more adventures together $h!",
|
|
||||||
"Alex": "Yo @, happy birthday! Maybe this will be your best year yet.$h",
|
|
||||||
"George": "When you get to my age birthdays come and go. Still happy birthday @.",
|
|
||||||
"Evelyn": "Happy birthday @. You have grown up to be such a fine individual and I'm sure you'll continue to grow. ",
|
|
||||||
"Lewis": "Happy birthday @! I'm thankful for what you have done for the town and I'm sure your grandfather would be proud of you.",
|
|
||||||
"Clint": "Hey happy birthday @. I'm sure this year is going to be great for you.",
|
|
||||||
"Penny": "Happy birthday @. May you enjoy all of life's blessings this year. ",
|
|
||||||
"Pam": "Happy birthday kid. We should have a drink to celebrate another year of life for you! $h",
|
|
||||||
"Emily": "I'm sensing a strong positive life energy about you, so it must be your birthday. Happy birthday @!$h",
|
|
||||||
"Haley": "Happy birthday @. Hopefully this year you'll get some good presents!$h",
|
|
||||||
"Jas": "Happy birthday @. I hope you have a good birthday.",
|
|
||||||
"Vincent": "Hey @ have you come to pl...oh it's your birthday? Happy birthday! ",
|
|
||||||
"Jodi": "Hello there @. Rumor has it that today is your birthday. In that case, happy birthday!$h",
|
|
||||||
"Kent": "Jodi told me that it was your birthday today @. Happy birthday and make sure to cherish every single day.",
|
|
||||||
"Sam": "Yo @ happy birthday! We'll have to have a birthday jam session for you some time!$h ",
|
|
||||||
"Leah": "Hey @ happy birthday! We should go to the saloon tonight and celebrate!$h ",
|
|
||||||
"Shane": "Happy birthday @. Keep working hard and I'm sure this next year for you will be a great one.",
|
|
||||||
"Marnie": "Hello there @. Everyone is talking about your birthday today and I wanted to make sure that I wished you a happy birthday as well, so happy birthday! $h ",
|
|
||||||
"Elliott": "What a wonderful day isn't it @? Especially since today is your birthday. I tried to make you a poem but I feel like the best way of putting it is simply, happy birthday. $h ",
|
|
||||||
"Gus": "Hey @ happy birthday! Hopefully you enjoy the rest of the day and make sure you aren't a stranger at the saloon!",
|
|
||||||
"Dwarf": "Happy birthday @. I hope that what I got you is acceptable for humans as well. ",
|
|
||||||
"Wizard": "The spirits told me that today is your birthday. In that case happy birthday @. May your year shine bright! ",
|
|
||||||
"Harvey": "Hey @, happy birthday! Make sure to come in for a checkup some time to make sure you live many more years! ",
|
|
||||||
"Sandy": "Hello there @. I heard that today was your birthday and I didn't want you feeling left out, so happy birthday!",
|
|
||||||
"Willy": "Aye @ happy birthday. Looking at you reminds me of ye days when I was just a guppy swimming out to sea. Continue to enjoy them youngin.$h",
|
|
||||||
"Krobus": "I have heard that it is tradition to give a gift to others on their birthday. In that case, happy birthday @."
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"Mail:birthdayMom": "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 %%",
|
|
||||||
"Mail:birthdayDad": "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 %%",
|
|
||||||
"Happy Birthday: Star Message": "It's your birthday today! Happy birthday!",
|
|
||||||
"Happy Birthday: Farmhand Birthday Message": "It's @'s birthday! Happy birthday to them!"
|
|
||||||
}
|
|
|
@ -0,0 +1,811 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Omegasis.HappyBirthday.Framework.EventPreconditions;
|
||||||
|
using StardustCore.Events;
|
||||||
|
using StardustCore.Events.Preconditions;
|
||||||
|
using StardustCore.Events.Preconditions.TimeSpecific;
|
||||||
|
using StardewValley;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using StardustCore.Events.Preconditions.PlayerSpecific;
|
||||||
|
|
||||||
|
namespace Omegasis.HappyBirthday.Framework
|
||||||
|
{
|
||||||
|
public class BirthdayEvents
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates the junimo birthday party event.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static EventHelper CommunityCenterJunimoBirthday()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
conditions.Add(new CanReadJunimo());
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.PlayerSpecific.JojaMember(false));
|
||||||
|
conditions.Add(new CommunityCenterCompleted(false));
|
||||||
|
//conditions.Add(new HasUnlockedCommunityCenter()); //Infered by the fact that you must enter the community center to trigger this event anyways.
|
||||||
|
EventHelper e = new EventHelper("CommunityCenterBirthday", 19950, conditions, new EventStartData("playful", 32, 12, new EventStartData.FarmerData(32, 22, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>()));
|
||||||
|
|
||||||
|
e.AddInJunimoActor("Juni", new Microsoft.Xna.Framework.Vector2(32, 10), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
|
||||||
|
e.AddInJunimoActor("Juni2", new Microsoft.Xna.Framework.Vector2(30, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
|
||||||
|
e.AddInJunimoActor("Juni3", new Microsoft.Xna.Framework.Vector2(34, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
|
||||||
|
e.AddInJunimoActor("Juni4", new Microsoft.Xna.Framework.Vector2(26, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
|
||||||
|
e.AddInJunimoActor("Juni5", new Microsoft.Xna.Framework.Vector2(28, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
|
||||||
|
e.AddInJunimoActor("Juni6Tank", new Vector2(38, 10), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
|
||||||
|
e.AddInJunimoActor("Juni7", new Vector2(27, 16), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
|
||||||
|
e.AddInJunimoActor("Juni8", new Vector2(40, 15), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
|
||||||
|
e.AddJunimoAdvanceMoveTiles(new StardustCore.Utilities.JunimoAdvanceMoveData("Juni6Tank", new List<Point>()
|
||||||
|
{
|
||||||
|
new Point(38,10),
|
||||||
|
new Point(38,11),
|
||||||
|
new Point(39,11),
|
||||||
|
new Point(40,11),
|
||||||
|
new Point(41,11),
|
||||||
|
new Point(42,11),
|
||||||
|
new Point(42,10),
|
||||||
|
new Point(41,10),
|
||||||
|
new Point(40,10),
|
||||||
|
new Point(39,10),
|
||||||
|
|
||||||
|
}, 60, 1, true)); ;
|
||||||
|
|
||||||
|
e.FlipJunimoActor("Juni5", true);
|
||||||
|
e.junimoFaceDirection("Juni4", EventHelper.FacingDirection.Right); //Make a junimo face right.
|
||||||
|
e.junimoFaceDirection("Juni5", EventHelper.FacingDirection.Left);
|
||||||
|
e.junimoFaceDirection("Juni7", EventHelper.FacingDirection.Down);
|
||||||
|
e.animate("Juni", true, true, 250, new List<int>()
|
||||||
|
{
|
||||||
|
28,
|
||||||
|
29,
|
||||||
|
30,
|
||||||
|
31
|
||||||
|
});
|
||||||
|
e.animate("Juni7", false, true, 250, new List<int>()
|
||||||
|
{
|
||||||
|
44,45,46,47
|
||||||
|
});
|
||||||
|
e.animate("Juni8", false, true, 250, new List<int>()
|
||||||
|
{
|
||||||
|
12,13,14,15
|
||||||
|
});
|
||||||
|
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
e.moveFarmerUp(10, EventHelper.FacingDirection.Up, true);
|
||||||
|
|
||||||
|
e.junimoFaceDirection("Juni4", EventHelper.FacingDirection.Down);
|
||||||
|
e.junimoFaceDirection("Juni5", EventHelper.FacingDirection.Down);
|
||||||
|
e.RemoveJunimoAdvanceMove("Juni6Tank");
|
||||||
|
e.junimoFaceDirection("Juni6Tank", EventHelper.FacingDirection.Down);
|
||||||
|
e.junimoFaceDirection("Juni7", EventHelper.FacingDirection.Right);
|
||||||
|
e.FlipJunimoActor("Juni8", true);
|
||||||
|
e.junimoFaceDirection("Juni8", EventHelper.FacingDirection.Left);
|
||||||
|
|
||||||
|
e.playSound("junimoMeep1");
|
||||||
|
|
||||||
|
e.emoteFarmer_ExclamationMark();
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:JunimoBirthdayParty_0"));
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:JunimoBirthdayParty_1"));
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.addObjectToPlayersInventory(220, 1, false);
|
||||||
|
|
||||||
|
e.end();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Birthday event for when the player is dating Penny.
|
||||||
|
/// Status: Completed.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static EventHelper DatingBirthday_Penny()
|
||||||
|
{
|
||||||
|
|
||||||
|
NPC penny = Game1.getCharacterFromName("Penny");
|
||||||
|
NPC pam = Game1.getCharacterFromName("Pam");
|
||||||
|
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("Trailer")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(penny));
|
||||||
|
|
||||||
|
//conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(Game1.getCharacterFromName("Penny"));
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Penny", 19951, conditions, new EventStartData("playful", 12, 8, new EventStartData.FarmerData(12, 9, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(penny,12,7, EventHelper.FacingDirection.Up),
|
||||||
|
new EventStartData.NPCData(pam,15,4, EventHelper.FacingDirection.Down)
|
||||||
|
}));
|
||||||
|
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
e.moveFarmerUp(1, EventHelper.FacingDirection.Up, false);
|
||||||
|
|
||||||
|
e.actorFaceDirection("Penny", EventHelper.FacingDirection.Down);
|
||||||
|
//starting = starting.Replace("@", Game1.player.Name);
|
||||||
|
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:0"));
|
||||||
|
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:0"));
|
||||||
|
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:1"));
|
||||||
|
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:1"));
|
||||||
|
e.emote_Angry("Penny");
|
||||||
|
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:2")); //penny2
|
||||||
|
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:3")); //penny3
|
||||||
|
|
||||||
|
e.moveActorLeft("Penny", 3, EventHelper.FacingDirection.Up, true);
|
||||||
|
e.moveFarmerRight(2, EventHelper.FacingDirection.Up, false);
|
||||||
|
e.moveFarmerUp(3, EventHelper.FacingDirection.Down, false);
|
||||||
|
e.moveActorRight("Penny", 5, EventHelper.FacingDirection.Up, true);
|
||||||
|
e.moveActorUp("Penny", 1, EventHelper.FacingDirection.Up, true);
|
||||||
|
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:2")); //pam2
|
||||||
|
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:4"));//penny4
|
||||||
|
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Penny");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Finish:0")); //penny party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Finish:1"));// penny party finish 1
|
||||||
|
e.addObjectToPlayersInventory(220, 1, false);
|
||||||
|
e.addObjectToPlayersInventory(346, 1, false);
|
||||||
|
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
|
||||||
|
e.end();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EventHelper DatingBirthday_Penny_BigHome()
|
||||||
|
{
|
||||||
|
|
||||||
|
NPC penny = Game1.getCharacterFromName("Penny");
|
||||||
|
NPC pam = Game1.getCharacterFromName("Pam");
|
||||||
|
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("Trailer_Big")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(penny));
|
||||||
|
|
||||||
|
//conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(Game1.getCharacterFromName("Penny"));
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Penny_BigHome", 19951, conditions, new EventStartData("playful", 14, 8, new EventStartData.FarmerData(12, 11, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(penny,12,7, EventHelper.FacingDirection.Up),
|
||||||
|
new EventStartData.NPCData(pam,15,4, EventHelper.FacingDirection.Down)
|
||||||
|
}));
|
||||||
|
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
e.moveFarmerUp(3, EventHelper.FacingDirection.Up, false);
|
||||||
|
|
||||||
|
e.actorFaceDirection("Penny", EventHelper.FacingDirection.Down);
|
||||||
|
//starting = starting.Replace("@", Game1.player.Name);
|
||||||
|
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:0"));
|
||||||
|
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:0"));
|
||||||
|
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:1"));
|
||||||
|
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:1"));
|
||||||
|
e.emote_Angry("Penny");
|
||||||
|
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:2")); //penny2
|
||||||
|
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:3")); //penny3
|
||||||
|
|
||||||
|
e.moveActorLeft("Penny", 3, EventHelper.FacingDirection.Up, true);
|
||||||
|
e.moveFarmerRight(2, EventHelper.FacingDirection.Up, false);
|
||||||
|
e.moveFarmerUp(3, EventHelper.FacingDirection.Down, false);
|
||||||
|
e.moveActorRight("Penny", 5, EventHelper.FacingDirection.Up, true);
|
||||||
|
e.moveActorUp("Penny", 1, EventHelper.FacingDirection.Up, true);
|
||||||
|
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:2")); //pam2
|
||||||
|
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:4"));//penny4
|
||||||
|
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Penny");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Finish:0")); //penny party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Finish:1"));// penny party finish 1
|
||||||
|
e.addObjectToPlayersInventory(220, 1, false);
|
||||||
|
e.addObjectToPlayersInventory(346, 1, false);
|
||||||
|
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
|
||||||
|
e.end();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Birthday event for when the player is dating Maru.
|
||||||
|
/// Finished.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static EventHelper DatingBirthday_Maru()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("ScienceHouse")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC maru = Game1.getCharacterFromName("Maru");
|
||||||
|
NPC sebastian = Game1.getCharacterFromName("Sebastian");
|
||||||
|
NPC robin = Game1.getCharacterFromName("Robin");
|
||||||
|
NPC demetrius = Game1.getCharacterFromName("Demetrius");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(maru));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Maru", 19952, conditions, new EventStartData("playful", 28, 12, new EventStartData.FarmerData(23, 12, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(maru,27,11, EventHelper.FacingDirection.Down),
|
||||||
|
new EventStartData.NPCData(sebastian,26,13, EventHelper.FacingDirection.Up),
|
||||||
|
new EventStartData.NPCData(robin,28,9, EventHelper.FacingDirection.Up),
|
||||||
|
new EventStartData.NPCData(demetrius,30,11, EventHelper.FacingDirection.Left)
|
||||||
|
}));
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
e.moveFarmerRight(3, EventHelper.FacingDirection.Right, true);
|
||||||
|
e.npcFaceDirection(maru, EventHelper.FacingDirection.Left);
|
||||||
|
e.npcFaceDirection(demetrius, EventHelper.FacingDirection.Left);
|
||||||
|
//Seb is already facing up.
|
||||||
|
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
|
||||||
|
|
||||||
|
//Dialogue goes here.
|
||||||
|
//Seriously improve dialogue lines. Maru is probably the NPC I know the least about.
|
||||||
|
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:0")); //maru 0
|
||||||
|
e.speak(demetrius, GetTranslatedString("Event:DatingMaruBirthday_Demetrius:0")); //demetrius 0
|
||||||
|
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:1"));//Maru 1 //Spoiler she doesn't.
|
||||||
|
e.speak(sebastian, GetTranslatedString("Event:DatingMaruBirthday_Sebastian:0")); //sebastian 0
|
||||||
|
e.speak(robin, GetTranslatedString("Event:DatingMaruBirthday_Robin:0")); //robin 0
|
||||||
|
e.speak(demetrius, GetTranslatedString("Event:DatingMaruBirthday_Demetrius:1")); //demetrius 1
|
||||||
|
e.emote_ExclamationMark("Robin");
|
||||||
|
e.npcFaceDirection(robin, EventHelper.FacingDirection.Up);
|
||||||
|
e.speak(robin, GetTranslatedString("Event:DatingMaruBirthday_Robin:1")); //robin 1
|
||||||
|
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
|
||||||
|
e.moveActorDown("Robin", 1, EventHelper.FacingDirection.Down, false);
|
||||||
|
e.addObject(27, 12, 220);
|
||||||
|
|
||||||
|
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:2")); //maru 2
|
||||||
|
e.emoteFarmer_Thinking();
|
||||||
|
e.speak(sebastian, GetTranslatedString("Event:DatingMaruBirthday_Sebastian:1")); //Sebastian 1
|
||||||
|
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:3")); //maru 3
|
||||||
|
|
||||||
|
//Event finish commands.
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Maru");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingMaruBirthday_Finish:0")); //maru party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingMaruBirthday_Finish:1")); //maru party finish 0
|
||||||
|
e.addObjectToPlayersInventory(220, 1, false);
|
||||||
|
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Birthday event for when the player is dating Leah.
|
||||||
|
/// Finished.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static EventHelper DatingBirthday_Leah()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("LeahHouse")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC leah = Game1.getCharacterFromName("Leah");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(leah));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Leah", 19954, conditions, new EventStartData("playful", 12, 7, new EventStartData.FarmerData(7, 9, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(leah,14,11, EventHelper.FacingDirection.Left),
|
||||||
|
}));
|
||||||
|
e.addObject(11, 11, 220);
|
||||||
|
e.globalFadeIn();
|
||||||
|
e.moveFarmerUp(2, EventHelper.FacingDirection.Up, false);
|
||||||
|
e.moveFarmerRight(5, EventHelper.FacingDirection.Down, false);
|
||||||
|
e.npcFaceDirection(leah, EventHelper.FacingDirection.Up);
|
||||||
|
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:0")); //0
|
||||||
|
e.moveFarmerDown(2, EventHelper.FacingDirection.Down, false);
|
||||||
|
e.moveFarmerRight(1, EventHelper.FacingDirection.Down, false);
|
||||||
|
e.moveFarmerDown(1, EventHelper.FacingDirection.Down, false);
|
||||||
|
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:1")); //1
|
||||||
|
e.emoteFarmer_Happy();
|
||||||
|
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:2"));//2
|
||||||
|
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:3"));//3
|
||||||
|
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:4"));//4
|
||||||
|
|
||||||
|
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Leah");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingLeahBirthday_Finish:0")); //maru party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingLeahBirthday_Finish:1")); //maru party finish 0
|
||||||
|
e.addObjectToPlayersInventory(220, 1, false);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Birthday event for when the player is dating Abigail.
|
||||||
|
/// Finished.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static EventHelper DatingBirthday_Abigail()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("SeedShop")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC abigail = Game1.getCharacterFromName("Abigail");
|
||||||
|
NPC pierre = Game1.getCharacterFromName("Pierre");
|
||||||
|
NPC caroline = Game1.getCharacterFromName("Caroline");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(abigail));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Abigail", 19955, conditions, new EventStartData("playful", 35, 7, new EventStartData.FarmerData(31, 11, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(abigail,36,9, EventHelper.FacingDirection.Left),
|
||||||
|
new EventStartData.NPCData(pierre,33,6, EventHelper.FacingDirection.Down),
|
||||||
|
new EventStartData.NPCData(caroline,35,5, EventHelper.FacingDirection.Up),
|
||||||
|
}));
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
//Dialogue here.
|
||||||
|
e.moveFarmerUp(2, EventHelper.FacingDirection.Right, false);
|
||||||
|
e.moveFarmerRight(4, EventHelper.FacingDirection.Right, false);
|
||||||
|
|
||||||
|
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:0")); //abi 0
|
||||||
|
|
||||||
|
e.npcFaceDirection(caroline, EventHelper.FacingDirection.Down);
|
||||||
|
|
||||||
|
e.speak(pierre, GetTranslatedString("Event:DatingAbigailBirthday_Pierre:0")); //pie 0
|
||||||
|
e.speak(caroline, GetTranslatedString("Event:DatingAbigailBirthday_Caroline:0")); //car 0
|
||||||
|
e.addObject(35, 5, 220);
|
||||||
|
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:1")); //abi 1
|
||||||
|
e.speak(pierre, GetTranslatedString("Event:DatingAbigailBirthday_Pierre:1")); //pie 1
|
||||||
|
e.speak(caroline, GetTranslatedString("Event:DatingAbigailBirthday_Caroline:1")); //car 1
|
||||||
|
e.speak(caroline, GetTranslatedString("Event:DatingAbigailBirthday_Caroline:2")); //car 2
|
||||||
|
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:2")); //abi 2
|
||||||
|
e.emoteFarmer_Thinking();
|
||||||
|
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:3"));//abi 3
|
||||||
|
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:4"));///abi 4
|
||||||
|
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Abigail");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAbigailBirthday_Finish:0")); //abi party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAbigailBirthday_Finish:1")); //abi party finish 0
|
||||||
|
e.addObjectToPlayersInventory(220, 1, false);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static EventHelper DatingBirthday_Emily()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("HaleyHouse")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC emily = Game1.getCharacterFromName("Emily");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(emily));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Emily", 19956, conditions, new EventStartData("playful", 20, 18, new EventStartData.FarmerData(11, 20, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(emily,20,17, EventHelper.FacingDirection.Down),
|
||||||
|
}));
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
//Dialogue here.
|
||||||
|
e.moveFarmerRight(9, EventHelper.FacingDirection.Up, false);
|
||||||
|
|
||||||
|
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:0")); //emi 0
|
||||||
|
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:1")); //emi 0
|
||||||
|
e.emoteFarmer_Happy();
|
||||||
|
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:2")); //emi 0
|
||||||
|
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:3")); //emi 0
|
||||||
|
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:4")); //emi 0
|
||||||
|
e.emoteFarmer_Thinking();
|
||||||
|
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:5")); //emi 0
|
||||||
|
|
||||||
|
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Emily");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingEmilyBirthday_Finish:0")); //abi party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingEmilyBirthday_Finish:1")); //abi party finish 0
|
||||||
|
e.addObjectToPlayersInventory(220, 1, false);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static EventHelper DatingBirthday_Haley()
|
||||||
|
{
|
||||||
|
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("HaleyHouse")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC haley = Game1.getCharacterFromName("Haley");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(haley));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Haley", 19957, conditions, new EventStartData("playful", 20, 18, new EventStartData.FarmerData(11, 20, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(haley,20,17, EventHelper.FacingDirection.Down),
|
||||||
|
}));
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
//Dialogue here.
|
||||||
|
e.moveFarmerRight(9, EventHelper.FacingDirection.Up, false);
|
||||||
|
|
||||||
|
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:0"));
|
||||||
|
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:1"));
|
||||||
|
e.emoteFarmer_Happy();
|
||||||
|
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:2"));
|
||||||
|
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:3"));
|
||||||
|
e.emoteFarmer_Thinking();
|
||||||
|
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:4"));
|
||||||
|
|
||||||
|
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Haley");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHaleyBirthday_Finish:0")); //abi party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHaleyBirthday_Finish:1")); //abi party finish 0
|
||||||
|
e.addObjectToPlayersInventory(221, 1, false);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EventHelper DatingBirthday_Sam()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("SamHouse")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC sam = Game1.getCharacterFromName("Sam");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(sam));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Sam", 19959, conditions, new EventStartData("playful", 3, 6, new EventStartData.FarmerData(7, 9, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(sam,3,5, EventHelper.FacingDirection.Down),
|
||||||
|
}));
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
//Dialogue here.
|
||||||
|
e.moveFarmerUp(4, EventHelper.FacingDirection.Up, false);
|
||||||
|
e.moveFarmerLeft(3, EventHelper.FacingDirection.Left, false);
|
||||||
|
e.npcFaceDirection(sam, EventHelper.FacingDirection.Right);
|
||||||
|
|
||||||
|
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:0"));
|
||||||
|
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:1"));
|
||||||
|
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:2"));
|
||||||
|
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:3"));
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Sam");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSamBirthday_Finish:0")); //sam party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSamBirthday_Finish:1")); //sam party finish 0
|
||||||
|
e.addObjectToPlayersInventory(206, 1, false);
|
||||||
|
e.addObjectToPlayersInventory(167, 1, false);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event that occurs when the player is dating Sebastian.
|
||||||
|
/// Status: Finished.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static EventHelper DatingBirthday_Sebastian()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("ScienceHouse")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC maru = Game1.getCharacterFromName("Maru");
|
||||||
|
NPC sebastian = Game1.getCharacterFromName("Sebastian");
|
||||||
|
NPC robin = Game1.getCharacterFromName("Robin");
|
||||||
|
NPC demetrius = Game1.getCharacterFromName("Demetrius");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(sebastian));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Sebastian", 19952, conditions, new EventStartData("playful", 28, 12, new EventStartData.FarmerData(23, 12, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(maru,27,11, EventHelper.FacingDirection.Down),
|
||||||
|
new EventStartData.NPCData(sebastian,26,13, EventHelper.FacingDirection.Up),
|
||||||
|
new EventStartData.NPCData(robin,28,9, EventHelper.FacingDirection.Up),
|
||||||
|
new EventStartData.NPCData(demetrius,30,11, EventHelper.FacingDirection.Left)
|
||||||
|
}));
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
e.moveFarmerRight(3, EventHelper.FacingDirection.Right, true);
|
||||||
|
e.npcFaceDirection(maru, EventHelper.FacingDirection.Left);
|
||||||
|
e.npcFaceDirection(demetrius, EventHelper.FacingDirection.Left);
|
||||||
|
//Seb is already facing up.
|
||||||
|
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
|
||||||
|
|
||||||
|
//Dialogue goes here.
|
||||||
|
//Seriously improve dialogue lines. Maru is probably the NPC I know the least about.
|
||||||
|
e.speak(sebastian, GetTranslatedString("Event:DatingSebastianBirthday_Sebastian:0")); //sebastian 0
|
||||||
|
e.speak(robin, GetTranslatedString("Event:DatingSebastianBirthday_Robin:0")); //maru 0
|
||||||
|
e.speak(maru, GetTranslatedString("Event:DatingSebastianBirthday_Maru:0"));//Maru 0
|
||||||
|
e.speak(robin, GetTranslatedString("Event:DatingSebastianBirthday_Robin:1")); //robin 0
|
||||||
|
e.speak(demetrius, GetTranslatedString("Event:DatingSebastianBirthday_Demetrius:0")); //demetrius 0
|
||||||
|
e.speak(sebastian, GetTranslatedString("Event:DatingSebastianBirthday_Sebastian:1")); //Sebastian 1
|
||||||
|
e.emote_ExclamationMark("Robin");
|
||||||
|
e.npcFaceDirection(robin, EventHelper.FacingDirection.Up);
|
||||||
|
e.speak(robin, GetTranslatedString("Event:DatingSebastianBirthday_Robin:2")); //robin 1
|
||||||
|
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
|
||||||
|
e.moveActorDown("Robin", 1, EventHelper.FacingDirection.Down, false);
|
||||||
|
e.addObject(27, 12, 220);
|
||||||
|
e.speak(demetrius, GetTranslatedString("Event:DatingSebastianBirthday_Demetrius:1")); //maru 2
|
||||||
|
e.emoteFarmer_Thinking();
|
||||||
|
e.speak(maru, GetTranslatedString("Event:DatingSebastianBirthday_Maru:1")); //maru 3
|
||||||
|
e.speak(sebastian, GetTranslatedString("Event:DatingSebastianBirthday_Sebastian:2")); //Sebastian 1
|
||||||
|
|
||||||
|
//Event finish commands.
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Sebastian");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSebastianBirthday_Finish:0")); //maru party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSebastianBirthday_Finish:1")); //maru party finish 0
|
||||||
|
e.addObjectToPlayersInventory(220, 1, false);
|
||||||
|
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static EventHelper DatingBirthday_Elliott()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("ElliottHouse")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC elliott = Game1.getCharacterFromName("Elliott");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(elliott));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Elliott", 19958, conditions, new EventStartData("playful", 3, 5, new EventStartData.FarmerData(3, 8, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(elliott,3,5, EventHelper.FacingDirection.Down),
|
||||||
|
}));
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
//Dialogue here.
|
||||||
|
e.moveFarmerUp(2, EventHelper.FacingDirection.Up, false);
|
||||||
|
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:0"));
|
||||||
|
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:1"));
|
||||||
|
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:2"));
|
||||||
|
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:3"));
|
||||||
|
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:4"));
|
||||||
|
e.emoteFarmer_Thinking();
|
||||||
|
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:5"));
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Elliott");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingElliottBirthday_Finish:0")); //abi party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingElliottBirthday_Finish:1")); //abi party finish 0
|
||||||
|
e.addObjectToPlayersInventory(220, 1, false);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static EventHelper DatingBirthday_Shane()
|
||||||
|
{
|
||||||
|
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("AnimalShop")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC shane = Game1.getCharacterFromName("Shane");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(shane));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Shane", 19960, conditions, new EventStartData("playful", 26, 15, new EventStartData.FarmerData(19, 18, EventHelper.FacingDirection.Left), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(shane,25,16, EventHelper.FacingDirection.Down),
|
||||||
|
}));
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
//Dialogue here.
|
||||||
|
e.moveFarmerRight(3, EventHelper.FacingDirection.Right, false);
|
||||||
|
e.moveFarmerUp(2, EventHelper.FacingDirection.Up, false);
|
||||||
|
e.moveFarmerRight(2, EventHelper.FacingDirection.Right, false);
|
||||||
|
e.npcFaceDirection(shane, EventHelper.FacingDirection.Left);
|
||||||
|
|
||||||
|
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:0"));
|
||||||
|
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:1"));
|
||||||
|
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:2"));
|
||||||
|
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:3"));
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Shane");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingShaneBirthday_Finish:0")); //sam party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingShaneBirthday_Finish:1")); //sam party finish 0
|
||||||
|
e.addObjectToPlayersInventory(206, 1, false);
|
||||||
|
e.addObjectToPlayersInventory(167, 1, false);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EventHelper DatingBirthday_Harvey()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("HarveyRoom")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC harvey = Game1.getCharacterFromName("Harvey");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(harvey));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Harvey", 19957, conditions, new EventStartData("playful", 6, 6, new EventStartData.FarmerData(6, 11, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(harvey,3,6, EventHelper.FacingDirection.Down),
|
||||||
|
}));
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
//Dialogue here.
|
||||||
|
e.moveFarmerUp(5, EventHelper.FacingDirection.Up, false);
|
||||||
|
e.moveFarmerLeft(2, EventHelper.FacingDirection.Left, false);
|
||||||
|
e.npcFaceDirection(harvey, EventHelper.FacingDirection.Right);
|
||||||
|
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:0"));
|
||||||
|
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:1"));
|
||||||
|
e.emoteFarmer_QuestionMark();
|
||||||
|
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:2"));
|
||||||
|
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:3"));
|
||||||
|
|
||||||
|
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Harvey");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHarveyBirthday_Finish:0")); //abi party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHarveyBirthday_Finish:1")); //abi party finish 0
|
||||||
|
e.addObjectToPlayersInventory(237, 1, false);
|
||||||
|
e.addObjectToPlayersInventory(348, 1, false);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static EventHelper DatingBirthday_Alex()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("JoshHouse")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
|
||||||
|
NPC alex = Game1.getCharacterFromName("Alex");
|
||||||
|
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(alex));
|
||||||
|
|
||||||
|
EventHelper e = new EventHelper("BirthdayDating:Alex", 19959, conditions, new EventStartData("playful", 3, 20, new EventStartData.FarmerData(7, 19, EventHelper.FacingDirection.Left), new List<EventStartData.NPCData>() {
|
||||||
|
new EventStartData.NPCData(alex,3,19, EventHelper.FacingDirection.Down),
|
||||||
|
}));
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
//Dialogue here.
|
||||||
|
e.moveFarmerLeft(3, EventHelper.FacingDirection.Left, false);
|
||||||
|
e.npcFaceDirection(alex, EventHelper.FacingDirection.Right);
|
||||||
|
|
||||||
|
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:0"));
|
||||||
|
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:1"));
|
||||||
|
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:2"));
|
||||||
|
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:3"));
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.emote_Heart("Alex");
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAlexBirthday_Finish:0")); //sam party finish 0
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAlexBirthday_Finish:1")); //sam party finish 0
|
||||||
|
e.addObjectToPlayersInventory(206, 1, false);
|
||||||
|
e.addObjectToPlayersInventory(167, 1, false);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.end();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Todo: Finish this.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static EventHelper CommunityBirthday()
|
||||||
|
{
|
||||||
|
List<EventPrecondition> conditions = new List<EventPrecondition>();
|
||||||
|
conditions.Add(new FarmerBirthdayPrecondition());
|
||||||
|
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter")));
|
||||||
|
conditions.Add(new TimePrecondition(600, 2600));
|
||||||
|
conditions.Add(new StardustCore.Events.Preconditions.PlayerSpecific.JojaMember(false));
|
||||||
|
conditions.Add(new CommunityCenterCompleted(true));
|
||||||
|
//conditions.Add(new HasUnlockedCommunityCenter()); //Infered by the fact that you must enter the community center to trigger this event anyways.
|
||||||
|
EventHelper e = new EventHelper("CommunityCenterBirthday", 19961, conditions, new EventStartData("playful", -100, -100, new EventStartData.FarmerData(32, 22, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>()
|
||||||
|
{
|
||||||
|
new EventStartData.NPCData(Game1.getCharacterFromName("Lewis"),32,12, EventHelper.FacingDirection.Down),
|
||||||
|
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
|
e.globalFadeIn();
|
||||||
|
|
||||||
|
e.moveFarmerUp(10, EventHelper.FacingDirection.Up, true);
|
||||||
|
|
||||||
|
e.showMessage("Shhh. I think they are here.");
|
||||||
|
e.showMessage("Somebody turn on the lights.");
|
||||||
|
e.setViewportPosition(32, 12);
|
||||||
|
|
||||||
|
|
||||||
|
e.emoteFarmer_ExclamationMark();
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:CommunityBirthdayParty_0"));
|
||||||
|
e.emoteFarmer_Heart();
|
||||||
|
e.globalFadeOut(0.010);
|
||||||
|
e.setViewportPosition(-100, -100);
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:CommunityBirthdayParty_1"));
|
||||||
|
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
|
||||||
|
e.addObjectToPlayersInventory(220, 1, false);
|
||||||
|
|
||||||
|
e.end();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
public static EventHelper MarriedBirthday()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static EventHelper JojaBirthday()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public static string GetTranslatedString(string Key)
|
||||||
|
{
|
||||||
|
return HappyBirthday.Config.translationInfo.getTranslatedString(Key);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,6 +27,7 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
|
|
||||||
/// <summary>The player's current birthday season.</summary>
|
/// <summary>The player's current birthday season.</summary>
|
||||||
private string BirthdaySeason;
|
private string BirthdaySeason;
|
||||||
|
private string seasonName;
|
||||||
|
|
||||||
/// <summary>The player's current birthday day.</summary>
|
/// <summary>The player's current birthday day.</summary>
|
||||||
private int BirthdayDay;
|
private int BirthdayDay;
|
||||||
|
@ -45,7 +46,8 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
public BirthdayMenu(string season, int day, Action<string, int> onChanged)
|
public BirthdayMenu(string season, int day, Action<string, int> 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)
|
: 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.BirthdaySeason = HappyBirthday.Config.translationInfo.getTranslatedString(season);
|
||||||
|
this.seasonName = season;
|
||||||
this.BirthdayDay = day;
|
this.BirthdayDay = day;
|
||||||
this.OnChanged = onChanged;
|
this.OnChanged = onChanged;
|
||||||
this.SetUpPositions();
|
this.SetUpPositions();
|
||||||
|
@ -73,13 +75,14 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
this.DayButtons.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.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));
|
string bdaySeason = HappyBirthday.Config.translationInfo.getTranslatedString("Birthday") + " " + HappyBirthday.Config.translationInfo.getTranslatedString("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: " + this.BirthdayDay));
|
string bdayDay= HappyBirthday.Config.translationInfo.getTranslatedString("Birthday") + " " + HappyBirthday.Config.translationInfo.getTranslatedString("Date");
|
||||||
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.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), bdaySeason+": " + this.BirthdaySeason));
|
||||||
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.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), bdayDay+": " + this.BirthdayDay));
|
||||||
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("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, this.getSpringButton(), 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.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, this.getSummerButton(), 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, this.getFallButton(), 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, this.getWinterButton(), 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<Texture2D>("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), 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<Texture2D>("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<Texture2D>("LooseSprites\\font_bold"), new Rectangle(16, 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<Texture2D>("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
|
||||||
|
@ -128,6 +131,7 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
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<Texture2D>("LooseSprites\\font_bold"), new Rectangle(56, 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<Texture2D>("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<Texture2D>("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 * 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<Texture2D>("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<Texture2D>("LooseSprites\\font_bold"), new Rectangle(64, 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<Texture2D>("LooseSprites\\font_bold"), new Rectangle(64, 16, 8, 12), Game1.pixelZoom));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Handle a button click.</summary>
|
/// <summary>Handle a button click.</summary>
|
||||||
|
@ -144,9 +148,10 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
case "Summer":
|
case "Summer":
|
||||||
case "Fall":
|
case "Fall":
|
||||||
case "Winter":
|
case "Winter":
|
||||||
this.BirthdaySeason = name.ToLower();
|
this.BirthdaySeason = HappyBirthday.Config.translationInfo.getTranslatedString(name);
|
||||||
this.OnChanged(this.BirthdaySeason, this.BirthdayDay);
|
this.seasonName = name;
|
||||||
Game1.activeClickableMenu = new BirthdayMenu(this.BirthdaySeason, this.BirthdayDay, this.OnChanged);
|
this.OnChanged(this.seasonName, this.BirthdayDay);
|
||||||
|
Game1.activeClickableMenu = new BirthdayMenu(this.seasonName, this.BirthdayDay, this.OnChanged);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// OK button
|
// OK button
|
||||||
|
@ -158,8 +163,8 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
|
|
||||||
default:
|
default:
|
||||||
this.BirthdayDay = Convert.ToInt32(name);
|
this.BirthdayDay = Convert.ToInt32(name);
|
||||||
this.OnChanged(this.BirthdaySeason, this.BirthdayDay);
|
this.OnChanged(this.seasonName, this.BirthdayDay);
|
||||||
Game1.activeClickableMenu = new BirthdayMenu(this.BirthdaySeason, this.BirthdayDay, this.OnChanged);
|
Game1.activeClickableMenu = new BirthdayMenu(this.seasonName, this.BirthdayDay, this.OnChanged);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Game1.playSound("coin");
|
Game1.playSound("coin");
|
||||||
|
@ -172,7 +177,7 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
public override void receiveLeftClick(int x, int y, bool playSound = true)
|
public override void receiveLeftClick(int x, int y, bool playSound = true)
|
||||||
{
|
{
|
||||||
//If the season is not selected then the day buttons can't be clicked. Thanks to @Potato#5266 on the SDV discord for this tip.
|
//If the season is not selected then the day buttons can't be clicked. Thanks to @Potato#5266 on the SDV discord for this tip.
|
||||||
if (this.BirthdaySeason == "spring" || this.BirthdaySeason == "summer" || this.BirthdaySeason == "fall" || this.BirthdaySeason == "winter")
|
if (string.IsNullOrEmpty(this.seasonName)==false)
|
||||||
{
|
{
|
||||||
foreach (ClickableTextureComponent button in this.DayButtons)
|
foreach (ClickableTextureComponent button in this.DayButtons)
|
||||||
{
|
{
|
||||||
|
@ -197,7 +202,7 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
|
|
||||||
if (this.OkButton.containsPoint(x, y))
|
if (this.OkButton.containsPoint(x, y))
|
||||||
{
|
{
|
||||||
if (this.BirthdaySeason == "" || this.BirthdayDay == 0) return;
|
if (this.seasonName == "" || this.BirthdayDay == 0) return;
|
||||||
this.HandleButtonClick(this.OkButton.name);
|
this.HandleButtonClick(this.OkButton.name);
|
||||||
this.OkButton.scale -= 0.25f;
|
this.OkButton.scale -= 0.25f;
|
||||||
this.OkButton.scale = Math.Max(0.75f, this.OkButton.scale);
|
this.OkButton.scale = Math.Max(0.75f, this.OkButton.scale);
|
||||||
|
@ -241,10 +246,11 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
{
|
{
|
||||||
// draw menu box
|
// draw menu box
|
||||||
Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true);
|
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);
|
//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);
|
||||||
|
//Game1.player.FarmerSprite.draw(b, new Vector2((this.xPositionOnScreen + Game1.tileSize + Game1.tileSize * 2 / 3 - 2), (this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4)),1f);
|
||||||
|
|
||||||
// draw day buttons
|
// draw day buttons
|
||||||
if (this.BirthdaySeason == "spring" || this.BirthdaySeason == "summer" || this.BirthdaySeason == "fall" || this.BirthdaySeason == "winter")
|
if (string.IsNullOrEmpty(this.seasonName)==false)
|
||||||
{
|
{
|
||||||
foreach (ClickableTextureComponent button in this.DayButtons)
|
foreach (ClickableTextureComponent button in this.DayButtons)
|
||||||
button.draw(b);
|
button.draw(b);
|
||||||
|
@ -270,7 +276,7 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw OK button
|
// draw OK button
|
||||||
if (this.BirthdayDay != 0 && this.BirthdaySeason != "")
|
if (this.BirthdayDay != 0 && this.seasonName != "")
|
||||||
this.OkButton.draw(b);
|
this.OkButton.draw(b);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -281,5 +287,31 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
// draw cursor
|
// draw cursor
|
||||||
this.drawMouse(b);
|
this.drawMouse(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Rectangle getSpringButton()
|
||||||
|
{
|
||||||
|
//For some reason turkish and italian don't use translated words for the seasons???
|
||||||
|
if (HappyBirthday.Config.translationInfo.CurrentTranslation == TranslationInfo.LanguageName.Chinese)
|
||||||
|
{
|
||||||
|
return new Rectangle(188, 437, 32, 9);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new Rectangle(188, 438, 32, 9);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Rectangle getSummerButton()
|
||||||
|
{
|
||||||
|
return new Rectangle(220, 438, 32, 8);
|
||||||
|
}
|
||||||
|
public Rectangle getFallButton()
|
||||||
|
{
|
||||||
|
return new Rectangle(188, 447, 32, 10);
|
||||||
|
}
|
||||||
|
public Rectangle getWinterButton()
|
||||||
|
{
|
||||||
|
return new Rectangle(220, 448, 32, 8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using StardustCore.Events.Preconditions;
|
||||||
|
|
||||||
|
namespace Omegasis.HappyBirthday.Framework.EventPreconditions
|
||||||
|
{
|
||||||
|
public class FarmerBirthdayPrecondition:EventPrecondition
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public FarmerBirthdayPrecondition()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return "Omegasis.HappyBirthday";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool meetsCondition()
|
||||||
|
{
|
||||||
|
return HappyBirthday.Instance.IsBirthday();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using StardustCore.Events.Preconditions;
|
||||||
|
using StardewValley;
|
||||||
|
|
||||||
|
namespace Omegasis.HappyBirthday.Framework.EventPreconditions
|
||||||
|
{
|
||||||
|
public class SpouseBirthdayPrecondition:EventPrecondition
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public SpouseBirthdayPrecondition()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool meetsCondition()
|
||||||
|
{
|
||||||
|
if (Game1.player.getSpouse() == null) return false;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NPC spouse = Game1.player.getSpouse();
|
||||||
|
if (spouse.isBirthday(Game1.currentSeason, Game1.dayOfMonth)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -28,12 +28,15 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
/// <summary>The minimum amount of friendship needed to get a happy birthday greeting from an npc.</summary>
|
/// <summary>The minimum amount of friendship needed to get a happy birthday greeting from an npc.</summary>
|
||||||
public int minimumFriendshipLevelForBirthdayWish = 2;
|
public int minimumFriendshipLevelForBirthdayWish = 2;
|
||||||
|
|
||||||
|
public bool autoSetTranslation { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>Handles different translations of files.</summary>
|
/// <summary>Handles different translations of files.</summary>
|
||||||
public TranslationInfo translationInfo;
|
public TranslationInfo translationInfo;
|
||||||
|
|
||||||
/// <summary>Whether or not to load from the old BirthdayGifts.xnb located in StardewValley/Data or from the new BirthdayGifts.json located in the mod directory.</summary>
|
/// <summary>Whether or not to load from the old BirthdayGifts.xnb located in StardewValley/Data or from the new BirthdayGifts.json located in the mod directory.</summary>
|
||||||
public bool useLegacyBirthdayFiles;
|
public bool useLegacyBirthdayFiles;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Construct an instance.</summary>
|
/// <summary>Construct an instance.</summary>
|
||||||
public ModConfig()
|
public ModConfig()
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,6 +14,8 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
str.Replace("@", Game1.player.name);
|
str.Replace("@", Game1.player.name);
|
||||||
HUDMessage message = new HUDMessage(str, 1);
|
HUDMessage message = new HUDMessage(str, 1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (KeyValuePair<long, Farmer> f in Game1.otherFarmers)
|
foreach (KeyValuePair<long, Farmer> f in Game1.otherFarmers)
|
||||||
{
|
{
|
||||||
HappyBirthday.ModHelper.Multiplayer.SendMessage<string>(message.message, FSTRING_SendBirthdayMessageToOthers, new string[] { HappyBirthday.ModHelper.Multiplayer.ModID }, new long[] { f.Key });
|
HappyBirthday.ModHelper.Multiplayer.SendMessage<string>(message.message, FSTRING_SendBirthdayMessageToOthers, new string[] { HappyBirthday.ModHelper.Multiplayer.ModID }, new long[] { f.Key });
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using StardewValley;
|
using StardewValley;
|
||||||
|
|
||||||
namespace Omegasis.HappyBirthday.Framework
|
namespace Omegasis.HappyBirthday.Framework
|
||||||
|
@ -7,195 +9,187 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
/// <summary>A class which deals with handling different translations for Vocalization should other voice teams ever wish to voice act for that language.</summary>
|
/// <summary>A class which deals with handling different translations for Vocalization should other voice teams ever wish to voice act for that language.</summary>
|
||||||
public class TranslationInfo
|
public class TranslationInfo
|
||||||
{
|
{
|
||||||
/// <summary>The list of all supported translations by this mod.</summary>
|
|
||||||
public List<string> translations;
|
public enum LanguageName
|
||||||
|
{
|
||||||
|
English,
|
||||||
|
Spanish,
|
||||||
|
Chinese,
|
||||||
|
Japanese,
|
||||||
|
Russian,
|
||||||
|
German,
|
||||||
|
Portuguese,
|
||||||
|
Italian,
|
||||||
|
French,
|
||||||
|
Korean,
|
||||||
|
Turkish,
|
||||||
|
Hungarian
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum FileType
|
||||||
|
{
|
||||||
|
XNB,
|
||||||
|
JSON
|
||||||
|
}
|
||||||
|
/*********
|
||||||
|
** Accessors
|
||||||
|
*********/
|
||||||
|
/// <summary>The language names supported by this mod.</summary>
|
||||||
|
public LanguageName[] LanguageNames { get; } = (from LanguageName language in Enum.GetValues(typeof(LanguageName)) select language).ToArray();
|
||||||
|
|
||||||
/// <summary>The current translation mode for the mod, so that it knows what files to load at the beginning of the game.</summary>
|
/// <summary>The current translation mode for the mod, so that it knows what files to load at the beginning of the game.</summary>
|
||||||
public string currentTranslation;
|
public LanguageName CurrentTranslation { get; set; } = LanguageName.English;
|
||||||
|
|
||||||
/// <summary>Holds the info for what translation has what file extension.</summary>
|
/// <summary>Holds the info for what translation has what file extension.</summary>
|
||||||
public Dictionary<string, string> translationFileInfo;
|
public Dictionary<LanguageName, string> TranslationFileExtensions { get; } = new Dictionary<LanguageName, string>();
|
||||||
|
|
||||||
public Dictionary<string, LocalizedContentManager.LanguageCode> translationCodes;
|
public Dictionary<LanguageName, LocalizedContentManager.LanguageCode> TranslationCodes { get; } = new Dictionary<LanguageName, LocalizedContentManager.LanguageCode>();
|
||||||
|
|
||||||
/// <summary>Construct an instance..</summary>
|
|
||||||
|
/*********
|
||||||
|
** Public methods
|
||||||
|
*********/
|
||||||
|
/// <summary>Construct an instance.</summary>
|
||||||
public TranslationInfo()
|
public TranslationInfo()
|
||||||
{
|
{
|
||||||
this.translations = new List<string>();
|
this.TranslationFileExtensions.Add(LanguageName.English, "en-US");
|
||||||
|
this.TranslationFileExtensions.Add(LanguageName.Spanish, "es-ES");
|
||||||
this.translationFileInfo = new Dictionary<string, string>();
|
this.TranslationFileExtensions.Add(LanguageName.Chinese, "zh-CN");
|
||||||
this.translationCodes = new Dictionary<string, LocalizedContentManager.LanguageCode>();
|
this.TranslationFileExtensions.Add(LanguageName.Japanese, "ja-JP");
|
||||||
this.translations.Add("English");
|
this.TranslationFileExtensions.Add(LanguageName.Russian, "ru-RU");
|
||||||
this.translations.Add("Spanish");
|
this.TranslationFileExtensions.Add(LanguageName.German, "de-DE");
|
||||||
this.translations.Add("Chinese");
|
this.TranslationFileExtensions.Add(LanguageName.Portuguese, "pt-BR");
|
||||||
this.translations.Add("Japanese");
|
//1.3 languages.
|
||||||
this.translations.Add("Russian");
|
this.TranslationFileExtensions.Add(LanguageName.Italian, "it-IT");
|
||||||
this.translations.Add("German");
|
this.TranslationFileExtensions.Add(LanguageName.French, "fr-FR");
|
||||||
this.translations.Add("Brazillian Portuguese");
|
this.TranslationFileExtensions.Add(LanguageName.Hungarian, "hu-HU");
|
||||||
|
this.TranslationFileExtensions.Add(LanguageName.Turkish, "tr-TR");
|
||||||
this.currentTranslation = "English";
|
this.TranslationFileExtensions.Add(LanguageName.Korean, "ko-KR");
|
||||||
|
|
||||||
this.translationFileInfo.Add("English", ".json");
|
|
||||||
this.translationFileInfo.Add("Spanish", ".es-ES.json");
|
|
||||||
this.translationFileInfo.Add("Chinese", ".zh-CN.json");
|
|
||||||
this.translationFileInfo.Add("Japanese", ".ja-JP.json");
|
|
||||||
this.translationFileInfo.Add("Russian", ".ru-RU.json");
|
|
||||||
this.translationFileInfo.Add("German", ".de-DE.json");
|
|
||||||
this.translationFileInfo.Add("Brazillian Portuguese", ".pt-BR.json");
|
|
||||||
|
|
||||||
|
|
||||||
this.translationCodes.Add("English", LocalizedContentManager.LanguageCode.en);
|
this.TranslationCodes.Add(LanguageName.English, LocalizedContentManager.LanguageCode.en);
|
||||||
this.translationCodes.Add("Spanish", LocalizedContentManager.LanguageCode.es);
|
this.TranslationCodes.Add(LanguageName.Spanish, LocalizedContentManager.LanguageCode.es);
|
||||||
this.translationCodes.Add("Chinese", LocalizedContentManager.LanguageCode.zh);
|
this.TranslationCodes.Add(LanguageName.Chinese, LocalizedContentManager.LanguageCode.zh);
|
||||||
this.translationCodes.Add("Japanese", LocalizedContentManager.LanguageCode.ja);
|
this.TranslationCodes.Add(LanguageName.Japanese, LocalizedContentManager.LanguageCode.ja);
|
||||||
this.translationCodes.Add("Russian", LocalizedContentManager.LanguageCode.ru);
|
this.TranslationCodes.Add(LanguageName.Russian, LocalizedContentManager.LanguageCode.ru);
|
||||||
this.translationCodes.Add("German", LocalizedContentManager.LanguageCode.de);
|
this.TranslationCodes.Add(LanguageName.German, LocalizedContentManager.LanguageCode.de);
|
||||||
this.translationCodes.Add("Brazillian Portuguese", LocalizedContentManager.LanguageCode.pt);
|
this.TranslationCodes.Add(LanguageName.Portuguese, LocalizedContentManager.LanguageCode.pt);
|
||||||
|
//1.3 languages
|
||||||
|
this.TranslationCodes.Add(LanguageName.Italian, LocalizedContentManager.LanguageCode.it);
|
||||||
|
this.TranslationCodes.Add(LanguageName.French, LocalizedContentManager.LanguageCode.fr);
|
||||||
|
this.TranslationCodes.Add(LanguageName.Hungarian, LocalizedContentManager.LanguageCode.hu);
|
||||||
|
this.TranslationCodes.Add(LanguageName.Turkish, LocalizedContentManager.LanguageCode.tr);
|
||||||
|
this.TranslationCodes.Add(LanguageName.Korean, LocalizedContentManager.LanguageCode.ko);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the current SDV translation code.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public LocalizedContentManager.LanguageCode getCurrrentLanguageCode()
|
||||||
|
{
|
||||||
|
return this.TranslationCodes[this.CurrentTranslation];
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getTranslationNameFromPath(string fullPath)
|
public void setTranslationFromLanguageCode(LocalizedContentManager.LanguageCode code)
|
||||||
{
|
{
|
||||||
return Path.GetFileName(fullPath);
|
foreach (var v in this.TranslationCodes)
|
||||||
}
|
{
|
||||||
|
if (v.Value.Equals(code))
|
||||||
public void changeLocalizedContentManagerFromTranslation(string translation)
|
{
|
||||||
{
|
this.CurrentTranslation = v.Key;
|
||||||
string tra = this.getTranslationNameFromPath(translation);
|
HappyBirthday.ModHelper.WriteConfig<ModConfig>(HappyBirthday.Config);
|
||||||
bool f = this.translationCodes.TryGetValue(tra, out LocalizedContentManager.LanguageCode code);
|
return;
|
||||||
if (!f) LocalizedContentManager.CurrentLanguageCode = LocalizedContentManager.LanguageCode.en;
|
}
|
||||||
else LocalizedContentManager.CurrentLanguageCode = code;
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void resetLocalizationCode()
|
|
||||||
{
|
|
||||||
LocalizedContentManager.CurrentLanguageCode = LocalizedContentManager.LanguageCode.en;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Gets the proper file extension for the current translation.</summary>
|
/// <summary>Gets the proper file extension for the current translation.</summary>
|
||||||
/// <param name="path"></param>
|
/// <param name="language">The translation language name.</param>
|
||||||
public string getFileExtentionForTranslation(string path)
|
public string getFileExtentionForTranslation(LanguageName language, FileType File)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
bool f = translationFileInfo.TryGetValue(translation, out string value);
|
|
||||||
if (!f) return ".json";
|
|
||||||
else return value;
|
|
||||||
*/
|
|
||||||
string translation = Path.GetFileName(path);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return this.translationFileInfo[translation];
|
if (language == LanguageName.English)
|
||||||
|
{
|
||||||
|
return this.getFileExtensionForFileType(File);
|
||||||
|
}
|
||||||
|
return "."+this.TranslationFileExtensions[language] + this.getFileExtensionForFileType(File);
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
|
||||||
|
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log(err.ToString());
|
||||||
|
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log($"Attempted to get translation: {language}");
|
||||||
|
return ".xnb";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string getFileExtensionForFileType(FileType Type)
|
||||||
|
{
|
||||||
|
if (Type == FileType.JSON)
|
||||||
{
|
{
|
||||||
HappyBirthday.ModMonitor.Log("WTF SOMETHING IS WRONG!", StardewModdingAPI.LogLevel.Warn);
|
|
||||||
//Vocalization.ModMonitor.Log(err.ToString());
|
|
||||||
//Vocalization.ModMonitor.Log("Attempted to get translation: " + translation);
|
|
||||||
return ".json";
|
return ".json";
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
|
||||||
/// <summary>Gets the proper json for Buildings (aka Blueprints) from the data folder.</summary>
|
|
||||||
public string getBuildingjsonForTranslation(string translation)
|
|
||||||
{
|
|
||||||
string buildings = "Blueprints";
|
|
||||||
return buildings + this.getFileExtentionForTranslation(translation);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Gets the proper json file for the name passed in. Combines the file name with it's proper translation extension.</summary>
|
|
||||||
/// <param name="jsonFileName"></param>
|
|
||||||
/// <param name="translation"></param>
|
|
||||||
public string getjsonForTranslation(string jsonFileName, string translation)
|
|
||||||
{
|
|
||||||
return jsonFileName + this.getFileExtentionForTranslation(translation);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Loads an json file from StardewValley/Content</summary>
|
|
||||||
/// <param name="jsonFileName"></param>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <param name="translation"></param>
|
|
||||||
public string LoadjsonFile(string jsonFileName, string key, string translation)
|
|
||||||
{
|
|
||||||
string json = jsonFileName + this.getFileExtentionForTranslation(translation);
|
|
||||||
Dictionary<string, string> loadedDict = Game1.content.Load<Dictionary<string, string>>(json);
|
|
||||||
|
|
||||||
bool f = loadedDict.TryGetValue(key, out string loaded);
|
|
||||||
if (!f)
|
|
||||||
{
|
{
|
||||||
//Vocalization.ModMonitor.Log("Big issue: Key not found in file:" + json + " " + key);
|
return ".xnb";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string getFileExtentionForDirectory(LanguageName language)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string s = this.TranslationFileExtensions[language];
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
|
||||||
|
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log(err.ToString());
|
||||||
|
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log($"Attempted to get translation: {language}");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
else return loaded;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Loads a string dictionary from a json file.</summary>
|
|
||||||
/// <param name="jsonFileName"></param>
|
|
||||||
/// <param name="translation"></param>
|
|
||||||
public Dictionary<string, string> LoadJsonFileDictionary(string jsonFileName, string translation)
|
|
||||||
{
|
|
||||||
string json = jsonFileName + this.getFileExtentionForTranslation(translation);
|
|
||||||
Dictionary<string, string> loadedDict = Game1.content.Load<Dictionary<string, string>>(json);
|
|
||||||
|
|
||||||
return loadedDict;
|
/// <summary>
|
||||||
}
|
/// Gets the json file for the translation.
|
||||||
|
/// </summary>
|
||||||
public virtual string LoadString(string path, string translation, object sub1, object sub2, object sub3)
|
/// <param name="FileName"></param>
|
||||||
|
/// <param name="language"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string getJSONForTranslation(string FileName, LanguageName language)
|
||||||
{
|
{
|
||||||
string format = this.LoadString(path, translation);
|
if (language != LanguageName.English)
|
||||||
try
|
|
||||||
{
|
{
|
||||||
return string.Format(format, sub1, sub2, sub3);
|
return FileName + this.getFileExtentionForTranslation(language, FileType.JSON);
|
||||||
}
|
}
|
||||||
catch { }
|
else
|
||||||
|
|
||||||
return format;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual string LoadString(string path, string translation, object sub1, object sub2)
|
|
||||||
{
|
|
||||||
string format = this.LoadString(path, translation);
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
return string.Format(format, sub1, sub2);
|
return FileName + this.getFileExtentionForTranslation(language, FileType.JSON);
|
||||||
}
|
}
|
||||||
catch { }
|
|
||||||
|
|
||||||
return format;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual string LoadString(string path, string translation, object sub1)
|
/// <summary>Loads an XNB file from StardewValley/Content</summary>
|
||||||
|
public string LoadStringFromXNBFile(string xnbFileName, string key, LanguageName language)
|
||||||
{
|
{
|
||||||
string format = this.LoadString(path, translation);
|
string xnb = xnbFileName + this.getFileExtentionForTranslation(language, FileType.XNB);
|
||||||
try
|
Dictionary<string, string> loadedDict = Game1.content.Load<Dictionary<string, string>>(xnb);
|
||||||
{
|
|
||||||
return string.Format(format, sub1);
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
|
|
||||||
return format;
|
if (!loadedDict.TryGetValue(key, out string loaded))
|
||||||
|
{
|
||||||
|
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log("Big issue: Key not found in file:" + xnb + " " + key);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual string LoadString(string path, string translation)
|
public virtual string LoadString(string path, LanguageName language)
|
||||||
{
|
{
|
||||||
this.parseStringPath(path, out string assetName, out string key);
|
this.parseStringPath(path, out string assetName, out string key);
|
||||||
return this.LoadjsonFile(assetName, key, translation);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual string LoadString(string path, string translation, params object[] substitutions)
|
return this.LoadStringFromXNBFile(assetName, key, language);
|
||||||
{
|
|
||||||
string format = this.LoadString(path, translation);
|
|
||||||
if (substitutions.Length != 0)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return string.Format(format, substitutions);
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
}
|
|
||||||
return format;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseStringPath(string path, out string assetName, out string key)
|
private void parseStringPath(string path, out string assetName, out string key)
|
||||||
|
@ -204,5 +198,63 @@ namespace Omegasis.HappyBirthday.Framework
|
||||||
assetName = path.Substring(0, length);
|
assetName = path.Substring(0, length);
|
||||||
key = path.Substring(length + 1, path.Length - length - 1);
|
key = path.Substring(length + 1, path.Length - length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a translated string from the the dictionary with the proper translation; Returns an empty string if this fails somehow.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Language"></param>
|
||||||
|
/// <param name="Key"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string getTranslatedString(LocalizedContentManager.LanguageCode Language, string Key)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return HappyBirthday.Instance.messages.translatedStrings[Language][Key];
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string getTranslatedString(string Key)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(Key)) return "";
|
||||||
|
if (Key.Equals("Birthday"))
|
||||||
|
{
|
||||||
|
string s = Game1.content.LoadString("Strings\\UI:Profile_Birthday");
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
if (Key.Equals("Spring") || Key.Equals("spring"))
|
||||||
|
{
|
||||||
|
string file = Path.Combine("Strings", "StringsFromCSFiles");
|
||||||
|
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5680", HappyBirthday.Config.translationInfo.CurrentTranslation);
|
||||||
|
}
|
||||||
|
if (Key.Equals("Summer") || Key.Equals("summer"))
|
||||||
|
{
|
||||||
|
string file = Path.Combine("Strings", "StringsFromCSFiles");
|
||||||
|
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5681", HappyBirthday.Config.translationInfo.CurrentTranslation);
|
||||||
|
}
|
||||||
|
if (Key.Equals("Fall") || Key.Equals("fall"))
|
||||||
|
{
|
||||||
|
string file = Path.Combine("Strings", "StringsFromCSFiles");
|
||||||
|
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5682", HappyBirthday.Config.translationInfo.CurrentTranslation);
|
||||||
|
}
|
||||||
|
if (Key.Equals("Winter") || Key.Equals("winter"))
|
||||||
|
{
|
||||||
|
string file = Path.Combine("Strings", "StringsFromCSFiles");
|
||||||
|
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5683", HappyBirthday.Config.translationInfo.CurrentTranslation);
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return HappyBirthday.Instance.messages.translatedStrings[this.getCurrrentLanguageCode()][Key];
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Omegasis.HappyBirthday.Framework
|
||||||
|
{
|
||||||
|
public class VillagerInfo
|
||||||
|
{
|
||||||
|
public bool hasGivenBirthdayWish;
|
||||||
|
public bool hasGivenBirthdayGift;
|
||||||
|
|
||||||
|
public VillagerInfo()
|
||||||
|
{
|
||||||
|
this.hasGivenBirthdayGift = false;
|
||||||
|
this.hasGivenBirthdayWish = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reset()
|
||||||
|
{
|
||||||
|
this.hasGivenBirthdayGift = false;
|
||||||
|
this.hasGivenBirthdayWish = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -87,14 +87,17 @@ namespace Omegasis.HappyBirthday
|
||||||
/// <summary>Load birthday gift information from disk. Preferably from BirthdayGift.json in the mod's directory.</summary>
|
/// <summary>Load birthday gift information from disk. Preferably from BirthdayGift.json in the mod's directory.</summary>
|
||||||
public void loadVillagerBirthdayGifts()
|
public void loadVillagerBirthdayGifts()
|
||||||
{
|
{
|
||||||
string villagerGifts = Path.Combine("Content", "Gifts", "BirthdayGifts.json");
|
string villagerGifts = Path.Combine("ModAssets", "Gifts", "BirthdayGifts.json");
|
||||||
if (!HappyBirthday.Config.useLegacyBirthdayFiles)
|
if (!HappyBirthday.Config.useLegacyBirthdayFiles)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (File.Exists(Path.Combine(HappyBirthday.ModHelper.DirectoryPath, villagerGifts)))
|
if (File.Exists(Path.Combine(HappyBirthday.ModHelper.DirectoryPath, villagerGifts)))
|
||||||
this.defaultBirthdayGifts = HappyBirthday.ModHelper.Data.ReadJsonFile<Dictionary<string, string>>(villagerGifts);
|
this.defaultBirthdayGifts = HappyBirthday.ModHelper.Data.ReadJsonFile<Dictionary<string, string>>(villagerGifts);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
HappyBirthday.ModHelper.Data.WriteJsonFile<Dictionary<string, string>>(villagerGifts, this.defaultBirthdayGifts);
|
HappyBirthday.ModHelper.Data.WriteJsonFile<Dictionary<string, string>>(villagerGifts, this.defaultBirthdayGifts);
|
||||||
|
this.defaultBirthdayGifts = HappyBirthday.ModHelper.Data.ReadJsonFile<Dictionary<string, string>>(villagerGifts);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -109,6 +112,9 @@ namespace Omegasis.HappyBirthday
|
||||||
{
|
{
|
||||||
HappyBirthday.ModMonitor.Log("No birthday gift information found. Loading from internal birthday list and generating villagerGifts.json");
|
HappyBirthday.ModMonitor.Log("No birthday gift information found. Loading from internal birthday list and generating villagerGifts.json");
|
||||||
HappyBirthday.ModHelper.Data.WriteJsonFile<Dictionary<string, string>>(villagerGifts, this.defaultBirthdayGifts);
|
HappyBirthday.ModHelper.Data.WriteJsonFile<Dictionary<string, string>>(villagerGifts, this.defaultBirthdayGifts);
|
||||||
|
HappyBirthday.Config.useLegacyBirthdayFiles = false;
|
||||||
|
this.defaultBirthdayGifts = HappyBirthday.ModHelper.Data.ReadJsonFile<Dictionary<string, string>>(villagerGifts);
|
||||||
|
HappyBirthday.ModHelper.WriteConfig<ModConfig>(HappyBirthday.Config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,7 +122,7 @@ namespace Omegasis.HappyBirthday
|
||||||
/// <summary>Used to load spouse birthday gifts from disk.</summary>
|
/// <summary>Used to load spouse birthday gifts from disk.</summary>
|
||||||
public void loadSpouseBirthdayGifts()
|
public void loadSpouseBirthdayGifts()
|
||||||
{
|
{
|
||||||
string spouseGifts = Path.Combine("Content", "Gifts", "SpouseBirthdayGifts.json");
|
string spouseGifts = Path.Combine("ModAssets", "Gifts", "SpouseBirthdayGifts.json");
|
||||||
if (File.Exists(Path.Combine(HappyBirthday.ModHelper.DirectoryPath, spouseGifts)))
|
if (File.Exists(Path.Combine(HappyBirthday.ModHelper.DirectoryPath, spouseGifts)))
|
||||||
{
|
{
|
||||||
HappyBirthday.ModMonitor.Log("Load from SpouseBirthdayGifts.json");
|
HappyBirthday.ModMonitor.Log("Load from SpouseBirthdayGifts.json");
|
||||||
|
|
|
@ -5,12 +5,14 @@ using System.Linq;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Omegasis.HappyBirthday.Framework;
|
using Omegasis.HappyBirthday.Framework;
|
||||||
|
using StardustCore.Events;
|
||||||
using StardewModdingAPI;
|
using StardewModdingAPI;
|
||||||
using StardewModdingAPI.Events;
|
using StardewModdingAPI.Events;
|
||||||
using StardewValley;
|
using StardewValley;
|
||||||
using StardewValley.Characters;
|
using StardewValley.Characters;
|
||||||
using StardewValley.Menus;
|
using StardewValley.Menus;
|
||||||
using StardewValley.Monsters;
|
using StardewValley.Monsters;
|
||||||
|
using StardustCore.Utilities;
|
||||||
|
|
||||||
namespace Omegasis.HappyBirthday
|
namespace Omegasis.HappyBirthday
|
||||||
{
|
{
|
||||||
|
@ -43,7 +45,7 @@ namespace Omegasis.HappyBirthday
|
||||||
private bool HasChosenBirthday => !string.IsNullOrEmpty(this.PlayerData.BirthdaySeason) && this.PlayerData.BirthdayDay != 0;
|
private bool HasChosenBirthday => !string.IsNullOrEmpty(this.PlayerData.BirthdaySeason) && this.PlayerData.BirthdayDay != 0;
|
||||||
|
|
||||||
/// <summary>The queue of villagers who haven't given a gift yet.</summary>
|
/// <summary>The queue of villagers who haven't given a gift yet.</summary>
|
||||||
private List<string> VillagerQueue;
|
private Dictionary<string,VillagerInfo> VillagerQueue;
|
||||||
|
|
||||||
/// <summary>Whether we've already checked for and (if applicable) set up the player's birthday today.</summary>
|
/// <summary>Whether we've already checked for and (if applicable) set up the player's birthday today.</summary>
|
||||||
private bool CheckedForBirthday;
|
private bool CheckedForBirthday;
|
||||||
|
@ -67,6 +69,10 @@ namespace Omegasis.HappyBirthday
|
||||||
|
|
||||||
public static HappyBirthday Instance;
|
public static HappyBirthday Instance;
|
||||||
|
|
||||||
|
private NPC lastSpeaker;
|
||||||
|
|
||||||
|
private EventManager eventManager;
|
||||||
|
|
||||||
/*********
|
/*********
|
||||||
** Public methods
|
** Public methods
|
||||||
*********/
|
*********/
|
||||||
|
@ -76,8 +82,6 @@ namespace Omegasis.HappyBirthday
|
||||||
{
|
{
|
||||||
|
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
|
||||||
//helper.Content.AssetLoaders.Add(new PossibleGifts());
|
|
||||||
Config = helper.ReadConfig<ModConfig>();
|
Config = helper.ReadConfig<ModConfig>();
|
||||||
|
|
||||||
helper.Events.GameLoop.DayStarted += this.OnDayStarted;
|
helper.Events.GameLoop.DayStarted += this.OnDayStarted;
|
||||||
|
@ -86,24 +90,90 @@ namespace Omegasis.HappyBirthday
|
||||||
helper.Events.GameLoop.Saving += this.OnSaving;
|
helper.Events.GameLoop.Saving += this.OnSaving;
|
||||||
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
|
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
|
||||||
helper.Events.Display.MenuChanged += this.OnMenuChanged;
|
helper.Events.Display.MenuChanged += this.OnMenuChanged;
|
||||||
|
|
||||||
helper.Events.Display.RenderedActiveMenu += this.OnRenderedActiveMenu;
|
helper.Events.Display.RenderedActiveMenu += this.OnRenderedActiveMenu;
|
||||||
helper.Events.Display.RenderedHud += this.OnRenderedHud;
|
helper.Events.Display.RenderedHud += this.OnRenderedHud;
|
||||||
//MultiplayerSupport.initializeMultiplayerSupport();
|
helper.Events.Multiplayer.ModMessageReceived += this.Multiplayer_ModMessageReceived;
|
||||||
|
helper.Events.Multiplayer.PeerDisconnected += this.Multiplayer_PeerDisconnected;
|
||||||
|
helper.Events.GameLoop.GameLaunched += this.GameLoop_GameLaunched;
|
||||||
|
helper.Events.Player.Warped += this.Player_Warped;
|
||||||
|
helper.Events.GameLoop.ReturnedToTitle += this.GameLoop_ReturnedToTitle;
|
||||||
ModHelper = this.Helper;
|
ModHelper = this.Helper;
|
||||||
ModMonitor = this.Monitor;
|
ModMonitor = this.Monitor;
|
||||||
|
|
||||||
|
this.othersBirthdays = new Dictionary<long, PlayerData>();
|
||||||
|
|
||||||
|
this.eventManager = new EventManager();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GameLoop_ReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
|
||||||
|
{
|
||||||
|
this.eventManager = new EventManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Player_Warped(object sender, WarpedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("CommunityCenter"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("CommunityCenterBirthday");
|
||||||
|
}
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("Trailer"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Penny");
|
||||||
|
}
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("Trailer_Big"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Penny_BigHome");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("ScienceHouse"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Maru");
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Sebastian");
|
||||||
|
}
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("LeahHouse"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Leah");
|
||||||
|
}
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("SeedShop"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Abigail");
|
||||||
|
}
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("HaleyHouse"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Emily");
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Haley");
|
||||||
|
}
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("HarveyRoom"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Harvey");
|
||||||
|
}
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("ElliottHouse"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Elliott");
|
||||||
|
}
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("SamHouse"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Sam");
|
||||||
|
}
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("JoshHouse"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Alex");
|
||||||
|
}
|
||||||
|
if (e.NewLocation == Game1.getLocationFromName("AnimalShop"))
|
||||||
|
{
|
||||||
|
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Shane");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
|
||||||
|
{
|
||||||
this.messages = new BirthdayMessages();
|
this.messages = new BirthdayMessages();
|
||||||
this.giftManager = new GiftManager();
|
this.giftManager = new GiftManager();
|
||||||
this.isDailyQuestBoard = false;
|
this.isDailyQuestBoard = false;
|
||||||
|
|
||||||
ModHelper.Events.Multiplayer.ModMessageReceived += this.Multiplayer_ModMessageReceived;
|
|
||||||
|
|
||||||
ModHelper.Events.Multiplayer.PeerDisconnected += this.Multiplayer_PeerDisconnected;
|
|
||||||
|
|
||||||
this.othersBirthdays = new Dictionary<long, PlayerData>();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Get whether this instance can edit the given asset.</summary>
|
/// <summary>Get whether this instance can edit the given asset.</summary>
|
||||||
|
@ -119,11 +189,21 @@ namespace Omegasis.HappyBirthday
|
||||||
{
|
{
|
||||||
IDictionary<string, string> data = asset.AsDictionary<string, string>().Data;
|
IDictionary<string, string> data = asset.AsDictionary<string, string>().Data;
|
||||||
|
|
||||||
string momMail = BirthdayMessages.GetTranslatedString("Mail:birthdayMom");
|
data["birthdayMom"] = BirthdayMessages.GetTranslatedString("Mail:birthdayMom");
|
||||||
string dadMail = BirthdayMessages.GetTranslatedString("Mail:birthdayDad");
|
data["birthdayDad"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDad");
|
||||||
|
data["birthdayJunimos"] = BirthdayMessages.GetTranslatedString("Mail:birthdayJunimos");
|
||||||
data["birthdayMom"] = momMail;
|
data["birthdayDatingPenny"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingPenny");
|
||||||
data["birthdayDad"] = dadMail;
|
data["birthdayDatingMaru"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingMaru");
|
||||||
|
data["birthdayDatingSebastian"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingSebastian");
|
||||||
|
data["birthdayDatingLeah"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingLeah");
|
||||||
|
data["birthdayDatingAbigail"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingAbigail");
|
||||||
|
data["birthdayDatingEmily"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingEmily");
|
||||||
|
data["birthdayDatingHaley"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingHaley");
|
||||||
|
data["birthdayDatingHarvey"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingHarvey");
|
||||||
|
data["birthdayDatingElliott"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingElliott");
|
||||||
|
data["birthdayDatingSam"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingSam");
|
||||||
|
data["birthdayDatingAlex"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingAlex");
|
||||||
|
data["birthdayDatingShane"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingShane");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,14 +233,14 @@ namespace Omegasis.HappyBirthday
|
||||||
{
|
{
|
||||||
this.othersBirthdays.Add(message.Key, message.Value);
|
this.othersBirthdays.Add(message.Key, message.Value);
|
||||||
MultiplayerSupport.SendBirthdayInfoToConnectingPlayer(e.FromPlayerID);
|
MultiplayerSupport.SendBirthdayInfoToConnectingPlayer(e.FromPlayerID);
|
||||||
this.Monitor.Log("Got other player's birthday data from: " + Game1.getFarmer(e.FromPlayerID).name);
|
this.Monitor.Log("Got other player's birthday data from: " + Game1.getFarmer(e.FromPlayerID).Name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Brute force update birthday info if it has already been recevived but dont send birthday info again.
|
//Brute force update birthday info if it has already been recevived but dont send birthday info again.
|
||||||
this.othersBirthdays.Remove(message.Key);
|
this.othersBirthdays.Remove(message.Key);
|
||||||
this.othersBirthdays.Add(message.Key, message.Value);
|
this.othersBirthdays.Add(message.Key, message.Value);
|
||||||
this.Monitor.Log("Got other player's birthday data from: " + Game1.getFarmer(e.FromPlayerID).name);
|
this.Monitor.Log("Got other player's birthday data from: " + Game1.getFarmer(e.FromPlayerID).Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -178,8 +258,6 @@ namespace Omegasis.HappyBirthday
|
||||||
if (this.isDailyQuestBoard || billboard.calendarDays == null)
|
if (this.isDailyQuestBoard || billboard.calendarDays == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 1f, 4f, 2, Game1.player);
|
|
||||||
|
|
||||||
string hoverText = "";
|
string hoverText = "";
|
||||||
List<string> texts = new List<string>();
|
List<string> texts = new List<string>();
|
||||||
|
|
||||||
|
@ -229,6 +307,13 @@ namespace Omegasis.HappyBirthday
|
||||||
{
|
{
|
||||||
int index = this.PlayerData.BirthdayDay;
|
int index = this.PlayerData.BirthdayDay;
|
||||||
Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 0.5f, 4f, 2, Game1.player);
|
Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 0.5f, 4f, 2, Game1.player);
|
||||||
|
(Game1.activeClickableMenu as Billboard).drawMouse(e.SpriteBatch);
|
||||||
|
|
||||||
|
string hoverText = this.Helper.Reflection.GetField<string>((Game1.activeClickableMenu as Billboard), "hoverText", true).GetValue();
|
||||||
|
if (hoverText.Length > 0)
|
||||||
|
{
|
||||||
|
IClickableMenu.drawHoverText(Game1.spriteBatch, hoverText, Game1.dialogueFont, 0, 0, -1, (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,7 +323,16 @@ namespace Omegasis.HappyBirthday
|
||||||
if (pair.Value.BirthdaySeason != Game1.currentSeason.ToLower()) continue; //Hide out of season birthdays.
|
if (pair.Value.BirthdaySeason != Game1.currentSeason.ToLower()) continue; //Hide out of season birthdays.
|
||||||
index = pair.Value.BirthdayDay;
|
index = pair.Value.BirthdayDay;
|
||||||
Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 0.5f, 4f, 2, Game1.getFarmer(pair.Key));
|
Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 0.5f, 4f, 2, Game1.getFarmer(pair.Key));
|
||||||
|
(Game1.activeClickableMenu as Billboard).drawMouse(e.SpriteBatch);
|
||||||
|
|
||||||
|
string hoverText=this.Helper.Reflection.GetField<string>((Game1.activeClickableMenu as Billboard), "hoverText", true).GetValue();
|
||||||
|
if (hoverText.Length > 0)
|
||||||
|
{
|
||||||
|
IClickableMenu.drawHoverText(Game1.spriteBatch, hoverText, Game1.dialogueFont, 0, 0, -1, (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
(Game1.activeClickableMenu).drawMouse(e.SpriteBatch);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,6 +345,20 @@ namespace Omegasis.HappyBirthday
|
||||||
{
|
{
|
||||||
case null:
|
case null:
|
||||||
this.isDailyQuestBoard = false;
|
this.isDailyQuestBoard = false;
|
||||||
|
//Validate the gift and give it to the player.
|
||||||
|
if (this.lastSpeaker != null)
|
||||||
|
{
|
||||||
|
if (this.giftManager.BirthdayGiftToReceive != null && this.VillagerQueue[this.lastSpeaker.Name].hasGivenBirthdayGift == false)
|
||||||
|
{
|
||||||
|
while (this.giftManager.BirthdayGiftToReceive.Name == "Error Item" || this.giftManager.BirthdayGiftToReceive.Name == "Rock" || this.giftManager.BirthdayGiftToReceive.Name == "???")
|
||||||
|
this.giftManager.SetNextBirthdayGift(this.lastSpeaker.Name);
|
||||||
|
Game1.player.addItemByMenuIfNecessaryElseHoldUp(this.giftManager.BirthdayGiftToReceive);
|
||||||
|
this.giftManager.BirthdayGiftToReceive = null;
|
||||||
|
this.VillagerQueue[this.lastSpeaker.Name].hasGivenBirthdayGift = true;
|
||||||
|
this.lastSpeaker = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Billboard billboard:
|
case Billboard billboard:
|
||||||
|
@ -270,8 +378,11 @@ namespace Omegasis.HappyBirthday
|
||||||
if (this.PlayerData.BirthdaySeason.ToLower() == Game1.currentSeason.ToLower())
|
if (this.PlayerData.BirthdaySeason.ToLower() == Game1.currentSeason.ToLower())
|
||||||
{
|
{
|
||||||
int index = this.PlayerData.BirthdayDay;
|
int index = this.PlayerData.BirthdayDay;
|
||||||
|
|
||||||
|
string bdayDisplay = Game1.content.LoadString("Strings\\UI:Billboard_Birthday");
|
||||||
Rectangle birthdayRect = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 200 + (index - 1) / 7 * 32 * 4, 124, 124);
|
Rectangle birthdayRect = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 200 + (index - 1) / 7 * 32 * 4, 124, 124);
|
||||||
billboard.calendarDays.Add(new ClickableTextureComponent("", birthdayRect, "", $"{Game1.player.Name}'s Birthday", text, new Rectangle(0, 0, 124, 124), 1f, false));
|
billboard.calendarDays.Add(new ClickableTextureComponent("", birthdayRect, "", string.Format(bdayDisplay, Game1.player.Name), text, new Rectangle(0, 0, 124, 124), 1f, false));
|
||||||
|
//billboard.calendarDays.Add(new ClickableTextureComponent("", birthdayRect, "", $"{Game1.player.Name}'s Birthday", text, new Rectangle(0, 0, 124, 124), 1f, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,13 +390,58 @@ namespace Omegasis.HappyBirthday
|
||||||
{
|
{
|
||||||
if (pair.Value.BirthdaySeason != Game1.currentSeason.ToLower()) continue;
|
if (pair.Value.BirthdaySeason != Game1.currentSeason.ToLower()) continue;
|
||||||
int index = pair.Value.BirthdayDay;
|
int index = pair.Value.BirthdayDay;
|
||||||
|
|
||||||
|
string bdayDisplay = Game1.content.LoadString("Strings\\UI:Billboard_Birthday");
|
||||||
Rectangle otherBirthdayRect = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 200 + (index - 1) / 7 * 32 * 4, 124, 124);
|
Rectangle otherBirthdayRect = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 200 + (index - 1) / 7 * 32 * 4, 124, 124);
|
||||||
billboard.calendarDays.Add(new ClickableTextureComponent("", otherBirthdayRect, "", $"{Game1.getFarmer(pair.Key).Name}'s Birthday", text, new Rectangle(0, 0, 124, 124), 1f, false));
|
billboard.calendarDays.Add(new ClickableTextureComponent("", otherBirthdayRect, "", string.Format(bdayDisplay, Game1.getFarmer(pair.Key).Name), text, new Rectangle(0, 0, 124, 124), 1f, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DialogueBox dBox:
|
||||||
|
{
|
||||||
|
if (Game1.eventUp) return;
|
||||||
|
//Hijack the dialogue box and ensure that birthday dialogue gets spoken.
|
||||||
|
if (Game1.currentSpeaker != null)
|
||||||
|
{
|
||||||
|
this.lastSpeaker = Game1.currentSpeaker;
|
||||||
|
if (Game1.activeClickableMenu != null && this.IsBirthday() && this.VillagerQueue.ContainsKey(Game1.currentSpeaker.Name))
|
||||||
|
{
|
||||||
|
if ((Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.Name) < Config.minimumFriendshipLevelForBirthdayWish)) return;
|
||||||
|
if (Game1.activeClickableMenu is StardewValley.Menus.DialogueBox && this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayWish==false && (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.Name) >= Config.minimumFriendshipLevelForBirthdayWish))
|
||||||
|
{
|
||||||
|
//IReflectedField < Dialogue > cDialogue= this.Helper.Reflection.GetField<Dialogue>((Game1.activeClickableMenu as DialogueBox), "characterDialogue", true);
|
||||||
|
//IReflectedField<List<string>> dialogues = this.Helper.Reflection.GetField<List<string>>((Game1.activeClickableMenu as DialogueBox), "dialogues", true);
|
||||||
|
Game1.currentSpeaker.resetCurrentDialogue();
|
||||||
|
Game1.currentSpeaker.resetSeasonalDialogue();
|
||||||
|
this.Helper.Reflection.GetMethod(Game1.currentSpeaker, "loadCurrentDialogue", true).Invoke();
|
||||||
|
Game1.npcDialogues[Game1.currentSpeaker.Name] = Game1.currentSpeaker.CurrentDialogue;
|
||||||
|
if (this.IsBirthday() && this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayGift == false && Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.Name) >= Config.minNeutralFriendshipGiftLevel)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
this.giftManager.SetNextBirthdayGift(Game1.currentSpeaker.Name);
|
||||||
|
this.Monitor.Log("Setting next birthday gift. 1");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.Monitor.Log(ex.ToString(), LogLevel.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Game1.activeClickableMenu = new DialogueBox(new Dialogue(this.messages.getBirthdayMessage(Game1.currentSpeaker.Name),Game1.currentSpeaker));
|
||||||
|
this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayWish = true;
|
||||||
|
|
||||||
|
// Set birthday gift for the player to recieve from the npc they are currently talking with.
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Raised after the game begins a new day (including when the player loads a save).</summary>
|
/// <summary>Raised after the game begins a new day (including when the player loads a save).</summary>
|
||||||
|
@ -293,6 +449,14 @@ namespace Omegasis.HappyBirthday
|
||||||
/// <param name="e">The event arguments.</param>
|
/// <param name="e">The event arguments.</param>
|
||||||
private void OnDayStarted(object sender, DayStartedEventArgs e)
|
private void OnDayStarted(object sender, DayStartedEventArgs e)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
this.ResetVillagerQueue();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.Monitor.Log(ex.ToString(), LogLevel.Error);
|
||||||
|
}
|
||||||
this.CheckedForBirthday = false;
|
this.CheckedForBirthday = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,22 +479,116 @@ namespace Omegasis.HappyBirthday
|
||||||
this.DataFilePath = Path.Combine("data", $"{Game1.player.Name}_{Game1.player.UniqueMultiplayerID}.json");
|
this.DataFilePath = Path.Combine("data", $"{Game1.player.Name}_{Game1.player.UniqueMultiplayerID}.json");
|
||||||
|
|
||||||
// reset state
|
// reset state
|
||||||
this.VillagerQueue = new List<string>();
|
this.VillagerQueue = new Dictionary<string, VillagerInfo>();
|
||||||
this.CheckedForBirthday = false;
|
this.CheckedForBirthday = false;
|
||||||
|
|
||||||
// load settings
|
// load settings
|
||||||
this.MigrateLegacyData();
|
//
|
||||||
|
//this.MigrateLegacyData();
|
||||||
this.PlayerData = this.Helper.Data.ReadJsonFile<PlayerData>(this.DataFilePath) ?? new PlayerData();
|
this.PlayerData = this.Helper.Data.ReadJsonFile<PlayerData>(this.DataFilePath) ?? new PlayerData();
|
||||||
|
|
||||||
;
|
if (HappyBirthday.Config.autoSetTranslation)
|
||||||
|
{
|
||||||
|
HappyBirthday.Config.translationInfo.setTranslationFromLanguageCode(Game1.content.GetCurrentLanguage());
|
||||||
|
}
|
||||||
|
|
||||||
if (PlayerBirthdayData != null)
|
if (PlayerBirthdayData != null)
|
||||||
{
|
{
|
||||||
ModMonitor.Log("Send all birthday information from " + Game1.player.name);
|
//ModMonitor.Log("Send all birthday information from " + Game1.player.Name);
|
||||||
MultiplayerSupport.SendBirthdayInfoToOtherPlayers();
|
MultiplayerSupport.SendBirthdayInfoToOtherPlayers();
|
||||||
}
|
}
|
||||||
//this.SeenEvent = false;
|
|
||||||
//this.Dialogue = new Dictionary<string, Dialogue>();
|
if (Game1.player.mailReceived.Contains("birthdayMom"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayMom");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDad"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDad");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayJunimos"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayJunimos");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingPenny"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingPenny");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingMaru"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingMaru");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingSebastian"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingSebastian");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingLeah"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingLeah");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingAbigail"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingAbigail");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingEmily"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingEmily");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingHaley"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingHaley");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingHarvey"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingHarvey");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingElliott"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingElliott");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingSam"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingSam");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingAlex"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingAlex");
|
||||||
|
}
|
||||||
|
if (Game1.player.mailReceived.Contains("birthdayDatingShane"))
|
||||||
|
{
|
||||||
|
Game1.player.mailReceived.Remove("birthdayDatingShane");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EventHelper communityCenterJunimoBirthday = BirthdayEvents.CommunityCenterJunimoBirthday();
|
||||||
|
EventHelper birthdayDating_Penny = BirthdayEvents.DatingBirthday_Penny();
|
||||||
|
EventHelper birthdayDating_Penny_Big = BirthdayEvents.DatingBirthday_Penny_BigHome();
|
||||||
|
EventHelper birthdayDating_Maru = BirthdayEvents.DatingBirthday_Maru();
|
||||||
|
EventHelper birthdayDating_Sebastian = BirthdayEvents.DatingBirthday_Sebastian();
|
||||||
|
EventHelper birthdayDating_Leah = BirthdayEvents.DatingBirthday_Leah();
|
||||||
|
EventHelper birthdayDating_Abigail = BirthdayEvents.DatingBirthday_Abigail();
|
||||||
|
EventHelper birthdayDating_Emily = BirthdayEvents.DatingBirthday_Emily();
|
||||||
|
EventHelper birthdayDating_Haley = BirthdayEvents.DatingBirthday_Haley();
|
||||||
|
EventHelper birthdayDating_Harvey = BirthdayEvents.DatingBirthday_Harvey();
|
||||||
|
EventHelper birthdayDating_Elliott = BirthdayEvents.DatingBirthday_Elliott();
|
||||||
|
EventHelper birthdayDating_Sam = BirthdayEvents.DatingBirthday_Sam();
|
||||||
|
EventHelper birthdayDating_Alex = BirthdayEvents.DatingBirthday_Alex();
|
||||||
|
EventHelper birthdayDating_Shane = BirthdayEvents.DatingBirthday_Shane();
|
||||||
|
|
||||||
|
this.eventManager.addEvent(communityCenterJunimoBirthday);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Penny);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Penny_Big);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Maru);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Sebastian);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Leah);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Abigail);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Emily);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Haley);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Harvey);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Elliott);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Sam);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Alex);
|
||||||
|
this.eventManager.addEvent(birthdayDating_Shane);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Raised before the game begins writes data to the save file (except the initial save creation).</summary>
|
/// <summary>Raised before the game begins writes data to the save file (except the initial save creation).</summary>
|
||||||
|
@ -347,8 +605,28 @@ namespace Omegasis.HappyBirthday
|
||||||
/// <param name="e">The event arguments.</param>
|
/// <param name="e">The event arguments.</param>
|
||||||
private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
|
private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!Context.IsWorldReady || Game1.eventUp || Game1.isFestival())
|
|
||||||
|
if (!Context.IsWorldReady || Game1.isFestival())
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Game1.eventUp)
|
||||||
|
{
|
||||||
|
if (this.eventManager != null)
|
||||||
|
{
|
||||||
|
this.eventManager.update();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (this.eventManager != null)
|
||||||
|
{
|
||||||
|
this.eventManager.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.HasChosenBirthday && Game1.activeClickableMenu == null && Game1.player.Name.ToLower() != "unnamed farmhand")
|
if (!this.HasChosenBirthday && Game1.activeClickableMenu == null && Game1.player.Name.ToLower() != "unnamed farmhand")
|
||||||
{
|
{
|
||||||
Game1.activeClickableMenu = new BirthdayMenu(this.PlayerData.BirthdaySeason, this.PlayerData.BirthdayDay, this.SetBirthday);
|
Game1.activeClickableMenu = new BirthdayMenu(this.PlayerData.BirthdaySeason, this.PlayerData.BirthdayDay, this.SetBirthday);
|
||||||
|
@ -364,70 +642,120 @@ namespace Omegasis.HappyBirthday
|
||||||
{
|
{
|
||||||
string starMessage = BirthdayMessages.GetTranslatedString("Happy Birthday: Star Message");
|
string starMessage = BirthdayMessages.GetTranslatedString("Happy Birthday: Star Message");
|
||||||
|
|
||||||
|
|
||||||
|
//ModMonitor.Log(starMessage);
|
||||||
Messages.ShowStarMessage(starMessage);
|
Messages.ShowStarMessage(starMessage);
|
||||||
MultiplayerSupport.SendBirthdayMessageToOtherPlayers();
|
MultiplayerSupport.SendBirthdayMessageToOtherPlayers();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Game1.player.mailbox.Add("birthdayMom");
|
Game1.player.mailbox.Add("birthdayMom");
|
||||||
Game1.player.mailbox.Add("birthdayDad");
|
Game1.player.mailbox.Add("birthdayDad");
|
||||||
|
|
||||||
try
|
if (Game1.player.friendshipData.ContainsKey("Penny"))
|
||||||
{
|
{
|
||||||
this.ResetVillagerQueue();
|
if (Game1.player.friendshipData["Penny"].IsDating()){
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingPenny");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Maru"))
|
||||||
{
|
{
|
||||||
this.Monitor.Log(ex.ToString(), LogLevel.Error);
|
if (Game1.player.friendshipData["Maru"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingMaru");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Leah"))
|
||||||
|
{
|
||||||
|
if (Game1.player.friendshipData["Leah"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingLeah");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Abigail"))
|
||||||
|
{
|
||||||
|
if (Game1.player.friendshipData["Abigail"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingAbigail");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Emily"))
|
||||||
|
{
|
||||||
|
if (Game1.player.friendshipData["Emily"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingEmily");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Haley"))
|
||||||
|
{
|
||||||
|
if (Game1.player.friendshipData["Haley"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingHaley");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Sebastian"))
|
||||||
|
{
|
||||||
|
if (Game1.player.friendshipData["Sebastian"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingSebastian");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Harvey"))
|
||||||
|
{
|
||||||
|
if (Game1.player.friendshipData["Harvey"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingHarvey");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Elliott"))
|
||||||
|
{
|
||||||
|
if (Game1.player.friendshipData["Elliott"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingElliott");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Sam"))
|
||||||
|
{
|
||||||
|
if (Game1.player.friendshipData["Sam"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingSam");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Alex"))
|
||||||
|
{
|
||||||
|
if (Game1.player.friendshipData["Alex"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingAlex");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Game1.player.friendshipData.ContainsKey("Shane"))
|
||||||
|
{
|
||||||
|
if (Game1.player.friendshipData["Shane"].IsDating())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayDatingShane");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Game1.player.CanReadJunimo())
|
||||||
|
{
|
||||||
|
Game1.player.mailbox.Add("birthdayJunimos");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach (GameLocation location in Game1.locations)
|
foreach (GameLocation location in Game1.locations)
|
||||||
{
|
{
|
||||||
foreach (NPC npc in location.characters)
|
foreach (NPC npc in location.characters)
|
||||||
{
|
{
|
||||||
if (npc is Child || npc is Horse || npc is Junimo || npc is Monster || npc is Pet)
|
if (npc is Child || npc is Horse || npc is Junimo || npc is Monster || npc is Pet)
|
||||||
continue;
|
continue;
|
||||||
|
string message = this.messages.getBirthdayMessage(npc.Name);
|
||||||
//Add in birthday dialogues for npc.
|
Dialogue d = new Dialogue(message, npc);
|
||||||
try
|
npc.CurrentDialogue.Push(d);
|
||||||
{
|
if (npc.CurrentDialogue.ElementAt(0) != d) npc.setNewDialogue(message);
|
||||||
if (Game1.player.getFriendshipHeartLevelForNPC(npc.Name) >= Config.minimumFriendshipLevelForBirthdayWish)
|
|
||||||
{
|
|
||||||
bool spouseMessage = false; //Used to determine if there is a valid spouse message for the player. If false load in the generic birthday wish.
|
|
||||||
//Check if npc name is spouse's name. If no spouse then add in generic dialogue.
|
|
||||||
if (this.messages.spouseBirthdayWishes.ContainsKey(npc.Name) && Game1.player.isMarried())
|
|
||||||
{
|
|
||||||
//this.Monitor.Log("Spouse Checks out");
|
|
||||||
//Check to see if spouse message exists.
|
|
||||||
if (!string.IsNullOrEmpty(this.messages.spouseBirthdayWishes[npc.Name]))
|
|
||||||
{
|
|
||||||
spouseMessage = true;
|
|
||||||
Dialogue d = new Dialogue(this.messages.spouseBirthdayWishes[npc.Name], npc);
|
|
||||||
npc.CurrentDialogue.Push(d);
|
|
||||||
if (npc.CurrentDialogue.ElementAt(0) != d) npc.setNewDialogue(this.messages.spouseBirthdayWishes[npc.Name]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
this.Monitor.Log("No spouse message???", LogLevel.Warn);
|
|
||||||
}
|
|
||||||
if (!spouseMessage)
|
|
||||||
{
|
|
||||||
//Load in
|
|
||||||
Dialogue d = new Dialogue(this.messages.birthdayWishes[npc.Name], npc);
|
|
||||||
npc.CurrentDialogue.Push(d);
|
|
||||||
if (npc.CurrentDialogue.ElementAt(0) != d) npc.setNewDialogue(this.messages.birthdayWishes[npc.Name]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
if (Game1.player.getFriendshipHeartLevelForNPC(npc.Name) >= Config.minimumFriendshipLevelForBirthdayWish)
|
|
||||||
{
|
|
||||||
Dialogue d = new Dialogue("Happy Birthday @!", npc);
|
|
||||||
npc.CurrentDialogue.Push(d);
|
|
||||||
if (npc.CurrentDialogue.ElementAt(0) != d)
|
|
||||||
npc.setNewDialogue("Happy Birthday @!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -444,33 +772,7 @@ namespace Omegasis.HappyBirthday
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set birthday gift for the player to recieve from the npc they are currently talking with.
|
|
||||||
if (Game1.currentSpeaker != null)
|
|
||||||
{
|
|
||||||
string name = Game1.currentSpeaker.Name;
|
|
||||||
if (Game1.player.getFriendshipHeartLevelForNPC(name) <= Config.minNeutralFriendshipGiftLevel) return;
|
|
||||||
if (this.IsBirthday() && this.VillagerQueue.Contains(name))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.giftManager.SetNextBirthdayGift(Game1.currentSpeaker.Name);
|
|
||||||
this.VillagerQueue.Remove(Game1.currentSpeaker.Name);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
this.Monitor.Log(ex.ToString(), LogLevel.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Validate the gift and give it to the player.
|
|
||||||
if (this.giftManager.BirthdayGiftToReceive != null)
|
|
||||||
{
|
|
||||||
while (this.giftManager.BirthdayGiftToReceive.Name == "Error Item" || this.giftManager.BirthdayGiftToReceive.Name == "Rock" || this.giftManager.BirthdayGiftToReceive.Name == "???")
|
|
||||||
this.giftManager.SetNextBirthdayGift(Game1.currentSpeaker.Name);
|
|
||||||
Game1.player.addItemByMenuIfNecessaryElseHoldUp(this.giftManager.BirthdayGiftToReceive);
|
|
||||||
this.giftManager.BirthdayGiftToReceive = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Set the player's birthday/</summary>
|
/// <summary>Set the player's birthday/</summary>
|
||||||
|
@ -493,21 +795,22 @@ namespace Omegasis.HappyBirthday
|
||||||
{
|
{
|
||||||
if (npc is Child || npc is Horse || npc is Junimo || npc is Monster || npc is Pet)
|
if (npc is Child || npc is Horse || npc is Junimo || npc is Monster || npc is Pet)
|
||||||
continue;
|
continue;
|
||||||
if (this.VillagerQueue.Contains(npc.Name))
|
if (this.VillagerQueue.ContainsKey(npc.Name))
|
||||||
continue;
|
continue;
|
||||||
this.VillagerQueue.Add(npc.Name);
|
this.VillagerQueue.Add(npc.Name,new VillagerInfo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Get whether today is the player's birthday.</summary>
|
/// <summary>Get whether today is the player's birthday.</summary>
|
||||||
private bool IsBirthday()
|
public bool IsBirthday()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
this.PlayerData.BirthdayDay == Game1.dayOfMonth
|
this.PlayerData.BirthdayDay == Game1.dayOfMonth
|
||||||
&& this.PlayerData.BirthdaySeason == Game1.currentSeason;
|
&& this.PlayerData.BirthdaySeason.ToLower().Equals(Game1.currentSeason.ToLower());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/// <summary>Migrate the legacy settings for the current player.</summary>
|
/// <summary>Migrate the legacy settings for the current player.</summary>
|
||||||
private void MigrateLegacyData()
|
private void MigrateLegacyData()
|
||||||
{
|
{
|
||||||
|
@ -543,5 +846,6 @@ namespace Omegasis.HappyBirthday
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,9 +70,12 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="StardustCore">
|
||||||
|
<HintPath>$(GamePath)\Mods\StardustCore\StardustCore.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -80,13 +83,16 @@
|
||||||
<Compile Include="..\GlobalAssemblyInfo.cs">
|
<Compile Include="..\GlobalAssemblyInfo.cs">
|
||||||
<Link>Properties\GlobalAssemblyInfo.cs</Link>
|
<Link>Properties\GlobalAssemblyInfo.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="BirthdayEvents.cs" />
|
|
||||||
<Compile Include="BirthdayMessages.cs" />
|
<Compile Include="BirthdayMessages.cs" />
|
||||||
|
<Compile Include="Framework\BirthdayEvents.cs" />
|
||||||
<Compile Include="Framework\BirthdayMenu.cs" />
|
<Compile Include="Framework\BirthdayMenu.cs" />
|
||||||
<Compile Include="Framework\ModConfig.cs" />
|
<Compile Include="Framework\ModConfig.cs" />
|
||||||
<Compile Include="Framework\MultiplayerSupport.cs" />
|
<Compile Include="Framework\MultiplayerSupport.cs" />
|
||||||
<Compile Include="Framework\PlayerData.cs" />
|
<Compile Include="Framework\PlayerData.cs" />
|
||||||
|
<Compile Include="Framework\EventPreconditions\FarmerBirthdayPrecondition.cs" />
|
||||||
|
<Compile Include="Framework\EventPreconditions\SpouseBirthdayPrecondition.cs" />
|
||||||
<Compile Include="Framework\TranslationInfo.cs" />
|
<Compile Include="Framework\TranslationInfo.cs" />
|
||||||
|
<Compile Include="Framework\VillagerInfo.cs" />
|
||||||
<Compile Include="HappyBirthday.cs" />
|
<Compile Include="HappyBirthday.cs" />
|
||||||
<Compile Include="Framework\Messages.cs" />
|
<Compile Include="Framework\Messages.cs" />
|
||||||
<Compile Include="Framework\ObjectUtility.cs" />
|
<Compile Include="Framework\ObjectUtility.cs" />
|
||||||
|
@ -94,50 +100,8 @@
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Content\Dialogue\Brazillian Portuguese\BirthdayWishes.pt-BR.json">
|
<None Include="ModAssets\Gifts\BirthdayGifts.json" />
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<None Include="ModAssets\Gifts\SpouseBirthdayGifts.json" />
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\Brazillian Portuguese\SpouseBirthdayWishes.pt-BR.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\Chinese\BirthdayWishes.zh-CN.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\Chinese\SpouseBirthdayWishes.zh-CN.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\English\BirthdayWishes.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\English\SpouseBirthdayWishes.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\German\BirthdayWishes.de-DE.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\German\SpouseBirthdayWishes.de-DE.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\Japanese\BirthdayWishes.ja-JP.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\Japanese\SpouseBirthdayWishes.ja-JP.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\Russian\BirthdayWishes.ru-RU.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\Russian\SpouseBirthdayWishes.ru-RU.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\Spanish\BirthdayWishes.es-ES.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Dialogue\Spanish\SpouseBirthdayWishes.es-ES.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Content\Gifts\BirthdayGifts.json" />
|
|
||||||
<None Include="Content\Gifts\SpouseBirthdayGifts.json" />
|
|
||||||
<None Include="manifest.json" />
|
<None Include="manifest.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -146,6 +110,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Changelog.txt" />
|
<Content Include="Changelog.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(SolutionDir)\deploy.targets" />
|
<Import Project="$(SolutionDir)\deploy.targets" />
|
||||||
</Project>
|
</Project>
|
|
@ -2,5 +2,7 @@
|
||||||
"Mail:birthdayMom": "",
|
"Mail:birthdayMom": "",
|
||||||
"Mail:birthdayDad": "",
|
"Mail:birthdayDad": "",
|
||||||
"Happy Birthday: Star Message": "",
|
"Happy Birthday: Star Message": "",
|
||||||
"Happy Birthday: Farmhand Birthday Message": ""
|
"Happy Birthday: Farmhand Birthday Message": "",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
}
|
}
|
|
@ -2,5 +2,7 @@
|
||||||
"Mail:birthdayMom": "",
|
"Mail:birthdayMom": "",
|
||||||
"Mail:birthdayDad": "",
|
"Mail:birthdayDad": "",
|
||||||
"Happy Birthday: Star Message": "",
|
"Happy Birthday: Star Message": "",
|
||||||
"Happy Birthday: Farmhand Birthday Message": ""
|
"Happy Birthday: Farmhand Birthday Message": "",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
}
|
}
|
|
@ -2,5 +2,7 @@
|
||||||
"Mail:birthdayMom": "",
|
"Mail:birthdayMom": "",
|
||||||
"Mail:birthdayDad": "",
|
"Mail:birthdayDad": "",
|
||||||
"Happy Birthday: Star Message": "",
|
"Happy Birthday: Star Message": "",
|
||||||
"Happy Birthday: Farmhand Birthday Message": ""
|
"Happy Birthday: Farmhand Birthday Message": "",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
}
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Mail:birthdayMom": "",
|
||||||
|
"Mail:birthdayDad": "",
|
||||||
|
"Happy Birthday: Star Message": "",
|
||||||
|
"Happy Birthday: Farmhand Birthday Message": "",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Mail:birthdayMom": "",
|
||||||
|
"Mail:birthdayDad": "",
|
||||||
|
"Happy Birthday: Star Message": "",
|
||||||
|
"Happy Birthday: Farmhand Birthday Message": "",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"Robin": "",
|
||||||
|
"Demetrius": "",
|
||||||
|
"Maru": "",
|
||||||
|
"Sebastian": "",
|
||||||
|
"Linus": "",
|
||||||
|
"Pierre": "",
|
||||||
|
"Caroline": "",
|
||||||
|
"Abigail": "",
|
||||||
|
"Alex": "",
|
||||||
|
"George": "",
|
||||||
|
"Evelyn": "",
|
||||||
|
"Lewis": "",
|
||||||
|
"Clint": "",
|
||||||
|
"Penny": "",
|
||||||
|
"Pam": "",
|
||||||
|
"Emily": "",
|
||||||
|
"Haley": "",
|
||||||
|
"Jas": "",
|
||||||
|
"Vincent": "",
|
||||||
|
"Jodi": "",
|
||||||
|
"Kent": "",
|
||||||
|
"Sam": "",
|
||||||
|
"Leah": "",
|
||||||
|
"Shane": "",
|
||||||
|
"Marnie": "",
|
||||||
|
"Elliott": "",
|
||||||
|
"Gus": "",
|
||||||
|
"Dwarf": "",
|
||||||
|
"Wizard": "",
|
||||||
|
"Harvey": "",
|
||||||
|
"Sandy": "",
|
||||||
|
"Willy": "",
|
||||||
|
"Krobus": ""
|
||||||
|
}
|
|
@ -2,5 +2,7 @@
|
||||||
"Mail:birthdayMom": "",
|
"Mail:birthdayMom": "",
|
||||||
"Mail:birthdayDad": "",
|
"Mail:birthdayDad": "",
|
||||||
"Happy Birthday: Star Message": "",
|
"Happy Birthday: Star Message": "",
|
||||||
"Happy Birthday: Farmhand Birthday Message": ""
|
"Happy Birthday: Farmhand Birthday Message": "",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
}
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"Robin": "",
|
||||||
|
"Demetrius": "",
|
||||||
|
"Maru": "",
|
||||||
|
"Sebastian": "",
|
||||||
|
"Linus": "",
|
||||||
|
"Pierre": "",
|
||||||
|
"Caroline": "",
|
||||||
|
"Abigail": "",
|
||||||
|
"Alex": "",
|
||||||
|
"George": "",
|
||||||
|
"Evelyn": "",
|
||||||
|
"Lewis": "",
|
||||||
|
"Clint": "",
|
||||||
|
"Penny": "",
|
||||||
|
"Pam": "",
|
||||||
|
"Emily": "",
|
||||||
|
"Haley": "",
|
||||||
|
"Jas": "",
|
||||||
|
"Vincent": "",
|
||||||
|
"Jodi": "",
|
||||||
|
"Kent": "",
|
||||||
|
"Sam": "",
|
||||||
|
"Leah": "",
|
||||||
|
"Shane": "",
|
||||||
|
"Marnie": "",
|
||||||
|
"Elliott": "",
|
||||||
|
"Gus": "",
|
||||||
|
"Dwarf": "",
|
||||||
|
"Wizard": "",
|
||||||
|
"Harvey": "",
|
||||||
|
"Sandy": "",
|
||||||
|
"Willy": "",
|
||||||
|
"Krobus": ""
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Mail:birthdayMom": "",
|
||||||
|
"Mail:birthdayDad": "",
|
||||||
|
"Happy Birthday: Star Message": "",
|
||||||
|
"Happy Birthday: Farmhand Birthday Message": "",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"Robin": "",
|
||||||
|
"Demetrius": "",
|
||||||
|
"Maru": "",
|
||||||
|
"Sebastian": "",
|
||||||
|
"Linus": "",
|
||||||
|
"Pierre": "",
|
||||||
|
"Caroline": "",
|
||||||
|
"Abigail": "",
|
||||||
|
"Alex": "",
|
||||||
|
"George": "",
|
||||||
|
"Evelyn": "",
|
||||||
|
"Lewis": "",
|
||||||
|
"Clint": "",
|
||||||
|
"Penny": "",
|
||||||
|
"Pam": "",
|
||||||
|
"Emily": "",
|
||||||
|
"Haley": "",
|
||||||
|
"Jas": "",
|
||||||
|
"Vincent": "",
|
||||||
|
"Jodi": "",
|
||||||
|
"Kent": "",
|
||||||
|
"Sam": "",
|
||||||
|
"Leah": "",
|
||||||
|
"Shane": "",
|
||||||
|
"Marnie": "",
|
||||||
|
"Elliott": "",
|
||||||
|
"Gus": "",
|
||||||
|
"Dwarf": "",
|
||||||
|
"Wizard": "",
|
||||||
|
"Harvey": "",
|
||||||
|
"Sandy": "",
|
||||||
|
"Willy": "",
|
||||||
|
"Krobus": ""
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"Alex": "",
|
||||||
|
"Elliott": "",
|
||||||
|
"Harvey": "",
|
||||||
|
"Sam": "",
|
||||||
|
"Sebastian": "",
|
||||||
|
"Shane": "",
|
||||||
|
"Abigail": "",
|
||||||
|
"Emily": "",
|
||||||
|
"Haley": "",
|
||||||
|
"Leah": "",
|
||||||
|
"Maru": "",
|
||||||
|
"Penny": ""
|
||||||
|
}
|
|
@ -2,5 +2,7 @@
|
||||||
"Mail:birthdayMom": "",
|
"Mail:birthdayMom": "",
|
||||||
"Mail:birthdayDad": "",
|
"Mail:birthdayDad": "",
|
||||||
"Happy Birthday: Star Message": "",
|
"Happy Birthday: Star Message": "",
|
||||||
"Happy Birthday: Farmhand Birthday Message": ""
|
"Happy Birthday: Farmhand Birthday Message": "",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
}
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"Robin": "",
|
||||||
|
"Demetrius": "",
|
||||||
|
"Maru": "",
|
||||||
|
"Sebastian": "",
|
||||||
|
"Linus": "",
|
||||||
|
"Pierre": "",
|
||||||
|
"Caroline": "",
|
||||||
|
"Abigail": "",
|
||||||
|
"Alex": "",
|
||||||
|
"George": "",
|
||||||
|
"Evelyn": "",
|
||||||
|
"Lewis": "",
|
||||||
|
"Clint": "",
|
||||||
|
"Penny": "",
|
||||||
|
"Pam": "",
|
||||||
|
"Emily": "",
|
||||||
|
"Haley": "",
|
||||||
|
"Jas": "",
|
||||||
|
"Vincent": "",
|
||||||
|
"Jodi": "",
|
||||||
|
"Kent": "",
|
||||||
|
"Sam": "",
|
||||||
|
"Leah": "",
|
||||||
|
"Shane": "",
|
||||||
|
"Marnie": "",
|
||||||
|
"Elliott": "",
|
||||||
|
"Gus": "",
|
||||||
|
"Dwarf": "",
|
||||||
|
"Wizard": "",
|
||||||
|
"Harvey": "",
|
||||||
|
"Sandy": "",
|
||||||
|
"Willy": "",
|
||||||
|
"Krobus": ""
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"Alex": "",
|
||||||
|
"Elliott": "",
|
||||||
|
"Harvey": "",
|
||||||
|
"Sam": "",
|
||||||
|
"Sebastian": "",
|
||||||
|
"Shane": "",
|
||||||
|
"Abigail": "",
|
||||||
|
"Emily": "",
|
||||||
|
"Haley": "",
|
||||||
|
"Leah": "",
|
||||||
|
"Maru": "",
|
||||||
|
"Penny": ""
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Mail:birthdayMom": "ƒорогой @,^ — днем рождени¤, мо¤ радость. Ёто были замечательные моменты, когда ты выростал в доброго, трудолюбивого человека. я надеюсь, в твоей жизни будет куча превосходных моментов. ^ — любовью, мама ^ P.S. «десь находить небольшой подарок, который ¤ сделала дл¤ теб¤. %item object 221 1 %%",
|
||||||
|
"Mail:birthdayDad": "ƒорогой @,^ — днем рождени¤, мой ребенок. «десь немного тихо в твой день рождени¤ с тех пор, как ты уехал на ферму, но тво¤ мать и ¤ знаем, что ты со своим дедушкой делаешь нас гордыми. ћы оба знаем, что жить на ферме может быть трудно, но мы верим в теб¤ на все 100%, просто продолжай следовать своим мечтам.^ — любовью папа ^ P.S. “ут есть немного денег, которые помогут тебе на ферме. ”дачи! %item money 5000 5001%%",
|
||||||
|
"Happy Birthday: Star Message": "Ёто твой день рождени¤! — днем рождени¤!",
|
||||||
|
"Happy Birthday: Farmhand Birthday Message": "Ёто твой день рождени¤! ѕоздравл¤ю с этим!",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"Robin": "",
|
||||||
|
"Demetrius": "",
|
||||||
|
"Maru": "",
|
||||||
|
"Sebastian": "",
|
||||||
|
"Linus": "",
|
||||||
|
"Pierre": "",
|
||||||
|
"Caroline": "",
|
||||||
|
"Abigail": "",
|
||||||
|
"Alex": "",
|
||||||
|
"George": "",
|
||||||
|
"Evelyn": "",
|
||||||
|
"Lewis": "",
|
||||||
|
"Clint": "",
|
||||||
|
"Penny": "",
|
||||||
|
"Pam": "",
|
||||||
|
"Emily": "",
|
||||||
|
"Haley": "",
|
||||||
|
"Jas": "",
|
||||||
|
"Vincent": "",
|
||||||
|
"Jodi": "",
|
||||||
|
"Kent": "",
|
||||||
|
"Sam": "",
|
||||||
|
"Leah": "",
|
||||||
|
"Shane": "",
|
||||||
|
"Marnie": "",
|
||||||
|
"Elliott": "",
|
||||||
|
"Gus": "",
|
||||||
|
"Dwarf": "",
|
||||||
|
"Wizard": "",
|
||||||
|
"Harvey": "",
|
||||||
|
"Sandy": "",
|
||||||
|
"Willy": "",
|
||||||
|
"Krobus": ""
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"Alex": "",
|
||||||
|
"Elliott": "",
|
||||||
|
"Harvey": "",
|
||||||
|
"Sam": "",
|
||||||
|
"Sebastian": "",
|
||||||
|
"Shane": "",
|
||||||
|
"Abigail": "",
|
||||||
|
"Emily": "",
|
||||||
|
"Haley": "",
|
||||||
|
"Leah": "",
|
||||||
|
"Maru": "",
|
||||||
|
"Penny": ""
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Mail:birthdayMom": "",
|
||||||
|
"Mail:birthdayDad": "",
|
||||||
|
"Happy Birthday: Star Message": "",
|
||||||
|
"Happy Birthday: Farmhand Birthday Message": "",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"Robin": "",
|
||||||
|
"Demetrius": "",
|
||||||
|
"Maru": "",
|
||||||
|
"Sebastian": "",
|
||||||
|
"Linus": "",
|
||||||
|
"Pierre": "",
|
||||||
|
"Caroline": "",
|
||||||
|
"Abigail": "",
|
||||||
|
"Alex": "",
|
||||||
|
"George": "",
|
||||||
|
"Evelyn": "",
|
||||||
|
"Lewis": "",
|
||||||
|
"Clint": "",
|
||||||
|
"Penny": "",
|
||||||
|
"Pam": "",
|
||||||
|
"Emily": "",
|
||||||
|
"Haley": "",
|
||||||
|
"Jas": "",
|
||||||
|
"Vincent": "",
|
||||||
|
"Jodi": "",
|
||||||
|
"Kent": "",
|
||||||
|
"Sam": "",
|
||||||
|
"Leah": "",
|
||||||
|
"Shane": "",
|
||||||
|
"Marnie": "",
|
||||||
|
"Elliott": "",
|
||||||
|
"Gus": "",
|
||||||
|
"Dwarf": "",
|
||||||
|
"Wizard": "",
|
||||||
|
"Harvey": "",
|
||||||
|
"Sandy": "",
|
||||||
|
"Willy": "",
|
||||||
|
"Krobus": ""
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"Alex": "",
|
||||||
|
"Elliott": "",
|
||||||
|
"Harvey": "",
|
||||||
|
"Sam": "",
|
||||||
|
"Sebastian": "",
|
||||||
|
"Shane": "",
|
||||||
|
"Abigail": "",
|
||||||
|
"Emily": "",
|
||||||
|
"Haley": "",
|
||||||
|
"Leah": "",
|
||||||
|
"Maru": "",
|
||||||
|
"Penny": ""
|
||||||
|
}
|
|
@ -2,5 +2,7 @@
|
||||||
"Mail:birthdayMom": "亲爱的@,^ 生日快乐宝贝。看着你成长成为一个善良努力的人,就如我一直梦想着你成为的样子,我感到十分欣喜。我希望你能继续跟你爱的人制造更多美好的回忆。 ^ 爱你的,妈妈 ^ 附言:这是我给你做的一点小礼物。 %item object 221 1 %%",
|
"Mail:birthdayMom": "亲爱的@,^ 生日快乐宝贝。看着你成长成为一个善良努力的人,就如我一直梦想着你成为的样子,我感到十分欣喜。我希望你能继续跟你爱的人制造更多美好的回忆。 ^ 爱你的,妈妈 ^ 附言:这是我给你做的一点小礼物。 %item object 221 1 %%",
|
||||||
"Mail:birthdayDad": "亲爱的@,^ 生日快乐孩子。你生日的这天没有你,我们这儿还挺寂寞的,但我和你妈妈都知道你让我们和你爷爷感到骄傲。我们知道你一个人生活可能会很艰难,但我们百分百相信你能做到,所以继续追求你的梦想吧。^ 爱你的,爸爸 ^ 附言:这是能在农场上帮到你的一些零用钱。祝你好运! %item money 5000 5001 %%",
|
"Mail:birthdayDad": "亲爱的@,^ 生日快乐孩子。你生日的这天没有你,我们这儿还挺寂寞的,但我和你妈妈都知道你让我们和你爷爷感到骄傲。我们知道你一个人生活可能会很艰难,但我们百分百相信你能做到,所以继续追求你的梦想吧。^ 爱你的,爸爸 ^ 附言:这是能在农场上帮到你的一些零用钱。祝你好运! %item money 5000 5001 %%",
|
||||||
"Happy Birthday: Star Message": "今天是你的生日!生日快乐!",
|
"Happy Birthday: Star Message": "今天是你的生日!生日快乐!",
|
||||||
"Happy Birthday: Farmhand Birthday Message": ""
|
"Happy Birthday: Farmhand Birthday Message": "",
|
||||||
|
"Season": "Season",
|
||||||
|
"Date": "Date"
|
||||||
}
|
}
|
|
@ -1,10 +1,13 @@
|
||||||
{
|
{
|
||||||
"Name": "Happy Birthday",
|
"Name": "Happy Birthday",
|
||||||
"Author": "Alpha_Omegasis",
|
"Author": "Alpha_Omegasis",
|
||||||
"Version": "1.9.0",
|
"Version": "1.10.5",
|
||||||
"Description": "Adds the farmer's birthday to the game.",
|
"Description": "Adds the farmer's birthday to the game.",
|
||||||
"UniqueID": "Omegasis.HappyBirthday",
|
"UniqueID": "Omegasis.HappyBirthday",
|
||||||
"EntryDll": "HappyBirthday.dll",
|
"EntryDll": "HappyBirthday.dll",
|
||||||
"MinimumApiVersion": "2.10.1",
|
"MinimumApiVersion": "2.10.1",
|
||||||
"UpdateKeys": [ "Nexus:520" ]
|
"UpdateKeys": [ "Nexus:520" ],
|
||||||
|
"Dependencies": [
|
||||||
|
{ "UniqueID": "Omegasis.StardustCore" },
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|
|
@ -9,21 +9,65 @@ namespace Omegasis.MoreRain.Framework
|
||||||
/// <summary>The chance out of 100 that it will storm tomorrow if it's spring.</summary>
|
/// <summary>The chance out of 100 that it will storm tomorrow if it's spring.</summary>
|
||||||
public int SpringThunderChance { get; set; } = 5;
|
public int SpringThunderChance { get; set; } = 5;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Changes the mod's logic to prioritize setting a thunderstorm before checking for just a normal rainy day.
|
||||||
|
/// False = The mod will try to set a normal rainy day first.
|
||||||
|
/// True = The mod will try to set a thunderstorm (stormy) day first.
|
||||||
|
/// Default:False
|
||||||
|
/// </summary>
|
||||||
|
public bool PrioritizeSpringStorms { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>The chance out of 100 that it will rain tomorrow if it's summer.</summary>
|
/// <summary>The chance out of 100 that it will rain tomorrow if it's summer.</summary>
|
||||||
public int SummerRainChance { get; set; } = 5;
|
public int SummerRainChance { get; set; } = 5;
|
||||||
|
|
||||||
/// <summary>The chance out of 100 that it will storm tomorrow if it's summer.</summary>
|
/// <summary>The chance out of 100 that it will storm tomorrow if it's summer.</summary>
|
||||||
public int SummerThunderChance { get; set; } = 10;
|
public int SummerThunderChance { get; set; } = 10;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Changes the mod's logic to prioritize setting a thunderstorm before checking for just a normal rainy day.
|
||||||
|
/// False = The mod will try to set a normal rainy day first.
|
||||||
|
/// True = The mod will try to set a thunderstorm (stormy) day first.
|
||||||
|
/// Default:True
|
||||||
|
/// </summary>
|
||||||
|
public bool PrioritizeSummerStorms { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>The chance out of 100 that it will rain tomorrow if it's fall.</summary>
|
/// <summary>The chance out of 100 that it will rain tomorrow if it's fall.</summary>
|
||||||
public int FallRainChance { get; set; } = 15;
|
public int FallRainChance { get; set; } = 15;
|
||||||
|
|
||||||
/// <summary>The chance out of 100 that it will storm tomorrow if it's fall.</summary>
|
/// <summary>The chance out of 100 that it will storm tomorrow if it's fall.</summary>
|
||||||
public int FallThunderChance { get; set; } = 5;
|
public int FallThunderChance { get; set; } = 5;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Changes the mod's logic to prioritize setting a thunderstorm before checking for just a normal rainy day.
|
||||||
|
/// False = The mod will try to set a normal rainy day first.
|
||||||
|
/// True = The mod will try to set a thunderstorm (stormy) day first.
|
||||||
|
/// Default:False
|
||||||
|
/// </summary>
|
||||||
|
public bool PrioritizeFallStorms { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If set to true the mod will try to make it snow in fall just for fun.
|
||||||
|
/// </summary>
|
||||||
|
public bool SnowInFall { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The chance amouunt for it to snow in the fall.
|
||||||
|
/// </summary>
|
||||||
|
public int FallSnowChance { get; set; } = 5;
|
||||||
|
|
||||||
/// <summary>The chance out of 100 that it will snow tomorrow if it's winter.</summary>
|
/// <summary>The chance out of 100 that it will snow tomorrow if it's winter.</summary>
|
||||||
public int WinterSnowChance { get; set; } = 15;
|
public int WinterSnowChance { get; set; } = 15;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If set to true then the mod will check to set rainy days in the winter. Default: False
|
||||||
|
/// </summary>
|
||||||
|
public bool RainInWinter { get; set; } = false;
|
||||||
|
/// <summary>
|
||||||
|
/// The chance that it will rain on a winter day. Only checked if the RainInWinter config option is true.
|
||||||
|
/// </summary>
|
||||||
|
public int WinterRainChance { get; set; } = 10;
|
||||||
|
|
||||||
/// <summary>Whether to suppress verbose logging.</summary>
|
/// <summary>Whether to suppress verbose logging.</summary>
|
||||||
public bool SuppressLog { get; set; } = true;
|
public bool SuppressLog { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,55 +75,130 @@ namespace Omegasis.MoreRain
|
||||||
{
|
{
|
||||||
case "spring":
|
case "spring":
|
||||||
// set rain
|
// set rain
|
||||||
if (chance <= this.Config.SpringRainChance)
|
if (this.Config.PrioritizeSpringStorms)
|
||||||
{
|
{
|
||||||
Game1.weatherForTomorrow = Game1.weather_rain;
|
if (chance <= this.Config.SpringThunderChance)
|
||||||
this.VerboseLog("It will rain tomorrow.");
|
{
|
||||||
return;
|
Game1.weatherForTomorrow = Game1.weather_lightning;
|
||||||
|
this.VerboseLog("It will be stormy tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (chance <= this.Config.SpringRainChance)
|
||||||
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_rain;
|
||||||
|
this.VerboseLog("It will rain tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (chance <= this.Config.SpringThunderChance)
|
|
||||||
{
|
{
|
||||||
Game1.weatherForTomorrow = Game1.weather_lightning;
|
if (chance <= this.Config.SpringRainChance)
|
||||||
this.VerboseLog("It will be stormy tomorrow.");
|
{
|
||||||
return;
|
Game1.weatherForTomorrow = Game1.weather_rain;
|
||||||
|
this.VerboseLog("It will rain tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chance <= this.Config.SpringThunderChance)
|
||||||
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_lightning;
|
||||||
|
this.VerboseLog("It will be stormy tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "summer":
|
case "summer":
|
||||||
// set rain
|
// set rain
|
||||||
if (chance <= this.Config.SummerRainChance)
|
if (this.Config.PrioritizeSummerStorms)
|
||||||
{
|
{
|
||||||
Game1.weatherForTomorrow = Game1.weather_rain;
|
if (chance <= this.Config.SummerThunderChance)
|
||||||
this.VerboseLog("It will rain tomorrow.");
|
{
|
||||||
return;
|
Game1.weatherForTomorrow = Game1.weather_lightning;
|
||||||
|
this.VerboseLog("It will be stormy tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (chance <= this.Config.SummerRainChance)
|
||||||
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_rain;
|
||||||
|
this.VerboseLog("It will rain tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (chance <= this.Config.SummerRainChance)
|
||||||
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_rain;
|
||||||
|
this.VerboseLog("It will rain tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (chance <= this.Config.SummerThunderChance)
|
||||||
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_lightning;
|
||||||
|
this.VerboseLog("It will be stormy tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (chance <= this.Config.SummerThunderChance)
|
|
||||||
{
|
|
||||||
Game1.weatherForTomorrow = Game1.weather_lightning;
|
|
||||||
this.VerboseLog("It will be stormy tomorrow.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "fall":
|
case "fall":
|
||||||
case "autumn":
|
case "autumn":
|
||||||
// set rain
|
// set rain
|
||||||
if (chance <= this.Config.FallRainChance)
|
|
||||||
|
if (this.Config.PrioritizeFallStorms)
|
||||||
{
|
{
|
||||||
Game1.weatherForTomorrow = Game1.weather_rain;
|
if (chance <= this.Config.FallThunderChance)
|
||||||
this.VerboseLog("It will rain tomorrow.");
|
{
|
||||||
return;
|
Game1.weatherForTomorrow = Game1.weather_lightning;
|
||||||
|
this.VerboseLog("It will be stormy tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.Config.SnowInFall)
|
||||||
|
{
|
||||||
|
if (chance <= this.Config.FallSnowChance)
|
||||||
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_snow;
|
||||||
|
this.VerboseLog("It will snow tomorrow.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chance <= this.Config.FallRainChance)
|
||||||
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_rain;
|
||||||
|
this.VerboseLog("It will rain tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (chance <= this.Config.FallRainChance)
|
||||||
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_rain;
|
||||||
|
this.VerboseLog("It will rain tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.Config.SnowInFall)
|
||||||
|
{
|
||||||
|
if (chance <= this.Config.FallSnowChance)
|
||||||
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_snow;
|
||||||
|
this.VerboseLog("It will snow tomorrow.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chance <= this.Config.FallThunderChance)
|
||||||
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_lightning;
|
||||||
|
this.VerboseLog("It will be stormy tomorrow.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chance <= this.Config.FallThunderChance)
|
|
||||||
{
|
|
||||||
Game1.weatherForTomorrow = Game1.weather_lightning;
|
|
||||||
this.VerboseLog("It will be stormy tomorrow.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "winter":
|
case "winter":
|
||||||
|
@ -133,10 +208,13 @@ namespace Omegasis.MoreRain
|
||||||
Game1.weatherForTomorrow = Game1.weather_snow;
|
Game1.weatherForTomorrow = Game1.weather_snow;
|
||||||
this.VerboseLog("It will snow tomorrow.");
|
this.VerboseLog("It will snow tomorrow.");
|
||||||
}
|
}
|
||||||
else
|
if (this.Config.RainInWinter)
|
||||||
{
|
{
|
||||||
//StardewValley.Game1.weatherForTomorrow = StardewValley.Game1.weather_sunny;
|
if (chance <= this.Config.WinterRainChance)
|
||||||
this.VerboseLog("It will not snow tomorrow.");
|
{
|
||||||
|
Game1.weatherForTomorrow = Game1.weather_rain;
|
||||||
|
this.VerboseLog("It will snow tomorrow.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"Name": "More Rain",
|
"Name": "More Rain",
|
||||||
"Author": "Alpha_Omegasis",
|
"Author": "Alpha_Omegasis",
|
||||||
"Version": "1.8.0",
|
"Version": "1.9.0",
|
||||||
"Description": "Change how much it rains in the game.",
|
"Description": "Change how much it rains in the game.",
|
||||||
"UniqueID": "Omegasis.MoreRain",
|
"UniqueID": "Omegasis.MoreRain",
|
||||||
"EntryDll": "MoreRain.dll",
|
"EntryDll": "MoreRain.dll",
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Omegasis.NightOwl.Framework
|
||||||
|
{
|
||||||
|
public class NightOwlAPI
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds an event that triggers after the player has been warped to their pre-collapse position.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ID">The id of the event.</param>
|
||||||
|
/// <param name="Action">The code that triggers.</param>
|
||||||
|
public void addPostWarpEvent(string ID,Func<bool> Action)
|
||||||
|
{
|
||||||
|
NightOwl.PostWarpCharacter.Add(ID, Action);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes an event that triggers when the player has been warped to their pre-collapse position.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ID"></param>
|
||||||
|
public void removePostWarpEvent(string ID)
|
||||||
|
{
|
||||||
|
if (NightOwl.PostWarpCharacter.ContainsKey(ID))
|
||||||
|
{
|
||||||
|
NightOwl.PostWarpCharacter.Remove(ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds an event that triggers when the player has stayed up all night until 6:00 A.M.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ID">The id of the event.</param>
|
||||||
|
/// <param name="Action">The code that triggers.</param>
|
||||||
|
public void addPlayerUpLateEvent(string ID, Func<bool> Action)
|
||||||
|
{
|
||||||
|
NightOwl.OnPlayerStayingUpLate.Add(ID, Action);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes an event that triggers when the player has stayed up all night.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ID"></param>
|
||||||
|
public void removePlayerUpLateEvent(string ID)
|
||||||
|
{
|
||||||
|
if (NightOwl.OnPlayerStayingUpLate.ContainsKey(ID))
|
||||||
|
{
|
||||||
|
NightOwl.OnPlayerStayingUpLate.Remove(ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,6 +20,19 @@ namespace Omegasis.NightOwl
|
||||||
/// <summary>The mod entry point.</summary>
|
/// <summary>The mod entry point.</summary>
|
||||||
public class NightOwl : Mod
|
public class NightOwl : Mod
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/*********
|
||||||
|
** Static Fields
|
||||||
|
*********/
|
||||||
|
/// <summary>
|
||||||
|
/// Events that are handled after the player has warped after they have stayed up late.
|
||||||
|
/// </summary>
|
||||||
|
public static Dictionary<string, Func<bool>> PostWarpCharacter = new Dictionary<string, Func<bool>>();
|
||||||
|
/// <summary>
|
||||||
|
/// Events that are handled when the player has stayed up late and are going to collapse.
|
||||||
|
/// </summary>
|
||||||
|
public static Dictionary<string, Func<bool>> OnPlayerStayingUpLate = new Dictionary<string, Func<bool>>();
|
||||||
|
|
||||||
/*********
|
/*********
|
||||||
** Fields
|
** Fields
|
||||||
*********/
|
*********/
|
||||||
|
@ -71,12 +84,13 @@ namespace Omegasis.NightOwl
|
||||||
/// <summary>Determines whehther or not to rewarp the player's horse to them.</summary>
|
/// <summary>Determines whehther or not to rewarp the player's horse to them.</summary>
|
||||||
private bool shouldWarpHorse;
|
private bool shouldWarpHorse;
|
||||||
|
|
||||||
/// <summary>Event in the night taht simulates the earthquake event that should happen.</summary>
|
/// <summary>Event in the night that simulates the earthquake event that should happen.</summary>
|
||||||
StardewValley.Events.SoundInTheNightEvent eve;
|
StardewValley.Events.SoundInTheNightEvent eve;
|
||||||
|
|
||||||
private List<NetByte> oldAnimalHappiness;
|
private List<NetByte> oldAnimalHappiness;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********
|
/*********
|
||||||
** Public methods
|
** Public methods
|
||||||
*********/
|
*********/
|
||||||
|
@ -98,6 +112,10 @@ namespace Omegasis.NightOwl
|
||||||
this.shouldWarpHorse = false;
|
this.shouldWarpHorse = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override object GetApi()
|
||||||
|
{
|
||||||
|
return new NightOwlAPI();
|
||||||
|
}
|
||||||
|
|
||||||
/*********
|
/*********
|
||||||
** Private methods
|
** Private methods
|
||||||
|
@ -117,7 +135,13 @@ namespace Omegasis.NightOwl
|
||||||
if (Context.IsWorldReady && this.JustStartedNewDay && this.Config.KeepPositionAfterCollapse)
|
if (Context.IsWorldReady && this.JustStartedNewDay && this.Config.KeepPositionAfterCollapse)
|
||||||
{
|
{
|
||||||
if (this.PreCollapseMap != null)
|
if (this.PreCollapseMap != null)
|
||||||
|
{
|
||||||
Game1.warpFarmer(this.PreCollapseMap, this.PreCollapseTile.X, this.PreCollapseTile.Y, false);
|
Game1.warpFarmer(this.PreCollapseMap, this.PreCollapseTile.X, this.PreCollapseTile.Y, false);
|
||||||
|
foreach (var v in PostWarpCharacter)
|
||||||
|
{
|
||||||
|
v.Value.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.PreCollapseMap = null;
|
this.PreCollapseMap = null;
|
||||||
this.JustStartedNewDay = false;
|
this.JustStartedNewDay = false;
|
||||||
|
@ -148,7 +172,7 @@ namespace Omegasis.NightOwl
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Config.KeepMoneyAfterCollapse)
|
if (this.Config.KeepMoneyAfterCollapse)
|
||||||
Game1.player.money += collapseFee;
|
Game1.player.Money += collapseFee;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Raised after the player loads a save slot and the world is initialised.</summary>
|
/// <summary>Raised after the player loads a save slot and the world is initialised.</summary>
|
||||||
|
@ -183,7 +207,13 @@ namespace Omegasis.NightOwl
|
||||||
if (this.Config.KeepPositionAfterCollapse)
|
if (this.Config.KeepPositionAfterCollapse)
|
||||||
{
|
{
|
||||||
if (!Game1.weddingToday)
|
if (!Game1.weddingToday)
|
||||||
|
{
|
||||||
Game1.warpFarmer(this.PreCollapseMap, this.PreCollapseTile.X, this.PreCollapseTile.Y, false);
|
Game1.warpFarmer(this.PreCollapseMap, this.PreCollapseTile.X, this.PreCollapseTile.Y, false);
|
||||||
|
foreach(var v in PostWarpCharacter)
|
||||||
|
{
|
||||||
|
v.Value.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.horse != null && this.shouldWarpHorse)
|
if (this.horse != null && this.shouldWarpHorse)
|
||||||
|
@ -196,7 +226,7 @@ namespace Omegasis.NightOwl
|
||||||
if (this.isBathing)
|
if (this.isBathing)
|
||||||
Game1.player.swimming.Value = true;
|
Game1.player.swimming.Value = true;
|
||||||
|
|
||||||
//Reflction to ensure that the railroad becomes properly unblocked.
|
//Reflection to ensure that the railroad becomes properly unblocked.
|
||||||
if (Game1.dayOfMonth == 1 && Game1.currentSeason == "summer" && Game1.year == 1)
|
if (Game1.dayOfMonth == 1 && Game1.currentSeason == "summer" && Game1.year == 1)
|
||||||
{
|
{
|
||||||
Mountain mountain = (Mountain)Game1.getLocationFromName("Mountain");
|
Mountain mountain = (Mountain)Game1.getLocationFromName("Mountain");
|
||||||
|
@ -304,7 +334,7 @@ namespace Omegasis.NightOwl
|
||||||
this.PreCollapseMap = Game1.player.currentLocation.Name;
|
this.PreCollapseMap = Game1.player.currentLocation.Name;
|
||||||
this.PreCollapseStamina = Game1.player.stamina;
|
this.PreCollapseStamina = Game1.player.stamina;
|
||||||
this.PreCollapseHealth = Game1.player.health;
|
this.PreCollapseHealth = Game1.player.health;
|
||||||
this.PreCollapseMoney = Game1.player.money;
|
this.PreCollapseMoney = Game1.player.Money;
|
||||||
this.isInSwimSuit = Game1.player.bathingClothes.Value;
|
this.isInSwimSuit = Game1.player.bathingClothes.Value;
|
||||||
this.isBathing = Game1.player.swimming.Value;
|
this.isBathing = Game1.player.swimming.Value;
|
||||||
|
|
||||||
|
@ -314,7 +344,7 @@ namespace Omegasis.NightOwl
|
||||||
|
|
||||||
if (Game1.activeClickableMenu != null) Game1.activeClickableMenu.exitThisMenu(true); //Exit menus.
|
if (Game1.activeClickableMenu != null) Game1.activeClickableMenu.exitThisMenu(true); //Exit menus.
|
||||||
|
|
||||||
Game1.timeOfDay += 2400; //Recalculate for the sake of technically being up a whole day.
|
//Game1.timeOfDay += 2400; //Recalculate for the sake of technically being up a whole day. Why did I put this here?
|
||||||
|
|
||||||
//Reset animal happiness since it drains over night.
|
//Reset animal happiness since it drains over night.
|
||||||
for (int i = 0; i < this.oldAnimalHappiness.Count; i++)
|
for (int i = 0; i < this.oldAnimalHappiness.Count; i++)
|
||||||
|
@ -322,6 +352,11 @@ namespace Omegasis.NightOwl
|
||||||
Game1.getFarm().getAllFarmAnimals()[i].happiness.Value = this.oldAnimalHappiness[i].Value;
|
Game1.getFarm().getAllFarmAnimals()[i].happiness.Value = this.oldAnimalHappiness[i].Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach(var v in OnPlayerStayingUpLate)
|
||||||
|
{
|
||||||
|
v.Value.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
Game1.player.startToPassOut();
|
Game1.player.startToPassOut();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -78,6 +78,7 @@
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Framework\ModConfig.cs" />
|
<Compile Include="Framework\ModConfig.cs" />
|
||||||
<Compile Include="Framework\NightFishing.cs" />
|
<Compile Include="Framework\NightFishing.cs" />
|
||||||
|
<Compile Include="Framework\NightOwlAPI.cs" />
|
||||||
<Compile Include="NightOwl.cs" />
|
<Compile Include="NightOwl.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"Name": "Night Owl",
|
"Name": "Night Owl",
|
||||||
"Author": "Alpha_Omegasis",
|
"Author": "Alpha_Omegasis",
|
||||||
"Version": "1.9.0",
|
"Version": "1.10.0",
|
||||||
"Description": "Lets you stay up all night.",
|
"Description": "Lets you stay up all night.",
|
||||||
"UniqueID": "Omegasis.NightOwl",
|
"UniqueID": "Omegasis.NightOwl",
|
||||||
"EntryDll": "NightOwl.dll",
|
"EntryDll": "NightOwl.dll",
|
||||||
"MinimumApiVersion": "2.10.1",
|
"MinimumApiVersion": "3.0.0",
|
||||||
"UpdateKeys": [ "Nexus:433" ]
|
"UpdateKeys": [ "Nexus:433" ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
|
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue