Skip to content

Commit

Permalink
General updates
Browse files Browse the repository at this point in the history
- Some manifest changes
- Stardew Notification bump to 1.8.9 (see CHANGELOG)
- Stardew Notification now includes German Translation
  • Loading branch information
Sakorona committed Jan 9, 2022
1 parent 8bd7f80 commit 1f3f5b5
Show file tree
Hide file tree
Showing 12 changed files with 203 additions and 16 deletions.
6 changes: 0 additions & 6 deletions ClimatesOfFerngill/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
"UniqueID": "KoihimeNakamura.ClimatesOfFerngill",
"EntryDll": "ClimatesOfFerngill.dll",
"MinimumApiVersion": "3.4.0",
"ModUpdater": {
"Repository": "SDVMods",
"User": "Sakorona",
"Directory": "_releases",
"ModFolder": "ClimatesOfFerngill"
},
"Dependencies": [
{
"UniqueID": "Platonymous.Toolkit",
Expand Down
8 changes: 7 additions & 1 deletion StardewNotification/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
1.8.8
1.8.9
- now includes support for GMCM
- adds in an option to have notifications on day start start later
- turns off tool upgrade notifications by default (still an option if people want it on)
- Show Empty Hay now works properly, if set to false, it will not show the notification.

1.8.8
- fixes silo showing notifications when under construction

1.8.7
Expand Down
5 changes: 3 additions & 2 deletions StardewNotification/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
public class SNConfiguration
{
// General Notifications
public float NotificationTime { get; set; } = 6150;
public float NotificationDuration { get; set; } = 6150;
public bool NotifyBirthdays { get; set; } = true;
public bool NotifyBirthdayReminder { get; set; } = true;
public int RunNotificationsTime { get ; set; } = 0600; // 6:00 am
public int BirthdayReminderTime { get; set; } = 1700; // 5:00 pm
public bool NotifyFestivals { get; set; } = true;
public bool NotifyTravelingMerchant { get; set; } = true;
public bool NotifyToolUpgrade { get; set; } = true;
public bool NotifyToolUpgrade { get; set; } = false;
public bool NotifyQueenOfSauce { get; set; } = true;
public bool NotifyMaxLuck { get; set; } = true;
public bool NotifyMinLuck { get; set; } = true;
Expand Down
28 changes: 28 additions & 0 deletions StardewNotification/Integrations/GenericModConfigMenuAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using StardewModdingAPI;
using System;

namespace StardewNotification.Integrations
{
public interface GenericModConfigMenuAPI
{
void RegisterModConfig(IManifest mod, Action revertToDefault, Action saveToFile);

void RegisterSimpleOption(IManifest mod, string optionName, string optionDesc, Func<bool> optionGet, Action<bool> optionSet);
void RegisterSimpleOption(IManifest mod, string optionName, string optionDesc, Func<int> optionGet, Action<int> optionSet);
void RegisterSimpleOption(IManifest mod, string optionName, string optionDesc, Func<float> optionGet, Action<float> optionSet);
void RegisterSimpleOption(IManifest mod, string optionName, string optionDesc, Func<string> optionGet, Action<string> optionSet);
void RegisterSimpleOption(IManifest mod, string optionName, string optionDesc, Func<SButton> optionGet, Action<SButton> optionSet);

void RegisterClampedOption(IManifest mod, string optionName, string optionDesc, Func<int> optionGet, Action<int> optionSet, int min, int max);
void RegisterClampedOption(IManifest mod, string optionName, string optionDesc, Func<float> optionGet, Action<float> optionSet, float min, float max);

void RegisterChoiceOption(IManifest mod, string optionName, string optionDesc, Func<string> optionGet, Action<string> optionSet, string[] choices);

void RegisterComplexOption(IManifest mod, string optionName, string optionDesc,
Func<Vector2, object, object> widgetUpdate,
Func<SpriteBatch, Vector2, object, object> widgetDraw,
Action<object> onSave);
}
}
55 changes: 53 additions & 2 deletions StardewNotification/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,65 @@ public override void Entry(IModHelper helper)
generalNotification = new GeneralNotification();
productionNotification = new ProductionNotification();

helper.Events.GameLoop.GameLaunched += OnGameLaunched;
helper.Events.GameLoop.DayStarted += OnDayStarted;
helper.Events.Player.Warped += OnWarped;
helper.Events.GameLoop.TimeChanged += OnTimeChanged;
}

private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
{
var api = Helper.ModRegistry.GetApi<Integrations.GenericModConfigMenuAPI>("spacechase0.GenericModConfigMenu");
if (api != null)
{
Monitor.Log("Accessed mod-provided API for Generic Mod Config Menu.", LogLevel.Trace);
api.RegisterModConfig(ModManifest, () => Config = new SNConfiguration(), () => Helper.WriteConfig(Config));

api.RegisterClampedOption(ModManifest, Helper.Translation.Get("gmcmNotDurTitle"),Helper.Translation.Get("gmcmNotDurDesc"),() => (float)Config.NotificationDuration, (float val) => Config.NotificationDuration = val, 0f,14000f);
api.RegisterClampedOption(ModManifest, Helper.Translation.Get("gmcmNotDurTitle"), Helper.Translation.Get("gmcmNotDurDesc"), () => Config.RunNotificationsTime, (int val) => Config.RunNotificationsTime = val, 600, 1400);

api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifOnBirthTitle"), Helper.Translation.Get("gmcmNotifOnBirthDesc"), () => Config.NotifyBirthdays, (bool val) => Config.NotifyBirthdays = val);
api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifOnBirthRemindTitle"), Helper.Translation.Get("gmcmNotifOnBirthRemindDesc"), () => Config.NotifyBirthdayReminder, (bool val) => Config.NotifyBirthdayReminder = val);
api.RegisterClampedOption(ModManifest, Helper.Translation.Get("gmcmNotifOnBirthRemindTimeTitle"), Helper.Translation.Get("gmcmNotifOnBirthRemindTimeDesc"), () => Config.RunNotificationsTime, (int val) => Config.RunNotificationsTime = val, 900, 1900);

api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifOnFestivalTitle"), Helper.Translation.Get("gmcmNotifOnFestivalDesc"), () => Config.NotifyFestivals, (bool val) => Config.NotifyFestivals = val);
api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifOnMerchantTitle"), Helper.Translation.Get("gmcmNotifOnMerchantDesc"), () => Config.NotifyTravelingMerchant, (bool val) => Config.NotifyTravelingMerchant = val);
api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifOnToolTitle"), Helper.Translation.Get("gmcmNotifOnToolDesc"), () => Config.NotifyToolUpgrade, (bool val) => Config.NotifyToolUpgrade = val);

api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifOnGLuckTitle"), Helper.Translation.Get("gmcmNotifOnGLuckDesc"), () => Config.NotifyMaxLuck, (bool val) => Config.NotifyMaxLuck = val);
api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifOnBLuckTitle"), Helper.Translation.Get("gmcmNotifOnBLuckDesc"), () => Config.NotifyMinLuck, (bool val) => Config.NotifyMinLuck = val);

api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifShowHayCountTitle"), Helper.Translation.Get("gmcmNotifShowHayCountDesc"), () => Config.NotifyHay, (bool val) => Config.NotifyHay = val);
api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifEmptyHayTitle"), Helper.Translation.Get("gmcmNotifEmptyHayDesc"), () => Config.ShowEmptyhay, (bool val) => Config.ShowEmptyhay = val);

api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifWeatNDTitle"), Helper.Translation.Get("gmcmNotifWeatNDDesc"), () => Config.ShowWeatherNextDay, (bool val) => Config.ShowWeatherNextDay = val);
api.RegisterClampedOption(ModManifest, Helper.Translation.Get("gmcmRemindTimeForNWDTitle"), Helper.Translation.Get("gmcmRemindTimeForNWDDesc"), () => Config.WeatherNextDayTime, (int val) => Config.WeatherNextDayTime = val, 900, 2600);

api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifTVChanTitle"), Helper.Translation.Get("gmcmNotifTVChanDesc"), () => Config.NotifyTVChannels, (bool val) => Config.NotifyTVChannels = val);
api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifSpringOnionTitle"), Helper.Translation.Get("gmcmNotifSpringOnionDesc"), () => Config.ShowSpringOnionCount, (bool val) => Config.ShowSpringOnionCount = val);

api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifFarmCaveTitle"), Helper.Translation.Get("gmcmNotifFarmCaveDesc"), () => Config.NotifyFarmCave, (bool val) => Config.NotifyFarmCave = val);
api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifGreenCropTitle"), Helper.Translation.Get("gmcmNotifGreenCropDesc"), () => Config.NotifyGreenhouseCrops, (bool val) => Config.NotifyGreenhouseCrops = val);

api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifShedProdTitle"), Helper.Translation.Get("gmcmNotifShedProdDesc"), () => Config.NotifyShed, (bool val) => Config.NotifyShed = val);
api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifGreenProdTitle"), Helper.Translation.Get("gmcmNotifGreenProdDesc"), () => Config.NotifyGreenhouse, (bool val) => Config.NotifyGreenhouse = val);
api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifCellarProdTitle"), Helper.Translation.Get("gmcmNotifCellarProdDesc"), () => Config.NotifyCellar, (bool val) => Config.NotifyCellar = val);
api.RegisterSimpleOption(ModManifest, Helper.Translation.Get("gmcmNotifBarnProdTitle"), Helper.Translation.Get("gmcmNotifBarnProdDesc"), () => Config.NotifyBarn, (bool val) => Config.NotifyBarn = val);
}
}

/// <summary>Raised after the in-game clock time changes.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event arguments.</param>
private void OnTimeChanged(object sender, TimeChangedEventArgs e)
{
// send daily notifications
if (Config.RunNotificationsTime != 600 && Config.RunNotificationsTime == e.NewTime)
{
generalNotification.DoNewDayNotifications(Helper.Translation);
harvestableNotification.CheckHarvestsAroundFarm();
}

if (Config.NotifyBirthdayReminder && e.NewTime == Config.BirthdayReminderTime)
GeneralNotification.DoBirthdayReminder(Helper.Translation);

Expand Down Expand Up @@ -61,8 +110,10 @@ private void OnDayStarted(object sender, DayStartedEventArgs e)
return;

// send daily notifications
generalNotification.DoNewDayNotifications(Helper.Translation);
harvestableNotification.CheckHarvestsAroundFarm();
if (Config.RunNotificationsTime == 600) {
generalNotification.DoNewDayNotifications(Helper.Translation);
harvestableNotification.CheckHarvestsAroundFarm();
}
}
}
}
2 changes: 1 addition & 1 deletion StardewNotification/StardewNotification.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>StardewNotification</AssemblyName>
<RootNamespace>StardewNotification</RootNamespace>
<Version>1.8.8</Version>
<Version>1.8.9</Version>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion StardewNotification/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class Util

