More Symphony bugfixes. Finished degeneralizing Vocalization lines. Not bothering with Utility.

This commit is contained in:
2018-08-20 21:19:27 -07:00
parent 5c114285c5
commit 4defd4f24b
6 changed files with 124 additions and 9 deletions

View File

@ -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);
}

View File

@ -583,7 +583,7 @@ namespace StardewSymphonyRemastered.Framework
}
//return new KeyValuePair<string, List<string>>(key, listOfSongsWithTriggers[key]);
StardewSymphonyRemastered.StardewSymphony.ModMonitor.Log("Getting an invalid song list with key: " + key);
return new KeyValuePair<string, List<Song>>("",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)
{

View File

@ -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);

View File

@ -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",

View File

@ -81,6 +81,46 @@ namespace Vocalization.Framework
}
public static List<string> getSeasons()
{
List<string> seasons = new List<string>();
seasons.Add("spring");
seasons.Add("summer");
seasons.Add("fall");
seasons.Add("winter");
return seasons;
}
/// <summary>
/// Gets a list of all of the possible cooking recipes in Stardew Valley.
/// </summary>
/// <param name="translation"></param>
/// <returns></returns>
public static List<string> getAllCookingRecipes(string translation)
{
List<string> recipes = new List<string>();
Dictionary<string, string> cookingDict = Game1.content.Load<Dictionary<string, string>>(Path.Combine("Data", "TV", Vocalization.config.translationInfo.getXNBForTranslation("CookingChannel", translation)));
if (Vocalization.config.translationInfo.getTranslationNameFromPath(translation) == "English")
{
foreach(KeyValuePair<string,string> pair in cookingDict)
{
string name = pair.Value.Split('/').ElementAt(0);
recipes.Add(name);
}
}
else
{
foreach (KeyValuePair<string, string> pair in cookingDict)
{
string[] data = pair.Value.Split('/');
string name = data.ElementAt(data.Length - 1);
recipes.Add(name);
}
}
return recipes;
}
public static List<string> getCarpenterStock(string translation)
{
List<string> stock = new List<string>();

View File

@ -834,6 +834,79 @@ namespace Vocalization
if (!key.Contains("TV")) continue;
//If the key contains the character's name.
List<string> cleanDialogues = new List<string>();
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<string> cleanDialogues2 = new List<string>();
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<string> cleanDialogues2 = new List<string>();
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<string, string> dictionary;
foreach (string season in Vocabulary.getSeasons())
{
for (int i = 1; i <= 28; i++)
{
try
{
dictionary = Game1.content.Load<Dictionary<string, string>>(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<string, string> 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<string> cleanDialogues = new List<string>();
cleanDialogues = sanitizeDialogueFromDictionaries(rawDialogue, cue);