From e849e051616bde890457b64137a75b1e8d920418 Mon Sep 17 00:00:00 2001 From: JoshuaNavarro Date: Thu, 29 Aug 2019 21:11:34 -0700 Subject: [PATCH] Added in alloys, alloy recipes in furnace, and vocalization enabling options. --- .../Configs/Shops_BlacksmithConfig.cs | 18 ++++++++++ .../Framework/Crafting/VanillaRecipeBook.cs | 35 +++++++++++++++++++ .../Framework/Objects/ResourceManager.cs | 14 +++++++- GeneralMods/Revitalize/ModCore.cs | 1 + .../Vocalization/Vocalization/ModConfig.cs | 3 ++ .../Vocalization/Vocalization/Vocalization.cs | 22 ++++++++++-- 6 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 GeneralMods/Revitalize/Framework/Configs/Shops_BlacksmithConfig.cs diff --git a/GeneralMods/Revitalize/Framework/Configs/Shops_BlacksmithConfig.cs b/GeneralMods/Revitalize/Framework/Configs/Shops_BlacksmithConfig.cs new file mode 100644 index 00000000..f80b6217 --- /dev/null +++ b/GeneralMods/Revitalize/Framework/Configs/Shops_BlacksmithConfig.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Revitalize.Framework.Configs +{ + public class Shops_BlacksmithConfig + { + + public Shops_BlacksmithConfig() + { + + } + + } +} diff --git a/GeneralMods/Revitalize/Framework/Crafting/VanillaRecipeBook.cs b/GeneralMods/Revitalize/Framework/Crafting/VanillaRecipeBook.cs index ca5b1bdc..97fde867 100644 --- a/GeneralMods/Revitalize/Framework/Crafting/VanillaRecipeBook.cs +++ b/GeneralMods/Revitalize/Framework/Crafting/VanillaRecipeBook.cs @@ -125,6 +125,41 @@ namespace Revitalize.Framework.Crafting this.recipesByObjectName["Furnace"].Add("Diamond", furnace_gemsToPrismaticShard); } + VanillaRecipe furnace_steelIngot = new VanillaRecipe(new Dictionary() + { + {new StardewValley.Object((int)Enums.SDVObject.IronBar,1),1 }, + {new StardewValley.Object((int)Enums.SDVObject.Coal,5),5} + }, new KeyValuePair(ModCore.ObjectManager.GetItem("SteelIngot"), 1), TimeUtilities.GetMinutesFromTime(0, 12, 0), new StatCost(), false); + + this.recipesByObjectName["Furnace"].Add("Iron Bar", furnace_steelIngot); + + VanillaRecipe furnace_brassIngot = new VanillaRecipe(new Dictionary() + { + {new StardewValley.Object((int)Enums.SDVObject.CopperBar,1),1 }, + {ModCore.ObjectManager.GetItem("AluminumIngot"),1}, + {new StardewValley.Object((int)Enums.SDVObject.Coal,5),1} + }, new KeyValuePair(ModCore.ObjectManager.GetItem("BrassIngot"), 1), TimeUtilities.GetMinutesFromTime(0, 6, 0), new StatCost(), false); + + this.recipesByObjectName["Furnace"].Add("Aluminum Ingot", furnace_brassIngot); + + VanillaRecipe furnace_bronzeIngot = new VanillaRecipe(new Dictionary() + { + {new StardewValley.Object((int)Enums.SDVObject.CopperBar,1),1 }, + {ModCore.ObjectManager.GetItem("TinIngot"),1}, + {new StardewValley.Object((int)Enums.SDVObject.Coal,5),1} + }, new KeyValuePair(ModCore.ObjectManager.GetItem("BronzeIngot"), 1), TimeUtilities.GetMinutesFromTime(0, 8, 0), new StatCost(), false); + + this.recipesByObjectName["Furnace"].Add("Tin Ingot", furnace_bronzeIngot); + + VanillaRecipe furnace_electrumIngot = new VanillaRecipe(new Dictionary() + { + {new StardewValley.Object((int)Enums.SDVObject.GoldBar,1),1 }, + {ModCore.ObjectManager.GetItem("SilverIngot"),1}, + {new StardewValley.Object((int)Enums.SDVObject.Coal,5),1} + }, new KeyValuePair(ModCore.ObjectManager.GetItem("ElectrumIngot"), 1), TimeUtilities.GetMinutesFromTime(0, 12, 0), new StatCost(), false); + + this.recipesByObjectName["Furnace"].Add("Silver Ingot", furnace_electrumIngot); + } /// diff --git a/GeneralMods/Revitalize/Framework/Objects/ResourceManager.cs b/GeneralMods/Revitalize/Framework/Objects/ResourceManager.cs index 8525383e..ec5dae79 100644 --- a/GeneralMods/Revitalize/Framework/Objects/ResourceManager.cs +++ b/GeneralMods/Revitalize/Framework/Objects/ResourceManager.cs @@ -288,8 +288,20 @@ namespace Revitalize.Framework.Objects CustomObject silverIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.SilverIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SilverIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Silver Ingot", "Omegasis.Revitalize.Items.Resources.Ore.SilverIngot", "A silver ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, 0, false, 220, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SilverIngot"), new AnimationManager(), Color.White, true, null, null), 1); ModCore.ObjectManager.AddItem("SilverIngot", silverIngot); - CustomObject titaniumIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.TitaniumIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Titanium Ingot", "Omegasis.Revitalize.Items.Resources.Ore.TitaniumIngot", "A titanium ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, 325, false, 35, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumIngot"), new AnimationManager(), Color.White, true, null, null), 1); + CustomObject titaniumIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.TitaniumIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Titanium Ingot", "Omegasis.Revitalize.Items.Resources.Ore.TitaniumIngot", "A titanium ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, 0, false, 325, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumIngot"), new AnimationManager(), Color.White, true, null, null), 1); ModCore.ObjectManager.AddItem("TitaniumIngot", titaniumIngot); + + CustomObject brassIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.BrassIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "BrassIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Brass Ingot", "Omegasis.Revitalize.Items.Resources.Ore.BrassIngot", "A brass alloy ingot made from copper and aluminum. It can be used for crafting purposes.", "Ore", Color.Silver, -300, 0, false, 195, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "BrassIngot"), new AnimationManager(), Color.White, true, null, null), 1); + ModCore.ObjectManager.AddItem("BrassIngot", brassIngot); + + CustomObject bronzeIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.BronzeIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "BronzeIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Bronze Ingot", "Omegasis.Revitalize.Items.Resources.Ore.BronzeIngot", "A bronze alloy ingot made from copper and tin. It can be used for crafting purposes.", "Ore", Color.Silver, -300, 0, false, 150, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "BronzeIngot"), new AnimationManager(), Color.White, true, null, null), 1); + ModCore.ObjectManager.AddItem("BronzeIngot", bronzeIngot); + + CustomObject electrumIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.ElectrumIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "ElectrumIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Electrum Ingot", "Omegasis.Revitalize.Items.Resources.Ore.ElectrumIngot", "A electrum alloy ingot made from gold and silver. It can be used for crafting purposes for things that use electricity.", "Ore", Color.Silver, -300, 0, false, 500, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "ElectrumIngot"), new AnimationManager(), Color.White, true, null, null), 1); + ModCore.ObjectManager.AddItem("ElectrumIngot", electrumIngot); + + CustomObject steelIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.SteelIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SteelIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Steel Ingot", "Omegasis.Revitalize.Items.Resources.Ore.SteelIngot", "A steel ingot that was made by processing iron again with more coal. It can be used for crafting purposes especially for making new machines.", "Ore", Color.Silver, -300, 0, false, 180, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SteelIngot"), new AnimationManager(), Color.White, true, null, null), 1); + ModCore.ObjectManager.AddItem("SteelIngot", steelIngot); } /// diff --git a/GeneralMods/Revitalize/ModCore.cs b/GeneralMods/Revitalize/ModCore.cs index 2626ea0c..f7fc08ea 100644 --- a/GeneralMods/Revitalize/ModCore.cs +++ b/GeneralMods/Revitalize/ModCore.cs @@ -481,6 +481,7 @@ namespace Revitalize new StardewValley.Object((int)Enums.SDVObject.Topaz,1), new StardewValley.Object((int)Enums.SDVObject.Jade,1), new StardewValley.Object((int)Enums.SDVObject.Diamond,1), + new StardewValley.Object((int)Enums.SDVObject.IronBar,1), }); //ModCore.log("Tin sells for: " + tin.sellToStorePrice()); diff --git a/GeneralMods/Vocalization/Vocalization/ModConfig.cs b/GeneralMods/Vocalization/Vocalization/ModConfig.cs index 0def7da6..b3c42fd0 100644 --- a/GeneralMods/Vocalization/Vocalization/ModConfig.cs +++ b/GeneralMods/Vocalization/Vocalization/ModConfig.cs @@ -26,6 +26,9 @@ namespace Vocalization /// The current mode for the mod. public string currentMode = "Full"; + public bool ShopDialogueEnabled=true; + public bool TVDialogueEnabled = true; + public bool LetterDialogueEnabled = true; /// Validates public void verifyValidMode() diff --git a/GeneralMods/Vocalization/Vocalization/Vocalization.cs b/GeneralMods/Vocalization/Vocalization/Vocalization.cs index d98da72f..c418512f 100644 --- a/GeneralMods/Vocalization/Vocalization/Vocalization.cs +++ b/GeneralMods/Vocalization/Vocalization/Vocalization.cs @@ -20,6 +20,18 @@ using Vocalization.Framework.Menus; namespace Vocalization { /* + *Mode: + * Simple: Hello, Goodbye, etc + * Full: All dialogue + * None: Dialogue disabled + * Cinematic: Simple unless in a cutscene + * CutscenesOnly: (if game event is up play dialogue) + * + * (Code in) Have option to enable/disable shop dialogue + * (Code in) have option to enable/disable tv dialogue + * (Code in) have option to enable/disable letter dialogue + * + * * Things to sanitize/load in * * NPC Dialogue(sanitized, not loaded); @@ -250,7 +262,7 @@ namespace Vocalization private void Input_ButtonPressed(object sender, ButtonPressedEventArgs e) { - if(e.Button.ToString()== config.menuHotkey) + if (e.Button.ToString() == config.menuHotkey) { Game1.activeClickableMenu = new VocalizationMenu(100, 64, 600, 300, true); } @@ -317,7 +329,7 @@ namespace Vocalization new KeyValuePair(speech, ExtraTextureDrawOrder.after) }; - Button menuTab = new Button("", new Rectangle(0, 0, 32, 32), new Texture2DExtended(ModHelper,this.ModManifest ,Path.Combine("Content", "Graphics", "MenuTab.png")), "", new Rectangle(0, 0, 32, 32), 2f, new StardustCore.Animations.Animation(new Rectangle(0, 0, 32, 32)), Color.White, Color.White, new StardustCore.UIUtilities.MenuComponents.Delegates.Functionality.ButtonFunctionality(new StardustCore.UIUtilities.MenuComponents.Delegates.DelegatePairing(null, null), new StardustCore.UIUtilities.MenuComponents.Delegates.DelegatePairing(null, null), new StardustCore.UIUtilities.MenuComponents.Delegates.DelegatePairing(null, null)), false, components); + Button menuTab = new Button("", new Rectangle(0, 0, 32, 32), new Texture2DExtended(ModHelper, this.ModManifest, Path.Combine("Content", "Graphics", "MenuTab.png")), "", new Rectangle(0, 0, 32, 32), 2f, new StardustCore.Animations.Animation(new Rectangle(0, 0, 32, 32)), Color.White, Color.White, new StardustCore.UIUtilities.MenuComponents.Delegates.Functionality.ButtonFunctionality(new StardustCore.UIUtilities.MenuComponents.Delegates.DelegatePairing(null, null), new StardustCore.UIUtilities.MenuComponents.Delegates.DelegatePairing(null, null), new StardustCore.UIUtilities.MenuComponents.Delegates.DelegatePairing(null, null)), false, components); //Change this to take the vocalization menu instead var modTabs = new List> @@ -515,6 +527,7 @@ namespace Vocalization }; foreach (string v in tries) { + if (v.Equals("TV") && config.TVDialogueEnabled == false) continue; //Add in support for TV Shows bool f = DialogueCues.TryGetValue(v, out CharacterVoiceCue voice); currentDialogue = sanitizeDialogueInGame(currentDialogue); //If contains the stuff in the else statement, change things up. @@ -538,6 +551,7 @@ namespace Vocalization //Support for Letters if (Game1.activeClickableMenu is LetterViewerMenu letterMenu) { + if (config.LetterDialogueEnabled == false) return; //Use reflection to get original text back. //mail dialogue text will probably need to be sanitized as well.... List mailText = (List)ModHelper.Reflection.GetField>(letterMenu, "mailMessage"); @@ -553,6 +567,7 @@ namespace Vocalization currentDialogue = sanitizeDialogueInGame(currentDialogue); //If contains the stuff in the else statement, change things up. if (voice.dialogueCues.ContainsKey(currentDialogue)) { + //Not variable messages. Aka messages that don't contain words the user can change such as farm name, farmer name etc. voice.speak(currentDialogue); } @@ -566,6 +581,7 @@ namespace Vocalization //Support for shops if (Game1.activeClickableMenu is ShopMenu shopMenu) { + if (config.ShopDialogueEnabled == false) return; string shopDialogue = shopMenu.potraitPersonDialogue; //Check this string to the dict of voice cues shopDialogue = shopDialogue.Replace(Environment.NewLine, ""); @@ -2417,7 +2433,7 @@ namespace Vocalization cleanDialogues = sanitizeDialogueFromDictionaries(dia, cue); foreach (string str in cleanDialogues) { - ModMonitor.Log("POST SANITIZARION: "+str); + ModMonitor.Log("POST SANITIZARION: " + str); if (AudioCues.getWavFileReferences(language).ContainsKey(AudioCues.generateKey(language, cue.name, fileName, key))) { AudioCues.getWavFileReferences(language).TryGetValue(AudioCues.generateKey(language, cue.name, fileName, key), out VoiceAudioOptions value);