public static void ShowMessage(string msg)
{
var hudmsg = new HUDMessage(msg, Color.SeaGreen, StardewNotification.Config.NotificationTime , true)
var hudmsg = new HUDMessage(msg, Color.SeaGreen, StardewNotification.Config.NotificationDuration , true)
{
whatType = 2
};
Expand Down
51 changes: 51 additions & 0 deletions StardewNotification/i18n/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
// Notification messages
"travelingMerchant": "Der reisende Händler ist heute da ",
"queenSauce": "Heute kommt 'Die Königin der Soßen'",
"checkLiving": "Heute kommt 'Leben vom Land'!",
"luckyDay": "Glückstag!",
"unluckyDay": "Unglückstag!",

// Festivals
"fMsg": "Heute: {{fest}}!",
"festival": "Fest",
"EggFestival": "Eierfest",
"FlowerDance": "Blumentanz",
"Luau": "Luau",
"MoonlightJellies": "Tanz der Mondlichtquallen",
"ValleyFair": "Sternentautaler Volksfest",
"SpiritsEve": "Geisternacht",
"IceFestival": "Fest des Eises",
"WinterStar": "Fest des Wintersterns",
"NightMarket": "Nachtmarkt",
"SecretSantaReminder": "{{charName}} ist dein geheimer Freund",

"Salmonberry": "Lachsbeeren-Saison",
"Seashells": "Muscheln am Strand",
"Blackberry": "Brombeer-Saison",

// Weathers
"weather-rain": "Regen",
"weather-sunny": "Sonne",
"weather-tstorm": "Gewitter",
"weather-snow": "Schnee",
"weather-wind": "Wind",
"weather-festival": "ein Fest",
"weather-wedding": "eine Hochzeit",

// Locations
"CaveMushroom": "Höhlenpilze zur Erne bereit",
"CaveFruit": "Höhlenfrüchte zur Erne bereit",

"birthday": "{{charName}}s Geburtstag!",
"weather": "Morgen gibt es {{weather}}.",
"birthdayReminder": "Vergiss nicht {{charName}} ein Geburtstagsgeschenk zu geben!",
"toolPickup": "{{toolName}} zur Abholung bereit",
"springOnion": "{{count}} Frühlingszwiebeln wachsen im Wald",
"readyHarvest": "{{cropName}} zur Ernte bereit",
"greenhouse_crops": "Ernte im Gewächshaus bereit",
"autoGrabber": "Automatischer Greifer bereit zur Abholung",
"hayMessage": "Die Silos melden {{hayAmt}} Heu",
"noHayMessage": "Kein Heu in den Silos!",
"FishPond": "Fischteiche zur Ernte bereit"
}
58 changes: 57 additions & 1 deletion StardewNotification/i18n/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,61 @@
"autoGrabber": "The auto grabber has items for harvest",
"hayMessage": "Silos report {{hayAmt}} pieces of hay",
"noHayMessage": "No hay in the silos.",
"FishPond": "Fish Ponds ready for harvest."
"FishPond": "Fish Ponds ready for harvest.",

