Translation in the works.
This commit is contained in:
parent
ba64890e60
commit
8a0f669a28
|
@ -179,9 +179,16 @@ namespace Vocalization.Framework
|
|||
{
|
||||
List<string> clean = Vocalization.sanitizeDialogueFromDictionaries(sentence,this);
|
||||
foreach(var cleanSentence in clean)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.dialogueCues.Add(cleanSentence, new VoiceAudioOptions());
|
||||
}
|
||||
catch(Exception err)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -199,9 +206,17 @@ namespace Vocalization.Framework
|
|||
{
|
||||
List<string> clean = Vocalization.sanitizeDialogueFromDictionaries(sentence,this);
|
||||
foreach (var cleanSentence in clean)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.dialogueCues.Add(cleanSentence, new VoiceAudioOptions());
|
||||
}
|
||||
catch(Exception err)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -254,12 +269,8 @@ namespace Vocalization.Framework
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
@ -278,5 +289,37 @@ namespace Vocalization.Framework
|
|||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Change all of the files to the ones that are appropriate for that translation version.
|
||||
/// </summary>
|
||||
/// <param name="translation"></param>
|
||||
public void initializeForTranslation(string translation)
|
||||
{
|
||||
for (int i = 0; i < this.dataFileNames.Count; i++)
|
||||
{
|
||||
string s = dataFileNames.ElementAt(i);
|
||||
s=dataFileNames.ElementAt(i).Replace(".xnb", Vocalization.config.translationInfo.getFileExtentionForTranslation(translation));
|
||||
dataFileNames[i] = s;
|
||||
}
|
||||
|
||||
for (int i = 0; i < this.dialogueFileNames.Count; i++)
|
||||
{
|
||||
string s = dialogueFileNames.ElementAt(i);
|
||||
s=dialogueFileNames.ElementAt(i).Replace(".xnb", Vocalization.config.translationInfo.getFileExtentionForTranslation(translation));
|
||||
dialogueFileNames[i] = s;
|
||||
}
|
||||
|
||||
for (int i = 0; i < this.stringsFileNames.Count; i++)
|
||||
{
|
||||
string s = stringsFileNames.ElementAt(i);
|
||||
s=stringsFileNames.ElementAt(i).Replace(".xnb", Vocalization.config.translationInfo.getFileExtentionForTranslation(translation));
|
||||
stringsFileNames[i] = s;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,358 @@
|
|||
using StardewValley;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Vocalization.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>
|
||||
public class TranslationInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The list of all supported translations by this mod.
|
||||
/// </summary>
|
||||
public List<string> translations;
|
||||
|
||||
/// <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;
|
||||
|
||||
/// <summary>
|
||||
/// Holds the info for what translation has what file extension.
|
||||
/// </summary>
|
||||
public Dictionary<string, string> translationFileInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor.
|
||||
/// </summary>
|
||||
public TranslationInfo()
|
||||
{
|
||||
translations = new List<string>();
|
||||
|
||||
translationFileInfo = new Dictionary<string, string>();
|
||||
|
||||
translations.Add("English");
|
||||
translations.Add("Spanish");
|
||||
translations.Add("Chinese");
|
||||
translations.Add("Japanese");
|
||||
translations.Add("Russian");
|
||||
translations.Add("German");
|
||||
translations.Add("Brazillian Portuguese");
|
||||
|
||||
currentTranslation = "English";
|
||||
|
||||
translationFileInfo.Add("English", ".xnb");
|
||||
translationFileInfo.Add("Spanish", ".es - ES.xnb");
|
||||
translationFileInfo.Add("Chinese", ".zh-CN.xnb");
|
||||
translationFileInfo.Add("Japanese", ".ja-JP.xnb");
|
||||
translationFileInfo.Add("Russian", ".ru-RU.xnb");
|
||||
translationFileInfo.Add("German", ".de-DE.xnb");
|
||||
translationFileInfo.Add("Brazillian Portuguese", ".pt-BR.xnb");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the proper file extension for the current translation.
|
||||
/// </summary>
|
||||
/// <param name="translation"></param>
|
||||
/// <returns></returns>
|
||||
public string getFileExtentionForTranslation(string translation)
|
||||
{
|
||||
bool f = translationFileInfo.TryGetValue(translation, out string value);
|
||||
if (f == false) return ".xnb";
|
||||
else return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the proper XNB for Buildings (aka Blueprints) from the data folder.
|
||||
/// </summary>
|
||||
/// <param name="translation"></param>
|
||||
/// <returns></returns>
|
||||
public string getBuildingXNBForTranslation(string translation)
|
||||
{
|
||||
string buildings = "Blueprints";
|
||||
return buildings + getFileExtentionForTranslation(translation);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the proper XNB file for the name passed in. Combines the file name with it's proper translation extension.
|
||||
/// </summary>
|
||||
/// <param name="xnbFileName"></param>
|
||||
/// <param name="translation"></param>
|
||||
/// <returns></returns>
|
||||
public string getXNBForTranslation(string xnbFileName, string translation)
|
||||
{
|
||||
return xnbFileName + translation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a coresponding string from a data file in Content/Strings
|
||||
/// </summary>
|
||||
/// <param name="xnbFileName"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="translation"></param>
|
||||
/// <returns></returns>
|
||||
public string LoadStringFromStringsFile(string xnbFileName,string key,string translation)
|
||||
{
|
||||
string str = "Strings";
|
||||
string xnb = xnbFileName + getFileExtentionForTranslation(translation);
|
||||
string path = Path.Combine(str, xnbFileName);
|
||||
Dictionary<string,string> loadedDict = Game1.content.Load<Dictionary<string, string>>(path);
|
||||
return loadedDict[key];
|
||||
}
|
||||
|
||||
public string LoadStringFromStringsFile(string xnbFileName, string key, string translation, object sub1)
|
||||
{
|
||||
string loaded = LoadStringFromStringsFile(xnbFileName, key, translation);
|
||||
try
|
||||
{
|
||||
return string.Format(loaded, sub1);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return loaded;
|
||||
}
|
||||
}
|
||||
|
||||
public string LoadStringFromStringsFile(string xnbFileName, string key, string translation, object sub1, object sub2)
|
||||
{
|
||||
string loaded = LoadStringFromStringsFile(xnbFileName, key, translation);
|
||||
try
|
||||
{
|
||||
return string.Format(loaded, sub1,sub2);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return loaded;
|
||||
}
|
||||
}
|
||||
|
||||
public string LoadStringFromStringsFile(string xnbFileName, string key, string translation, object sub1, object sub2, object sub3)
|
||||
{
|
||||
string loaded = LoadStringFromStringsFile(xnbFileName, key, translation);
|
||||
try
|
||||
{
|
||||
return string.Format(loaded, sub1, sub2,sub3);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return loaded;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a corresponding string from a data file in Content/Data
|
||||
/// </summary>
|
||||
/// <param name="xnbFileName"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="translation"></param>
|
||||
/// <returns></returns>
|
||||
public string LoadStringFromDataFile(string xnbFileName, string key, string translation)
|
||||
{
|
||||
string str = "Data";
|
||||
string xnb = xnbFileName + getFileExtentionForTranslation(translation);
|
||||
string path = Path.Combine(str, xnbFileName);
|
||||
Dictionary<string, string> loadedDict = Game1.content.Load<Dictionary<string, string>>(path);
|
||||
string loaded = loadedDict[key];
|
||||
return loaded;
|
||||
}
|
||||
|
||||
public string LoadStringFromDataFile(string xnbFileName, string key, string translation, object sub1)
|
||||
{
|
||||
string loaded = LoadStringFromDataFile(xnbFileName, key, translation);
|
||||
try
|
||||
{
|
||||
return string.Format(loaded, sub1);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return loaded;
|
||||
}
|
||||
}
|
||||
|
||||
public string LoadStringFromDataFile(string xnbFileName, string key, string translation, object sub1, object sub2)
|
||||
{
|
||||
string loaded = LoadStringFromDataFile(xnbFileName, key, translation);
|
||||
try
|
||||
{
|
||||
return string.Format(loaded, sub1,sub2);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return loaded;
|
||||
}
|
||||
}
|
||||
|
||||
public string LoadStringFromDataFile(string xnbFileName, string key, string translation, object sub1, object sub2, object sub3)
|
||||
{
|
||||
string loaded = LoadStringFromDataFile(xnbFileName, key, translation);
|
||||
try
|
||||
{
|
||||
return string.Format(loaded, sub1,sub2,sub3);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
return loaded;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string LoadString(string path, string translation,object sub1, object sub2, object sub3)
|
||||
{
|
||||
string assetName;
|
||||
string key;
|
||||
this.parseStringPath(path, out assetName, out key);
|
||||
|
||||
string[] split = path.Split(new string[]{ Environment.NewLine },StringSplitOptions.None);
|
||||
string folder = split[0];
|
||||
if (folder == "Data")
|
||||
{
|
||||
if (sub3 != null) {
|
||||
return LoadStringFromDataFile(assetName, key, translation, sub1, sub2, sub3);
|
||||
}
|
||||
if (sub2 != null)
|
||||
{
|
||||
return LoadStringFromDataFile(assetName, key, translation, sub1, sub2);
|
||||
}
|
||||
|
||||
if (sub1 != null)
|
||||
{
|
||||
return LoadStringFromDataFile(assetName, key, translation, sub1);
|
||||
}
|
||||
return LoadStringFromDataFile(assetName, key, translation);
|
||||
}
|
||||
if (folder == "Strings")
|
||||
{
|
||||
if (sub3 != null)
|
||||
{
|
||||
return LoadStringFromStringsFile(assetName, key, translation, sub1, sub2, sub3);
|
||||
}
|
||||
if (sub2 != null)
|
||||
{
|
||||
return LoadStringFromStringsFile(assetName, key, translation, sub1, sub2);
|
||||
}
|
||||
|
||||
if (sub1 != null)
|
||||
{
|
||||
return LoadStringFromStringsFile(assetName, key, translation, sub1);
|
||||
}
|
||||
return LoadStringFromStringsFile(assetName, key, translation);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public virtual string LoadString(string path, string translation, object sub1, object sub2)
|
||||
{
|
||||
string assetName;
|
||||
string key;
|
||||
this.parseStringPath(path, out assetName, out key);
|
||||
|
||||
string[] split = path.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
string folder = split[0];
|
||||
if (folder == "Data")
|
||||
{
|
||||
if (sub2 != null)
|
||||
{
|
||||
return LoadStringFromDataFile(assetName, key, translation, sub1, sub2);
|
||||
}
|
||||
|
||||
if (sub1 != null)
|
||||
{
|
||||
return LoadStringFromDataFile(assetName, key, translation, sub1);
|
||||
}
|
||||
return LoadStringFromDataFile(assetName, key, translation);
|
||||
}
|
||||
if (folder == "Strings")
|
||||
{
|
||||
if (sub2 != null)
|
||||
{
|
||||
return LoadStringFromStringsFile(assetName, key, translation, sub1, sub2);
|
||||
}
|
||||
|
||||
if (sub1 != null)
|
||||
{
|
||||
return LoadStringFromStringsFile(assetName, key, translation, sub1);
|
||||
}
|
||||
return LoadStringFromStringsFile(assetName, key, translation);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public virtual string LoadString(string path, string translation, object sub1)
|
||||
{
|
||||
string assetName;
|
||||
string key;
|
||||
this.parseStringPath(path, out assetName, out key);
|
||||
|
||||
string[] split = path.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
string folder = split[0];
|
||||
if (folder == "Data")
|
||||
{
|
||||
|
||||
if (sub1 != null)
|
||||
{
|
||||
return LoadStringFromDataFile(assetName, key, translation, sub1);
|
||||
}
|
||||
return LoadStringFromDataFile(assetName, key, translation);
|
||||
}
|
||||
if (folder == "Strings")
|
||||
{
|
||||
if (sub1 != null)
|
||||
{
|
||||
return LoadStringFromStringsFile(assetName, key, translation, sub1);
|
||||
}
|
||||
return LoadStringFromStringsFile(assetName, key, translation);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public virtual string LoadString(string path, string translation)
|
||||
{
|
||||
string assetName;
|
||||
string key;
|
||||
this.parseStringPath(path, out assetName, out key);
|
||||
|
||||
string[] split = path.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
string folder = split[0];
|
||||
if (folder == "Data")
|
||||
{
|
||||
return LoadStringFromDataFile(assetName, key, translation);
|
||||
}
|
||||
if (folder == "Strings") {
|
||||
|
||||
return LoadStringFromStringsFile(assetName, key, translation);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public virtual string LoadString(string path,string translation, params object[] substitutions)
|
||||
{
|
||||
string format = this.LoadString(path,translation);
|
||||
if (substitutions.Length != 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
return string.Format(format, substitutions);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
return format;
|
||||
}
|
||||
|
||||
|
||||
private void parseStringPath(string path, out string assetName, out string key)
|
||||
{
|
||||
int length = path.IndexOf(':');
|
||||
assetName = path.Substring(0, length);
|
||||
key = path.Substring(length + 1, path.Length - length - 1);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Vocalization.Framework;
|
||||
|
||||
namespace Vocalization
|
||||
{
|
||||
|
@ -11,14 +12,11 @@ namespace Vocalization
|
|||
/// </summary>
|
||||
public class ModConfig
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// A list of all of the translations currently supported by this mod.
|
||||
/// Handles all of the translation information and parsing.
|
||||
/// </summary>
|
||||
public List<string> translations;
|
||||
/// <summary>
|
||||
/// The currently selected translation to use.
|
||||
/// </summary>
|
||||
public string currentTranslation;
|
||||
public TranslationInfo translationInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Keeps track of the voice modes for determining how much audio is played.
|
||||
|
@ -37,7 +35,6 @@ namespace Vocalization
|
|||
|
||||
public ModConfig()
|
||||
{
|
||||
translations = new List<string>();
|
||||
modes = new List<string>();
|
||||
|
||||
modes.Add("Simple");
|
||||
|
@ -46,9 +43,8 @@ namespace Vocalization
|
|||
modes.Add("SimpleAndHeartEvents");
|
||||
currentMode = "Full";
|
||||
|
||||
translationInfo = new TranslationInfo();
|
||||
|
||||
translations.Add("English");
|
||||
currentTranslation = "English";
|
||||
|
||||
this.voiceVolume = 1.0f;
|
||||
}
|
||||
|
@ -66,5 +62,7 @@ namespace Vocalization
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -511,7 +511,7 @@ namespace Vocalization
|
|||
{
|
||||
foreach(var NPC in loc.characters)
|
||||
{
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string characterPath = Path.Combine(translation, NPC.Name);
|
||||
characterDialoguePaths.Add(characterPath);
|
||||
|
@ -520,82 +520,82 @@ namespace Vocalization
|
|||
}
|
||||
|
||||
//Create all of the necessary folders for different translations.
|
||||
foreach (var dir in config.translations)
|
||||
foreach (var dir in config.translationInfo.translations)
|
||||
{
|
||||
if (!Directory.Exists(Path.Combine(voicePath,dir))) Directory.CreateDirectory(Path.Combine(voicePath, dir));
|
||||
}
|
||||
|
||||
//Add in folder for TV Shows
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string TVPath = Path.Combine(translation, "TV");
|
||||
characterDialoguePaths.Add(TVPath);
|
||||
}
|
||||
|
||||
//Add in folder for shop support
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string shop = Path.Combine(translation, "Shops"); //Used to hold NPC Shops
|
||||
characterDialoguePaths.Add(shop);
|
||||
}
|
||||
|
||||
//Add in folder for Mail support.
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string mail = Path.Combine(translation, "Mail");
|
||||
characterDialoguePaths.Add(mail);
|
||||
}
|
||||
|
||||
//Add in folder for ExtraDiaogue.yaml
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string extra = Path.Combine(translation, "ExtraDialogue");
|
||||
characterDialoguePaths.Add(extra);
|
||||
}
|
||||
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string extra = Path.Combine(translation, "Events");
|
||||
characterDialoguePaths.Add(extra);
|
||||
}
|
||||
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string extra = Path.Combine(translation, "Characters");
|
||||
characterDialoguePaths.Add(extra);
|
||||
}
|
||||
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string extra = Path.Combine(translation, "LocationDialogue");
|
||||
characterDialoguePaths.Add(extra);
|
||||
}
|
||||
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string extra = Path.Combine(translation, "Notes");
|
||||
characterDialoguePaths.Add(extra);
|
||||
}
|
||||
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string extra = Path.Combine(translation, "Utility");
|
||||
characterDialoguePaths.Add(extra);
|
||||
}
|
||||
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string extra = Path.Combine(translation, "NPCGiftTastes");
|
||||
characterDialoguePaths.Add(extra);
|
||||
}
|
||||
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string extra = Path.Combine(translation, "SpeechBubbles");
|
||||
characterDialoguePaths.Add(extra);
|
||||
}
|
||||
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string kent = Path.Combine(translation, "Kent");
|
||||
characterDialoguePaths.Add(kent);
|
||||
|
@ -619,14 +619,14 @@ namespace Vocalization
|
|||
|
||||
|
||||
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string extra = Path.Combine(translation, "Quests");
|
||||
characterDialoguePaths.Add(extra);
|
||||
}
|
||||
|
||||
|
||||
foreach (var translation in config.translations)
|
||||
foreach (var translation in config.translationInfo.translations)
|
||||
{
|
||||
string extra = Path.Combine(translation, "Temp");
|
||||
characterDialoguePaths.Add(extra);
|
||||
|
@ -637,6 +637,7 @@ namespace Vocalization
|
|||
if (!Directory.Exists(voicePath)) Directory.CreateDirectory(voicePath);
|
||||
|
||||
|
||||
|
||||
//Create a list of new directories if the corresponding character directory doesn't exist.
|
||||
//Note: A modder could also manually add in their own character directory for voice lines instead of having to add it via code.
|
||||
foreach (var dir in characterDialoguePaths)
|
||||
|
@ -680,16 +681,17 @@ namespace Vocalization
|
|||
{
|
||||
CharacterVoiceCue cue = new CharacterVoiceCue(characterName);
|
||||
//Change this up for different translations???
|
||||
if (translation == "English")
|
||||
{
|
||||
cue.initializeEnglishScrape();
|
||||
}
|
||||
scrapeDictionaries(voiceCueFile,cue);
|
||||
cue.initializeForTranslation(translation);
|
||||
scrapeDictionaries(voiceCueFile,cue,translation);
|
||||
///??? DO I NEVER ACTUALLY ADD IT IN???
|
||||
try
|
||||
{
|
||||
if (translation == config.translationInfo.currentTranslation)
|
||||
{
|
||||
DialogueCues.Add(characterName, cue);
|
||||
}
|
||||
}
|
||||
catch(Exception err)
|
||||
{
|
||||
|
||||
|
@ -700,9 +702,12 @@ namespace Vocalization
|
|||
CharacterVoiceCue cue = ModHelper.ReadJsonFile<CharacterVoiceCue>(voiceCueFile);
|
||||
//scrapeDictionaries(voiceCueFile,cue);
|
||||
try
|
||||
{
|
||||
if (translation == config.translationInfo.currentTranslation)
|
||||
{
|
||||
DialogueCues.Add(characterName, cue);
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ModMonitor.Log("WHY NO ADD IN???"+err.ToString());
|
||||
|
@ -717,7 +722,7 @@ namespace Vocalization
|
|||
/// Used to obtain all strings for almost all possible dialogue in the game.
|
||||
/// </summary>
|
||||
/// <param name="cue"></param>
|
||||
public void scrapeDictionaries(string path,CharacterVoiceCue cue)
|
||||
public void scrapeDictionaries(string path,CharacterVoiceCue cue,string translation)
|
||||
{
|
||||
|
||||
var dialoguePath = Path.Combine("Characters", "Dialogue");
|
||||
|
@ -909,24 +914,24 @@ namespace Vocalization
|
|||
{
|
||||
|
||||
if(key== "NewChild_Adoption") {
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:"+key),replacementStrings.kid1Name), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:" + key), replacementStrings.kid2Name), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadStringFromDataFile("ExtraDialogue",key,translation,replacementStrings.kid1Name), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadStringFromDataFile("ExtraDialogue", key, translation, replacementStrings.kid2Name), new VoiceAudioOptions());
|
||||
continue;
|
||||
}
|
||||
if(key== "NewChild_FirstChild")
|
||||
{
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:" + key), replacementStrings.kid1Name), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadStringFromDataFile("ExtraDialogue", key, translation, replacementStrings.kid1Name), new VoiceAudioOptions());
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key== "Farm_RobinWorking_ReadyTomorrow" || key== "Robin_NewConstruction_Festival"||key== "Robin_NewConstruction" || key== "Robin_Instant")
|
||||
{
|
||||
string buildingsPath = Path.Combine(dataPath, "Blueprints.xnb");
|
||||
string buildingsPath = Path.Combine(dataPath, config.translationInfo.getBuildingXNBForTranslation(translation));
|
||||
var BuildingDict = ModHelper.Content.Load<Dictionary<string, string>>(buildingsPath, ContentSource.GameContent);
|
||||
|
||||
foreach(KeyValuePair<string, string> pair2 in BuildingDict)
|
||||
{
|
||||
List<string> cleanedDialogues = sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:" + key), pair2.Key),cue);
|
||||
List<string> cleanedDialogues = sanitizeDialogueFromDictionaries(config.translationInfo.LoadStringFromDataFile("ExtraDialogue",key,translation,pair2.Key),cue);
|
||||
foreach (var clean_str in cleanedDialogues) {
|
||||
cue.addDialogue(clean_str, new VoiceAudioOptions());
|
||||
}
|
||||
|
@ -936,14 +941,14 @@ namespace Vocalization
|
|||
|
||||
if (key == "Farm_RobinWorking1" || key== "Farm_RobinWorking2")
|
||||
{
|
||||
string buildingsPath = Path.Combine(dataPath, "Blueprints.xnb");
|
||||
string buildingsPath = Path.Combine(dataPath, config.translationInfo.getBuildingXNBForTranslation(translation));
|
||||
var BuildingDict = ModHelper.Content.Load<Dictionary<string, string>>(buildingsPath, ContentSource.GameContent);
|
||||
|
||||
foreach (KeyValuePair<string, string> pair2 in BuildingDict)
|
||||
{
|
||||
for (int i = 1; i <= 3; i++)
|
||||
{
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:" + key), pair2.Key,i.ToString()), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:" + key), pair2.Key,i.ToString()), new VoiceAudioOptions());
|
||||
}
|
||||
}
|
||||
continue;
|
||||
|
@ -968,7 +973,7 @@ namespace Vocalization
|
|||
{
|
||||
foreach(var lvl in levels)
|
||||
{
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:" + key), lvl+tool), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadStringFromDataFile("ExtraDialogue", key,translation ,lvl+tool), new VoiceAudioOptions());
|
||||
}
|
||||
}
|
||||
continue;
|
||||
|
@ -1413,29 +1418,32 @@ namespace Vocalization
|
|||
string contentPath = Path.Combine(basePath, "Content");
|
||||
string audioPath = Path.Combine(contentPath, "Audio");
|
||||
string voicePath = Path.Combine(audioPath, "VoiceFiles");
|
||||
string[] dirs = Directory.GetDirectories(Path.Combine(voicePath,"English"));
|
||||
|
||||
|
||||
string[] dirs = Directory.GetDirectories(Path.Combine(voicePath, translation));
|
||||
//Some additional scraping to put together better options for speech bubbles.
|
||||
foreach (var v in dirs)
|
||||
{
|
||||
string name = Path.GetFileName(v);
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4068"), (object)name), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4065")) + ", " + Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4066"), (object)name), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4071"), (object)name), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4068"), translation, (object)name), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4065"),translation) + ", " + config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4066"), translation, (object)name), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4071"), translation, (object)name), new VoiceAudioOptions());
|
||||
}
|
||||
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4060")), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4072")), new VoiceAudioOptions());
|
||||
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4063")), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4064")), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4060"),translation), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4072"),translation), new VoiceAudioOptions());
|
||||
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4063"),translation), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4064"),translation), new VoiceAudioOptions());
|
||||
|
||||
//cue.addDialogue("Hey, it's farmer, " + replacementStrings.farmerName,new VoiceAudioOptions());
|
||||
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4062")), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4061")), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4060")), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4059")), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4058")), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4062"),translation), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4061"),translation), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4060"),translation), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4059"),translation), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4058"),translation), new VoiceAudioOptions());
|
||||
|
||||
}
|
||||
|
||||
|
@ -1649,45 +1657,47 @@ namespace Vocalization
|
|||
}
|
||||
}
|
||||
//Scrape dialogue more specifically and replace some generic {0}'s and {1}'s
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.3955"), (object)cue.name), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.3969"), (object)cue.name), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.3981"), (object)cue.name), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.3987"), (object)cue.name,"2"),new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4066"), (object)replacementStrings.farmerName), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4068"), (object)replacementStrings.farmerName), new VoiceAudioOptions());
|
||||
cue.addDialogue(Game1.content.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4071"), (object)replacementStrings.farmerName), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4440"), (object)replacementStrings.farmerName),cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4441"), (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4444"), (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4445"), (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4447"), (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4448"), (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4463"), (object)replacementStrings.petName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4465"), (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4466"), (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4486"), (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.3955"), translation, (object)cue.name), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.3969"), translation, (object)cue.name), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.3981"), translation, (object)cue.name), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.3987"), translation, (object)cue.name,"2"),new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4066"), translation, (object)replacementStrings.farmerName), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4068"), translation, (object)replacementStrings.farmerName), new VoiceAudioOptions());
|
||||
cue.addDialogue(config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4071"), translation, (object)replacementStrings.farmerName), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4440"), translation, (object)replacementStrings.farmerName),cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4441"), translation, (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4444"), translation, (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4445"), translation, (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4447"), translation, (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4448"), translation, (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4463"), translation, (object)replacementStrings.petName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4465"), translation, (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4466"), translation, (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.4486"), translation, (object)replacementStrings.farmerName), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
for (int i = 4507; i <= 4523; i++)
|
||||
{
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4465"), (object)Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.")+i.ToString())), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4466"), (object)Game1.content.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.") + i.ToString())), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4465"), translation, (object)config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.")+i.ToString(),translation)), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.4466"), translation, (object)config.translationInfo.LoadString(Path.Combine("Strings","StringsFromCSFiles:NPC.cs.") + i.ToString(),translation)), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
}
|
||||
|
||||
|
||||
//DO PARSE LOGIC HERE
|
||||
//cue.addDialogue(Game1.content.LoadString("Strings\\StringsFromCSFiles:NPC.cs.3985", (object)cue.name), new VoiceAudioOptions());
|
||||
//cue.addDialogue(config.translationInfo.LoadString("Strings\\StringsFromCSFiles:NPC.cs.3985", (object)cue.name), new VoiceAudioOptions());
|
||||
|
||||
string basePath = ModHelper.DirectoryPath;
|
||||
string contentPath = Path.Combine(basePath, "Content");
|
||||
string audioPath = Path.Combine(contentPath, "Audio");
|
||||
string voicePath = Path.Combine(audioPath, "VoiceFiles");
|
||||
string[] dirs = Directory.GetDirectories(Path.Combine(voicePath, "English"));
|
||||
|
||||
string[] dirs = Directory.GetDirectories(Path.Combine(voicePath, translation));
|
||||
//Some additional scraping to put together better options for speech bubbles.
|
||||
foreach (var v in dirs)
|
||||
{
|
||||
string name = Path.GetFileName(v);
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(Game1.content.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.3985"), (object)name), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
cue.addDialogue(sanitizeDialogueFromDictionaries(config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:NPC.cs.3985"), translation, (object)name), cue).ElementAt(0), new VoiceAudioOptions());
|
||||
}
|
||||
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1727,13 +1737,13 @@ namespace Vocalization
|
|||
for(int i=0; i<=3; i++) {
|
||||
StardewValley.Object obj = new StardewValley.Object(pair.Key,1,false,-1,i);
|
||||
|
||||
string[] strArray = Game1.content.LoadString(Path.Combine("Strings","Lexicon:GenericPlayerTerm")).Split('^');
|
||||
string[] strArray = config.translationInfo.LoadString(Path.Combine("Strings","Lexicon:GenericPlayerTerm"),translation).Split('^');
|
||||
string str2 = strArray[0];
|
||||
if (strArray.Length > 1 && !(bool)((NetFieldBase<bool, NetBool>)Game1.player.isMale))
|
||||
str2 = strArray[1];
|
||||
string str3 = Game1.player.Name;
|
||||
|
||||
List<string> rawScrape = getPurchasedItemDialogueForNPC(obj, cue.name,str3);
|
||||
List<string> rawScrape = getPurchasedItemDialogueForNPC(obj, cue.name,str3,translation);
|
||||
|
||||
foreach (string raw in rawScrape)
|
||||
{
|
||||
|
@ -1746,7 +1756,7 @@ namespace Vocalization
|
|||
}
|
||||
|
||||
str3 = str2;
|
||||
List<string> rawScrape2 = getPurchasedItemDialogueForNPC(obj, cue.name, str3);
|
||||
List<string> rawScrape2 = getPurchasedItemDialogueForNPC(obj, cue.name, str3,translation);
|
||||
foreach (string raw in rawScrape2)
|
||||
{
|
||||
List<string> cleanDialogues2 = sanitizeDialogueFromDictionaries(raw, cue);
|
||||
|
@ -1760,7 +1770,7 @@ namespace Vocalization
|
|||
}
|
||||
|
||||
ModHelper.WriteJsonFile<CharacterVoiceCue>(path,cue);
|
||||
DialogueCues.Add(cue.name, cue);
|
||||
//DialogueCues.Add(cue.name, cue);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1770,7 +1780,7 @@ namespace Vocalization
|
|||
/// <param name="i"></param>
|
||||
/// <param name="npcName"></param>
|
||||
/// <returns></returns>
|
||||
public List<string> getPurchasedItemDialogueForNPC(StardewValley.Object i, string npcName, string str3)
|
||||
public List<string> getPurchasedItemDialogueForNPC(StardewValley.Object i, string npcName, string str3,string translation)
|
||||
{
|
||||
NPC n = Game1.getCharacterFromName(npcName);
|
||||
if (n == null) return new List<string>();
|
||||
|
@ -1780,7 +1790,7 @@ namespace Vocalization
|
|||
str3 = Game1.player.Name;
|
||||
string str4 = LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.en ? Lexicon.getProperArticleForWord(i.name) : "";
|
||||
if ((i.Category == -4 || i.Category == -75 || i.Category == -79) && Game1.random.NextDouble() < 0.5)
|
||||
str4 = Game1.content.LoadString(Path.Combine("Strings", "StringsFromCSFiles:SeedShop.cs.9701"));
|
||||
str4 = config.translationInfo.LoadString(Path.Combine("Strings", "StringsFromCSFiles:SeedShop.cs.9701"),translation);
|
||||
|
||||
for (int v = 0; v <= 5; v++)
|
||||
{
|
||||
|
@ -1793,7 +1803,7 @@ namespace Vocalization
|
|||
{
|
||||
foreach (string str in Vocabulary.getRandomDeliciousAdjectives(n))
|
||||
{
|
||||
string str19 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_1_QualityHigh"), (object)str3, (object)str4, (object)i.DisplayName, (object)str);
|
||||
string str19 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_1_QualityHigh"), translation, (object)str3, (object)str4, (object)i.DisplayName, (object)str);
|
||||
dialogueReturn.Add(str19);
|
||||
}
|
||||
//break;
|
||||
|
@ -1802,13 +1812,13 @@ namespace Vocalization
|
|||
{
|
||||
foreach (string str in Vocabulary.getRandomNegativeFoodAdjectives(n))
|
||||
{
|
||||
string str18 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_1_QualityLow"), (object)str3, (object)str4, (object)i.DisplayName, (object)str);
|
||||
string str18 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_1_QualityLow"), translation, (object)str3, (object)str4, (object)i.DisplayName, (object)str);
|
||||
dialogueReturn.Add(str18);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
string str2 = (i.quality.Value) != 0 ? (!n.Name.Equals("Jodi") ? Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_2_QualityHigh"), (object)str3, (object)str4, (object)i.DisplayName) : Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_2_QualityHigh_Jodi"), (object)str3, (object)str4, (object)i.DisplayName)) : Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_2_QualityLow"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
string str2 = (i.quality.Value) != 0 ? (!n.Name.Equals("Jodi") ? config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_2_QualityHigh"), translation, (object)str3, (object)str4, (object)i.DisplayName) : config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_2_QualityHigh_Jodi"), translation, (object)str3, (object)str4, (object)i.DisplayName)) : config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_2_QualityLow"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
dialogueReturn.Add(str2);
|
||||
break;
|
||||
case 2:
|
||||
|
@ -1819,7 +1829,7 @@ namespace Vocalization
|
|||
foreach (var word1 in Vocabulary.getRandomNegativeFoodAdjectives(n))
|
||||
{
|
||||
foreach (string word2 in Vocabulary.getRandomNegativeItemSlanderNouns()) {
|
||||
string str17 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_3_QualityLow_Rude"), (object)str3, (object)str4, (object)i.DisplayName, (object)(i.salePrice() / 2), (object)word1, (object)word2);
|
||||
string str17 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_3_QualityLow_Rude"), translation, (object)str3, (object)str4, (object)i.DisplayName, (object)(i.salePrice() / 2), (object)word1, (object)word2);
|
||||
dialogueReturn.Add(str17);
|
||||
}
|
||||
}
|
||||
|
@ -1827,22 +1837,22 @@ namespace Vocalization
|
|||
}
|
||||
foreach (string word1 in Vocabulary.getRandomSlightlyPositiveAdjectivesForEdibleNoun(n))
|
||||
{
|
||||
string str10 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_3_QualityHigh_Rude"), (object)str3, (object)str4, (object)i.DisplayName, (object)(i.salePrice() / 2), (object)word1);
|
||||
string str10 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_3_QualityHigh_Rude"), translation, (object)str3, (object)str4, (object)i.DisplayName, (object)(i.salePrice() / 2), (object)word1);
|
||||
dialogueReturn.Add(str10);
|
||||
}
|
||||
break;
|
||||
}
|
||||
string str11 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_3_NonRude"), (object)str3, (object)str4, (object)i.DisplayName, (object)(i.salePrice() / 2));
|
||||
string str11 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_3_NonRude"), translation, (object)str3, (object)str4, (object)i.DisplayName, (object)(i.salePrice() / 2));
|
||||
dialogueReturn.Add(str11);
|
||||
break;
|
||||
case 3:
|
||||
string str12 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_4"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
string str12 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_4"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
dialogueReturn.Add(str12);
|
||||
break;
|
||||
case 4:
|
||||
if (i.Category == -75 || i.Category == -79)
|
||||
{
|
||||
string str13 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_5_VegetableOrFruit"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
string str13 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_5_VegetableOrFruit"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
dialogueReturn.Add(str13);
|
||||
break;
|
||||
}
|
||||
|
@ -1850,18 +1860,18 @@ namespace Vocalization
|
|||
{
|
||||
foreach (string forEventOrPerson in Vocabulary.getRandomPositiveAdjectivesForEventOrPerson(n))
|
||||
{
|
||||
string str14 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_5_Cooking"), (object)str3, (object)str4, (object)i.DisplayName, (object)Lexicon.getProperArticleForWord(forEventOrPerson), (object)forEventOrPerson);
|
||||
string str14 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_5_Cooking"), translation, (object)str3, (object)str4, (object)i.DisplayName, (object)Lexicon.getProperArticleForWord(forEventOrPerson), (object)forEventOrPerson);
|
||||
dialogueReturn.Add(str14);
|
||||
}
|
||||
break;
|
||||
}
|
||||
string str15 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_5_Foraged"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
string str15 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_5_Foraged"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
dialogueReturn.Add(str15);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (n.Age == 1) {
|
||||
string str16 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Teen"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
string str16 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Teen"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
dialogueReturn.Add(str16);
|
||||
}
|
||||
|
||||
|
@ -1869,15 +1879,15 @@ namespace Vocalization
|
|||
string str1 = "";
|
||||
if (name == "Alex")
|
||||
{
|
||||
str1 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Alex"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
str1 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Alex"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
}
|
||||
if (name == "Caroline")
|
||||
{
|
||||
str1 = (int)((NetFieldBase<int, NetInt>)i.quality) != 0 ? Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Caroline_QualityHigh"), (object)str3, (object)str4, (object)i.DisplayName) : Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Caroline_QualityLow"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
str1 = (int)((NetFieldBase<int, NetInt>)i.quality) != 0 ? config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Caroline_QualityHigh"), translation, (object)str3, (object)str4, (object)i.DisplayName) : config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Caroline_QualityLow"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
}
|
||||
if (name == "Pierre")
|
||||
{
|
||||
str1 = (int)((NetFieldBase<int, NetInt>)i.quality) != 0 ? Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Pierre_QualityHigh"), (object)str3, (object)str4, (object)i.DisplayName) : Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Pierre_QualityLow"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
str1 = (int)((NetFieldBase<int, NetInt>)i.quality) != 0 ? config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Pierre_QualityHigh"), translation, (object)str3, (object)str4, (object)i.DisplayName) : config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Pierre_QualityLow"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1887,23 +1897,23 @@ namespace Vocalization
|
|||
{
|
||||
foreach (string word1 in Vocabulary.getRandomNegativeItemSlanderNouns())
|
||||
{
|
||||
string str12 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Abigail_QualityLow"), (object)str3, (object)str4, (object)i.DisplayName, (object)word1);
|
||||
string str12 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Abigail_QualityLow"), translation, (object)str3, (object)str4, (object)i.DisplayName, (object)word1);
|
||||
dialogueReturn.Add(str12);
|
||||
}
|
||||
}
|
||||
else {
|
||||
str1 = Game1.content.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Abigail_QualityHigh"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
str1 = config.translationInfo.LoadString(Path.Combine("Data", "ExtraDialogue:PurchasedItem_Abigail_QualityHigh"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (name == "Haley")
|
||||
str1 = Game1.content.LoadString(Path.Combine("Data","ExtraDialogue:PurchasedItem_Haley"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
str1 = config.translationInfo.LoadString(Path.Combine("Data","ExtraDialogue:PurchasedItem_Haley"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
if (name == "Elliott")
|
||||
str1 = Game1.content.LoadString(Path.Combine("Data","ExtraDialogue:PurchasedItem_Elliott"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
str1 = config.translationInfo.LoadString(Path.Combine("Data","ExtraDialogue:PurchasedItem_Elliott"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
if (name == "Leah")
|
||||
str1 = Game1.content.LoadString(Path.Combine("Data","ExtraDialogue:PurchasedItem_Leah"), (object)str3, (object)str4, (object)i.DisplayName);
|
||||
str1 = config.translationInfo.LoadString(Path.Combine("Data","ExtraDialogue:PurchasedItem_Leah"), translation, (object)str3, (object)str4, (object)i.DisplayName);
|
||||
if (str1 != "")
|
||||
{
|
||||
dialogueReturn.Add(str1);
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
<ItemGroup>
|
||||
<Compile Include="Framework\CharacterVoiceCue.cs" />
|
||||
<Compile Include="Framework\ReplacementStrings.cs" />
|
||||
<Compile Include="Framework\TranslationInfo.cs" />
|
||||
<Compile Include="Framework\Vocabulary.cs" />
|
||||
<Compile Include="Framework\VoiceAudioOptions.cs" />
|
||||
<Compile Include="ModConfig.cs" />
|
||||
|
|
Loading…
Reference in New Issue