diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs index ba47da50..adfd467a 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs @@ -2264,6 +2264,8 @@ namespace StardewSymphonyRemastered.Framework.Menus return; } + if (this.currentSelectedSong == null) return; + if (this.currentSelectedSong.label == null) return; info.Value.songInformation.addSongToTriggerList(generateSongTriggerKeyFromSelection(), this.currentSelectedSong.label); } diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/SongSpecifics.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/SongSpecifics.cs index 52fcf16b..5ce138f1 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/SongSpecifics.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/SongSpecifics.cs @@ -583,7 +583,7 @@ namespace StardewSymphonyRemastered.Framework } //return new KeyValuePair>(key, listOfSongsWithTriggers[key]); - + StardewSymphonyRemastered.StardewSymphony.ModMonitor.Log("Getting an invalid song list with key: " + key); return new KeyValuePair>("",null); } @@ -616,7 +616,12 @@ namespace StardewSymphonyRemastered.Framework } var songKeyPair = getSongList(songListKey); //Get the trigger list - + if (songKeyPair.Value == null) + { + if (StardewSymphony.Config.EnableDebugLog) + StardewSymphony.ModMonitor.Log("For some reason you are trying to add a song to a list that is null. The name of the song list is " + songListKey); + return; + } var song = getSongFromList(listOfSongsWithoutTriggers, songName); //Get the song from the master song pool if (song == null) { diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/WavMusicPack.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/WavMusicPack.cs index ad3ecbdf..bfdc4b05 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/WavMusicPack.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/WavMusicPack.cs @@ -134,15 +134,10 @@ namespace StardewSymphonyRemastered.Framework //StardewSymphony.ModMonitor.Log(count.ToString()); try { - dynamicSound.SubmitBuffer(byteArray, position, count); } catch(Exception err) { - StardewSymphony.ModMonitor.Log(byteArray.Length.ToString()); - StardewSymphony.ModMonitor.Log(position.ToString()); - StardewSymphony.ModMonitor.Log(count.ToString()); - StardewSymphony.ModMonitor.Log(err.ToString(), StardewModdingAPI.LogLevel.Error); } //dynamicSound.SubmitBuffer(byteArray); diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/manifest.json b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/manifest.json index 5e6b0b04..54628bbf 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/manifest.json +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/manifest.json @@ -1,7 +1,7 @@ { "Name": "Stardew Symphony Remastered", "Author": "Alpha_Omegasis", - "Version": "2.1.2", + "Version": "2.1.3", "Description": "Adding more music to the game one beep at a time. Now with streaming!", "UniqueID": "Omegasis.StardewSymphonyRemastered", "EntryDll": "StardewSymphonyRemastered.dll", diff --git a/GeneralMods/Vocalization/Vocalization/Framework/Vocabulary.cs b/GeneralMods/Vocalization/Vocalization/Framework/Vocabulary.cs index e19c580d..609640b8 100644 --- a/GeneralMods/Vocalization/Vocalization/Framework/Vocabulary.cs +++ b/GeneralMods/Vocalization/Vocalization/Framework/Vocabulary.cs @@ -81,6 +81,46 @@ namespace Vocalization.Framework } + public static List getSeasons() + { + List seasons = new List(); + seasons.Add("spring"); + seasons.Add("summer"); + seasons.Add("fall"); + seasons.Add("winter"); + return seasons; + } + + /// + /// Gets a list of all of the possible cooking recipes in Stardew Valley. + /// + /// + /// + public static List getAllCookingRecipes(string translation) + { + List recipes = new List(); + Dictionary cookingDict = Game1.content.Load>(Path.Combine("Data", "TV", Vocalization.config.translationInfo.getXNBForTranslation("CookingChannel", translation))); + + if (Vocalization.config.translationInfo.getTranslationNameFromPath(translation) == "English") + { + foreach(KeyValuePair pair in cookingDict) + { + string name = pair.Value.Split('/').ElementAt(0); + recipes.Add(name); + } + } + else + { + foreach (KeyValuePair pair in cookingDict) + { + string[] data = pair.Value.Split('/'); + string name = data.ElementAt(data.Length - 1); + recipes.Add(name); + } + } + return recipes; + } + public static List getCarpenterStock(string translation) { List stock = new List(); diff --git a/GeneralMods/Vocalization/Vocalization/Vocalization.cs b/GeneralMods/Vocalization/Vocalization/Vocalization.cs index 2ceedf80..0817d70a 100644 --- a/GeneralMods/Vocalization/Vocalization/Vocalization.cs +++ b/GeneralMods/Vocalization/Vocalization/Vocalization.cs @@ -834,6 +834,79 @@ namespace Vocalization if (!key.Contains("TV")) continue; //If the key contains the character's name. List cleanDialogues = new List(); + + + if(key== "TV.cs.13151") + { + foreach(string recipe in Vocabulary.getAllCookingRecipes(translation)) + { + rawDialogue = config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:TV.cs.13151"), translation, (object)recipe); + List cleanDialogues2 = new List(); + cleanDialogues2 = sanitizeDialogueFromDictionaries(rawDialogue, cue); + foreach (var str in cleanDialogues2) + { + cue.addDialogue(str, new VoiceAudioOptions()); //Make a new dialogue line based off of the text, but have the .wav value as empty. + } + } + continue; + } + + + if (key == "TV.cs.13153") + { + foreach (string recipe in Vocabulary.getAllCookingRecipes(translation)) + { + rawDialogue = config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:TV.cs.13153"), translation, (object)recipe); + List cleanDialogues2 = new List(); + cleanDialogues2 = sanitizeDialogueFromDictionaries(rawDialogue, cue); + foreach (var str in cleanDialogues2) + { + cue.addDialogue(str, new VoiceAudioOptions()); //Make a new dialogue line based off of the text, but have the .wav value as empty. + } + } + continue; + } + + if (key == "TV.cs.13175") + { + Dictionary dictionary; + foreach (string season in Vocabulary.getSeasons()) + { + for (int i = 1; i <= 28; i++) + { + try + { + dictionary = Game1.content.Load>(Path.Combine("Data", "Festivals", config.translationInfo.getXNBForTranslation(season + (object)(i.ToString()), translation))); + ModMonitor.Log("Scraping TV Festival File: " + season + i.ToString()); + dictionary.TryGetValue("name", out string name); + dictionary.TryGetValue("conditions", out string condition); + string location = condition.Split('/').ElementAt(0); + string times = condition.Split('/').ElementAt(1); + string startTime = times.Split(' ').ElementAt(0); + string finishTime = times.Split(' ').ElementAt(1); + config.translationInfo.changeLocalizedContentManagerFromTranslation(translation); + string dialogueString=config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:TV.cs.13175"), translation, (object)name, (object)location, (object)Game1.getTimeOfDayString(Convert.ToInt32(startTime)), (object)Game1.getTimeOfDayString(Convert.ToInt32(finishTime))); + config.translationInfo.resetLocalizationCode(); + + cleanDialogues = sanitizeDialogueFromDictionaries(dialogueString, cue); + + foreach (var str in cleanDialogues) + { + string ahh = sanitizeDialogueFromMailDictionary(str); + cue.addDialogue(ahh, new VoiceAudioOptions()); //Make a new dialogue line based off of the text, but have the .wav value as empty. + } + + + } + catch(Exception err) + { + //ModMonitor.Log(err.ToString()); + } + } + } + continue; + } + cleanDialogues = sanitizeDialogueFromDictionaries(rawDialogue,cue); foreach (var str in cleanDialogues) @@ -1763,7 +1836,7 @@ namespace Vocalization foreach (KeyValuePair pair in DialogueDict) { string key = pair.Key; - if (key != cue.name) continue; + if (key != cue.name && key!=cue.name+"_spouse") continue; string rawDialogue = pair.Value; List cleanDialogues = new List(); cleanDialogues = sanitizeDialogueFromDictionaries(rawDialogue, cue);