//GMCM fields
"gmcmNotDurTitle": "Notification Duration",
"gmcmNotDurDesc": "The amount of ticks the messages appear. Note that 7000 ticks is 10 minutes. This value is clamped between 0 and 14000 ticks",
"gmcmNotifTimeTitle": "Notification Time",
"gmcmNotifTimeDesc": "The time the day start notifications appear. We recommend you leave this at 6am. Clamped between 6am and 2pm.",
"gmcmNotifOnBirthTitle": "Notify on Birthdays",
"gmcmNotifOnBirthDesc": "Turn this on to be notified about birthdays",
"gmcmNotifOnBirthRemindTitle": "Birthday Notification Reminder",
"gmcmNotifOnBirthRemindDesc": "Turn this on to be reminded to give a gift that day",
"gmcmNotifOnBirthRemindTimeTitle": "Birthday Reminder Time",
"gmcmNotifOnBirthRemindTimeDesc": "The time the birthday reminder notification will appear. Clamped between 9am and 7pm. (most NPCs will not be available after this point)",
"gmcmNotifOnFestivalTitle": "Festival Notifications",
"gmcmNotifOnFestivalDesc": "Turn this on to be told it's a festival today",
"gmcmNotifOnMerchantTitle": "Traveling Merchant Notifications",
"gmcmNotifOnMerchantDesc": "Turn this on to be told if the traveling merchant has arrived",

"gmcmNotifOnToolTitle": "Tool Upgrade Notifications",
"gmcmNotifOnToolDesc": "Turn this on to be told if you have a tool waiting to be picked up.",

"gmcmNotifOnGLuckTitle": "Max Luck Notifications",
"gmcmNotifOnGLucklDesc": "Turn this on to be told if you have maximum luck that day.",

"gmcmNotifOnBLuckTitle": "Min Luck Notifications",
"gmcmNotifOnBLucklDesc": "Turn this on to be told if your have minimum luck that day.",

"gmcmNotifShowHayCountTitle": "Show Daily Hay Count",
"gmcmNotifShowHayCountDesc": "Turn this on to get notifications for hay counts daily.",
"gmcmNotifEmptyHayTitle": "Show Empty Hay",
"gmcmNotifEmptyHayDesc": "Turn this on to get notifications if you are out of hay. Note this must be on to be told if you are out of hay.",

"gmcmNotifWeatNDTitle": "Show Weather Next Day",
"gmcmNotifWeatNDDesc": "Turn this on to get notifications to see what the weather is the next day",
"gmcmRemindTimeForNWDTitle": "Reminder Time for Next Day Weather",
"gmcmRemindTimeForNWDDesc": "The time the birthday reminder notification appear. Clamped between 9am and 2am",

"gmcmNotifTVChanTitle": "Notify for TV Channels",
"gmcmNotifTVChanDesc": "Turn this on to get notifications for today's TV channels.",
"gmcmNotifSpringOnionTitle": "Show Spring Onion Count",
"gmcmNotifSpringOnionDesc": "Turn this on to get notifications for the spring onion count.",

"gmcmNotifFarmCaveTitle": "Notify for Farm Cave",
"gmcmNotifFarmCaveDesc": "Turn this on to get notifications for farm cave harvest.",
"gmcmNotifGreenCropTitle": "Notify for Greenhouse Crops",
"gmcmNotifGreenCropDesc": "Turn this on to get notifications for greenhouse crops harvest.",

"gmcmNotifShedProdTitle": "Notify for Shed Production",
"gmcmNotifShedProdDesc": "Turn this on to get notifications for machines in the shed",
"gmcmNotifGreenProdTitle": "Notify for Greenhouse Production",
"gmcmNotifGreenProdDesc": "Turn this on to get notifications for machines in the greenhouse.",

"gmcmNotifCellarProdTitle": "Notify for Cellar Production",
"gmcmNotifCellarProdDesc": "Turn this on to get notifications for machines in the cellar.",
"gmcmNotifBronProdTitle": "Notify for Barn Productio",
"gmcmNotifBronProdDesc": "Turn this on to get notifications for machines in the barn."
}

4 changes: 2 additions & 2 deletions StardewNotification/manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"Name": "Stardew Notification",
"Author": "monopandora, maintained by Sakorona",
"Version": "1.8.8",
"Version": "1.8.9",
"Description": "Daily Notification mod for Stardew Valley",
"UniqueID": "mondopandora.stardewnotification",
"EntryDll": "StardewNotification.dll",
"MinimumApiVersion": "3.0",
"MinimumApiVersion": "3.13",
"UpdateKeys": [ "Nexus:4713", "ModDrop:664154" ]
}
Binary file added _releases/CustomizableCartRedux 1.4.5-beta.1.zip
Binary file not shown.
Binary file added _releases/StardewNotification 1.8.9.zip
Binary file not shown.

0 comments on commit 1f3f5b5

Please sign in to comment.