diff --git a/GeneralMods/StardewMods.sln b/GeneralMods/StardewMods.sln index 3230c825..f5e56d43 100644 --- a/GeneralMods/StardewMods.sln +++ b/GeneralMods/StardewMods.sln @@ -67,6 +67,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StarAI", "..\StarAI\StarAI\ EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StardewSymphonyRemastered", "StardewSymphonyRemastered\StardewSymphonyRemastered\StardewSymphonyRemastered.csproj", "{19F64B03-6A9B-49E1-854A-C05D5A014646}" + ProjectSection(ProjectDependencies) = postProject + {0756D36A-95C8-480D-8EA6-4584C03010C6} = {0756D36A-95C8-480D-8EA6-4584C03010C6} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs index 1348761c..f4d9d61c 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs @@ -4,11 +4,21 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xna.Framework.Graphics; +using StardewValley; namespace StardewSymphonyRemastered.Framework.Menus { class MusicManagerMenu : StardewValley.Menus.IClickableMenu { + public List texturedStrings; + public MusicManagerMenu(float width, float height) + { + this.width = (int)width; + this.height = (int)height; + this.texturedStrings = new List(); + this.texturedStrings.Add(StardustCore.UIUtilities.SpriteFonts.SpriteFont.vanillaFont.ParseString("Hello", new Microsoft.Xna.Framework.Vector2(100, 100),StardustCore.IlluminateFramework.Colors.invertColor(StardustCore.IlluminateFramework.LightColorsList.Blue))); + } + public override void receiveRightClick(int x, int y, bool playSound = true) { throw new NotImplementedException(); @@ -16,7 +26,18 @@ namespace StardewSymphonyRemastered.Framework.Menus public override void drawBackground(SpriteBatch b) { - base.drawBackground(b); + Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true); + //base.drawBackground(b); + } + + public override void draw(SpriteBatch b) + { + this.drawBackground(b); + + foreach(var v in texturedStrings) + { + v.draw(b); + } } } } diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicPackMetaData.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicPackMetaData.cs index bb0bb2b9..73f0966a 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicPackMetaData.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicPackMetaData.cs @@ -1,4 +1,5 @@ -using System; +using Microsoft.Xna.Framework.Graphics; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -16,7 +17,8 @@ namespace StardewSymphonyRemastered.Framework public string author; public string description; public string versionInfo; - + public string pathToMusicPackIcon; + public Texture2D Icon; /// /// Constrctor /// @@ -24,12 +26,22 @@ namespace StardewSymphonyRemastered.Framework /// The author who compiled ths music pack. /// The description of /// - public MusicPackMetaData(string Name,string Author,string Description,string VersionInfo) + public MusicPackMetaData(string Name,string Author,string Description,string VersionInfo,string PathToMusicPackIcon) { this.name = Name; this.author = Author; this.description = Description; this.versionInfo = VersionInfo; + this.pathToMusicPackIcon = PathToMusicPackIcon; + try + { + this.Icon = StardewSymphony.ModHelper.Content.Load(this.pathToMusicPackIcon); + } + catch(Exception err) + { + this.Icon = null; + StardewSymphony.ModMonitor.Log(err.ToString()); + } } /// /// Blank Constructor diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/WavMusicPack.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/WavMusicPack.cs index 1c3ee009..d9449ede 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/WavMusicPack.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/WavMusicPack.cs @@ -49,7 +49,7 @@ namespace StardewSymphonyRemastered.Framework if (this.musicPackInformation == null) { StardewSymphony.ModMonitor.Log("Error: MusicPackInformation.json not found at: " + directoryToMusicPack + ". Blank information will be put in place.", StardewModdingAPI.LogLevel.Warn); - this.musicPackInformation = new MusicPackMetaData("???", "???", "", "0.0.0"); + this.musicPackInformation = new MusicPackMetaData("???", "???", "", "0.0.0",""); } this.loadMusicFiles(); } diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/XACTMusicPack.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/XACTMusicPack.cs index e5ed9a5f..de56a22e 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/XACTMusicPack.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/XACTMusicPack.cs @@ -41,7 +41,7 @@ namespace StardewSymphonyRemastered.Framework if (this.musicPackInformation == null) { StardewSymphony.ModMonitor.Log("Error: MusicPackInformation.json not found at: " + directoryToXwb + ". Blank information will be put in place.",StardewModdingAPI.LogLevel.Warn); - this.musicPackInformation = new MusicPackMetaData("???","???","","0.0.0"); + this.musicPackInformation = new MusicPackMetaData("???","???","","0.0.0",""); } this.WaveBank = new WaveBank(Game1.audioEngine, this.WaveBankPath); diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs index 5f080d7d..5f761eb0 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs @@ -86,7 +86,7 @@ namespace StardewSymphonyRemastered { if (e.KeyPressed == Microsoft.Xna.Framework.Input.Keys.O) { - Game1.activeClickableMenu = new StardewSymphonyRemastered.Framework.Menus.MusicManagerMenu(); + Game1.activeClickableMenu = new StardewSymphonyRemastered.Framework.Menus.MusicManagerMenu(Game1.viewport.Width,Game1.viewport.Height); } } @@ -139,7 +139,7 @@ namespace StardewSymphonyRemastered Directory.CreateDirectory(path); } if(!File.Exists(Path.Combine(path, "MusicPackInformation.json"))){ - MusicPackMetaData blankMetaData = new MusicPackMetaData("Omegas's Music Data Example","Omegasis","Just a simple example of how metadata is formated for music packs. Feel free to copy and edit this one!","1.0.0 CoolExample"); + MusicPackMetaData blankMetaData = new MusicPackMetaData("Omegas's Music Data Example","Omegasis","Just a simple example of how metadata is formated for music packs. Feel free to copy and edit this one!","1.0.0 CoolExample","Icon.png"); blankMetaData.writeToJson(Path.Combine(path, "MusicPackInformation.json")); } if (!File.Exists(Path.Combine(path, "readme.txt"))) @@ -166,7 +166,7 @@ namespace StardewSymphonyRemastered } if (!File.Exists(Path.Combine(path, "MusicPackInformation.json"))) { - MusicPackMetaData blankMetaData = new MusicPackMetaData("Omegas's Music Data Example", "Omegasis", "Just a simple example of how metadata is formated for music packs. Feel free to copy and edit this one!", "1.0.0 CoolExample"); + MusicPackMetaData blankMetaData = new MusicPackMetaData("Omegas's Music Data Example", "Omegasis", "Just a simple example of how metadata is formated for music packs. Feel free to copy and edit this one!", "1.0.0 CoolExample","Icon"); blankMetaData.writeToJson(Path.Combine(path, "MusicPackInformation.json")); } if (!File.Exists(Path.Combine(path, "readme.txt"))) diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj index fd6de3f7..da8dd107 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj @@ -32,6 +32,9 @@ 4 + + ..\..\StardustCore\bin\Release\StardustCore.dll + diff --git a/GeneralMods/StardustCore/Animations/AnimationManager.cs b/GeneralMods/StardustCore/Animations/AnimationManager.cs index 4e3d7328..ec94a8c1 100644 --- a/GeneralMods/StardustCore/Animations/AnimationManager.cs +++ b/GeneralMods/StardustCore/Animations/AnimationManager.cs @@ -120,10 +120,17 @@ namespace StardustCore.Animations } } + /// + /// Sets the animation manager to an on state, meaning that this animation will update on the draw frame. + /// public void enableAnimation() { this.enabled = true; } + + /// + /// Sets the animation manager to an off state, meaning that this animation will no longer update on the draw frame. + /// public void disableAnimation() { this.enabled = false; diff --git a/GeneralMods/StardustCore/IlluminateFramework/Colors.cs b/GeneralMods/StardustCore/IlluminateFramework/Colors.cs index 63ebae48..d89f33b0 100644 --- a/GeneralMods/StardustCore/IlluminateFramework/Colors.cs +++ b/GeneralMods/StardustCore/IlluminateFramework/Colors.cs @@ -12,7 +12,7 @@ namespace StardustCore.IlluminateFramework /// /// Make sure all colors are inverted. /// - public class ColorsList + public class LightColorsList { public static Color AliceBlue = new Color(15, 7, 0, 255); @@ -639,7 +639,7 @@ namespace StardustCore.IlluminateFramework } - public Color getColorFromList(string s) + public static Color getColorFromList(string s) { Color color; bool f = ColorDictionary.TryGetValue(s, out color); diff --git a/GeneralMods/StardustCore/ModCore.cs b/GeneralMods/StardustCore/ModCore.cs index 706bbd23..be88c1da 100644 --- a/GeneralMods/StardustCore/ModCore.cs +++ b/GeneralMods/StardustCore/ModCore.cs @@ -18,14 +18,16 @@ namespace StardustCore public static IModHelper ModHelper; public static IMonitor ModMonitor; public static Serialization.SerializationManager SerializationManager; + + public static string ContentDirectory; public override void Entry(IModHelper helper) { ModHelper = helper; - ModMonitor = this.Monitor; + ModMonitor = Monitor; //Unused MetaData information. Works in player inventory but not in chests. Besides who really care where an object is from anyways. Also doesn't work 100% like I intended since it only gets base mod object that this runs from, not extensions? // StardewModdingAPI.Events.GraphicsEvents.OnPostRenderGuiEvent += Metadata.GameEvents_UpdateTick; - StardewModdingAPI.Events.ControlEvents.MouseChanged += ControlEvents_MouseChanged; + //StardewModdingAPI.Events.ControlEvents.MouseChanged += ControlEvents_MouseChanged; string invPath = Path.Combine(ModCore.ModHelper.DirectoryPath, "PlayerData", Game1.player.name, "PlayerInventory"); string worldPath = Path.Combine(ModCore.ModHelper.DirectoryPath, Game1.player.name, "ObjectsInWorld"); ; string trashPath = Path.Combine(ModCore.ModHelper.DirectoryPath, "ModTrashFolder"); @@ -36,9 +38,11 @@ namespace StardustCore StardewModdingAPI.Events.SaveEvents.BeforeSave += SaveEvents_BeforeSave; StardewModdingAPI.Events.SaveEvents.AfterLoad += SaveEvents_AfterLoad; - IlluminateFramework.Colors.initializeColors(); - + ContentDirectory = Path.Combine(ModHelper.DirectoryPath, "Content"); + if (!Directory.Exists(ContentDirectory)) Directory.CreateDirectory(ContentDirectory); + UIUtilities.SpriteFonts.SpriteFont.initialize(); + } diff --git a/GeneralMods/StardustCore/StardustCore.csproj b/GeneralMods/StardustCore/StardustCore.csproj index f6afd46d..137361de 100644 --- a/GeneralMods/StardustCore/StardustCore.csproj +++ b/GeneralMods/StardustCore/StardustCore.csproj @@ -45,6 +45,12 @@ + + + + + + @@ -52,12 +58,16 @@ + + + + diff --git a/GeneralMods/StardustCore/UIUtilities/MenuComponents/Button.cs b/GeneralMods/StardustCore/UIUtilities/MenuComponents/Button.cs new file mode 100644 index 00000000..65ec9f73 --- /dev/null +++ b/GeneralMods/StardustCore/UIUtilities/MenuComponents/Button.cs @@ -0,0 +1,108 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using StardewValley; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardustCore.UIUtilities.MenuComponents +{ + public class Button : StardewValley.Menus.ClickableTextureComponent + { + public Animations.AnimationManager animationManager; + public Color textureColor; + public Color textColor; + /// + /// Basic Button constructor. + /// + /// + /// + /// + /// + /// + /// + public Button(string Name,Rectangle Bounds,Texture2D Texture,string displayText,Rectangle sourceRect,float Scale,Animations.Animation defaultAnimation, Color DrawColor,Color TextColor, bool AnimationEnabled=true) : base(Bounds,Texture,sourceRect,Scale) + { + this.animationManager = new Animations.AnimationManager(Texture, defaultAnimation,AnimationEnabled); + this.label = displayText; + this.name = Name; + this.textureColor = DrawColor; + if (this.textureColor == null) + { + this.textureColor = StardustCore.IlluminateFramework.Colors.getColorFromList("White"); + } + this.textColor = DrawColor; + if (this.textColor == null) + { + this.textColor = StardustCore.IlluminateFramework.Colors.getColorFromList("White"); + } + } + + /// + /// A more advanced Button constructor that deals with an animation manager. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public Button(string Name,Rectangle Bounds,Texture2D Texture, string displayText, Rectangle sourceRect,float Scale, Animations.Animation defaultAnimation,Dictionary> animationsToPlay,string startingAnimationKey,Color DrawColor,Color TextColor,int startingAnimationFrame=0,bool AnimationEnabled=true) : base(Bounds, Texture, sourceRect, Scale) + { + this.animationManager = new Animations.AnimationManager(Texture, defaultAnimation, animationsToPlay, startingAnimationKey, startingAnimationFrame, AnimationEnabled); + this.label = displayText; + this.name = Name; + this.textureColor = DrawColor; + if (this.textureColor == null) + { + this.textureColor = StardustCore.IlluminateFramework.Colors.getColorFromList("White"); + } + this.textColor = DrawColor; + if (this.textColor == null) + { + this.textColor = StardustCore.IlluminateFramework.Colors.getColorFromList("White"); + } + } + + /// + /// Draws the button and all of it's components. + /// + /// + /// + /// + public void draw(SpriteBatch b, float layerDepth) + { + + this.animationManager.tickAnimation(); + if (!this.visible) + return; + if (this.drawShadow) + Utility.drawWithShadow(b, this.texture, new Vector2((float)this.bounds.X + (float)(this.sourceRect.Width / 2) * this.baseScale, (float)this.bounds.Y + (float)(this.sourceRect.Height / 2) * this.baseScale), this.sourceRect, this.textureColor, 0.0f, new Vector2((float)(this.sourceRect.Width / 2), (float)(this.sourceRect.Height / 2)), this.scale, false, layerDepth, -1, -1, 0.35f); + else + b.Draw(this.texture, new Vector2((float)this.bounds.X + (float)(this.sourceRect.Width / 2) * this.baseScale, (float)this.bounds.Y + (float)(this.sourceRect.Height / 2) * this.baseScale), new Rectangle?(this.sourceRect), this.textureColor, 0.0f, new Vector2((float)(this.sourceRect.Width / 2), (float)(this.sourceRect.Height / 2)), this.scale, SpriteEffects.None, layerDepth); + if (string.IsNullOrEmpty(this.label)) + return; + b.DrawString(Game1.smallFont, this.label, new Vector2((float)(this.bounds.X + this.bounds.Width), (float)this.bounds.Y + ((float)(this.bounds.Height / 2) - Game1.smallFont.MeasureString(this.label).Y / 2f)), this.textColor); + } + + /// + /// Swaps if the button is visible or not. Also toggles the animation manager appropriately. + /// + public void swapVisibility() + { + if (this.visible == true) + { + this.visible = false; + this.animationManager.disableAnimation(); + } + } + + } +} diff --git a/GeneralMods/StardustCore/UIUtilities/SpriteFonts/CharacterSheets/GenericCharacterSheets.cs b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/CharacterSheets/GenericCharacterSheets.cs new file mode 100644 index 00000000..86558587 --- /dev/null +++ b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/CharacterSheets/GenericCharacterSheets.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework.Graphics; +using StardustCore.UIUtilities.SpriteFonts.Components; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardustCore.UIUtilities.SpriteFonts.CharacterSheets +{ + public class GenericCharacterSheets + { + public Dictionary CharacterAtlus; + + public virtual TexturedCharacter getTexturedCharacter(char c) + { + return new TexturedCharacter(); + } + } +} diff --git a/GeneralMods/StardustCore/UIUtilities/SpriteFonts/CharacterSheets/VanillaCharacterSheet.cs b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/CharacterSheets/VanillaCharacterSheet.cs new file mode 100644 index 00000000..2843e426 --- /dev/null +++ b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/CharacterSheets/VanillaCharacterSheet.cs @@ -0,0 +1,239 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.IO; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; +using StardustCore.UIUtilities.SpriteFonts.Components; + +namespace StardustCore.UIUtilities.SpriteFonts.CharacterSheets +{ + public class VanillaCharacterSheet :GenericCharacterSheets + { + + public VanillaCharacterSheet(string directoryToFonts) + { + Color fontColor = StardustCore.IlluminateFramework.Colors.getColorFromList("Black"); + this.CharacterAtlus = new Dictionary(); + this.CharacterAtlus.Add('0', new TexturedCharacter('0', Path.Combine(Utilities.getRelativePath(directoryToFonts), "0"), fontColor)); + this.CharacterAtlus.Add('1', new TexturedCharacter('1', Path.Combine(Utilities.getRelativePath(directoryToFonts), "1"), fontColor)); + this.CharacterAtlus.Add('2', new TexturedCharacter('2', Path.Combine(Utilities.getRelativePath(directoryToFonts), "2"), fontColor)); + this.CharacterAtlus.Add('3', new TexturedCharacter('3', Path.Combine(Utilities.getRelativePath(directoryToFonts), "3"), fontColor)); + this.CharacterAtlus.Add('4', new TexturedCharacter('4', Path.Combine(Utilities.getRelativePath(directoryToFonts), "4"), fontColor)); + this.CharacterAtlus.Add('5', new TexturedCharacter('5', Path.Combine(Utilities.getRelativePath(directoryToFonts), "5"), fontColor)); + this.CharacterAtlus.Add('6', new TexturedCharacter('6', Path.Combine(Utilities.getRelativePath(directoryToFonts), "6"), fontColor)); + this.CharacterAtlus.Add('7', new TexturedCharacter('7', Path.Combine(Utilities.getRelativePath(directoryToFonts), "7"), fontColor)); + this.CharacterAtlus.Add('8', new TexturedCharacter('8', Path.Combine(Utilities.getRelativePath(directoryToFonts), "8"), fontColor)); + this.CharacterAtlus.Add('9', new TexturedCharacter('9', Path.Combine(Utilities.getRelativePath(directoryToFonts), "9"), fontColor)); + + this.CharacterAtlus.Add('&', new TexturedCharacter('&', Path.Combine(Utilities.getRelativePath(directoryToFonts), "ampersand"), fontColor)); + this.CharacterAtlus.Add('*', new TexturedCharacter('*', Path.Combine(Utilities.getRelativePath(directoryToFonts), "asterisk"), fontColor)); + this.CharacterAtlus.Add('\\', new TexturedCharacter('\\', Path.Combine(Utilities.getRelativePath(directoryToFonts), "backSlash"), fontColor)); + + this.CharacterAtlus.Add('A', new TexturedCharacter('A', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalA"), fontColor)); + this.CharacterAtlus.Add('B', new TexturedCharacter('B', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalB"), fontColor)); + this.CharacterAtlus.Add('C', new TexturedCharacter('C', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalC"), fontColor)); + this.CharacterAtlus.Add('D', new TexturedCharacter('D', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalD"), fontColor)); + this.CharacterAtlus.Add('E', new TexturedCharacter('E', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalE"), fontColor)); + this.CharacterAtlus.Add('F', new TexturedCharacter('F', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalF"), fontColor)); + this.CharacterAtlus.Add('G', new TexturedCharacter('G', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalG"), fontColor)); + this.CharacterAtlus.Add('H', new TexturedCharacter('H', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalH"), fontColor)); + this.CharacterAtlus.Add('I', new TexturedCharacter('I', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalI"), fontColor)); + this.CharacterAtlus.Add('J', new TexturedCharacter('J', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalJ"), fontColor)); + this.CharacterAtlus.Add('K', new TexturedCharacter('K', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalK"), fontColor)); + this.CharacterAtlus.Add('L', new TexturedCharacter('L', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalL"), fontColor)); + this.CharacterAtlus.Add('M', new TexturedCharacter('M', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalM"), fontColor)); + this.CharacterAtlus.Add('N', new TexturedCharacter('N', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalN"), fontColor)); + this.CharacterAtlus.Add('O', new TexturedCharacter('O', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalO"), fontColor)); + this.CharacterAtlus.Add('P', new TexturedCharacter('P', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalP"), fontColor)); + this.CharacterAtlus.Add('Q', new TexturedCharacter('Q', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalQ"), fontColor)); + this.CharacterAtlus.Add('R', new TexturedCharacter('R', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalR"), fontColor)); + this.CharacterAtlus.Add('S', new TexturedCharacter('S', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalS"), fontColor)); + this.CharacterAtlus.Add('T', new TexturedCharacter('T', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalT"), fontColor)); + this.CharacterAtlus.Add('U', new TexturedCharacter('U', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalU"), fontColor)); + this.CharacterAtlus.Add('V', new TexturedCharacter('V', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalV"), fontColor)); + this.CharacterAtlus.Add('W', new TexturedCharacter('W', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalW"), fontColor)); + this.CharacterAtlus.Add('X', new TexturedCharacter('X', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalX"), fontColor)); + this.CharacterAtlus.Add('Y', new TexturedCharacter('Y', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalY"), fontColor)); + this.CharacterAtlus.Add('Z', new TexturedCharacter('Z', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalZ"), fontColor)); + + this.CharacterAtlus.Add('^', new TexturedCharacter('^', Path.Combine(Utilities.getRelativePath(directoryToFonts), "caret"), fontColor)); + this.CharacterAtlus.Add(':', new TexturedCharacter(':', Path.Combine(Utilities.getRelativePath(directoryToFonts), "colon"), fontColor)); + this.CharacterAtlus.Add(',', new TexturedCharacter(',', Path.Combine(Utilities.getRelativePath(directoryToFonts), "comma"), fontColor)); + this.CharacterAtlus.Add('\"', new TexturedCharacter('\"', Path.Combine(Utilities.getRelativePath(directoryToFonts), "doubleQuotes"), fontColor)); + this.CharacterAtlus.Add('!', new TexturedCharacter('!', Path.Combine(Utilities.getRelativePath(directoryToFonts), "exclamationMark"), fontColor)); + this.CharacterAtlus.Add('/', new TexturedCharacter('/', Path.Combine(Utilities.getRelativePath(directoryToFonts), "forwardSlash"), fontColor)); + this.CharacterAtlus.Add('`', new TexturedCharacter('`', Path.Combine(Utilities.getRelativePath(directoryToFonts), "grave"), fontColor)); + this.CharacterAtlus.Add('[', new TexturedCharacter('[', Path.Combine(Utilities.getRelativePath(directoryToFonts), "leftBracket"), fontColor)); + this.CharacterAtlus.Add('{', new TexturedCharacter('{', Path.Combine(Utilities.getRelativePath(directoryToFonts), "leftCurlyBracket"), fontColor)); + this.CharacterAtlus.Add('(', new TexturedCharacter('(', Path.Combine(Utilities.getRelativePath(directoryToFonts), "leftParenthesis"), fontColor)); + + this.CharacterAtlus.Add('a', new TexturedCharacter('a', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseA"), fontColor)); + this.CharacterAtlus.Add('b', new TexturedCharacter('b', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseB"), fontColor)); + this.CharacterAtlus.Add('c', new TexturedCharacter('c', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseC"), fontColor)); + this.CharacterAtlus.Add('d', new TexturedCharacter('d', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseD"), fontColor)); + this.CharacterAtlus.Add('e', new TexturedCharacter('e', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseE"), fontColor)); + this.CharacterAtlus.Add('f', new TexturedCharacter('f', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseF"), fontColor)); + this.CharacterAtlus.Add('g', new TexturedCharacter('g', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseG"), fontColor)); + this.CharacterAtlus.Add('h', new TexturedCharacter('h', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseH"), fontColor)); + this.CharacterAtlus.Add('i', new TexturedCharacter('i', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseI"), fontColor)); + this.CharacterAtlus.Add('j', new TexturedCharacter('j', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseJ"), fontColor)); + this.CharacterAtlus.Add('k', new TexturedCharacter('k', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseK"), fontColor)); + this.CharacterAtlus.Add('l', new TexturedCharacter('l', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseL"), fontColor)); + this.CharacterAtlus.Add('m', new TexturedCharacter('m', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseM"), fontColor)); + this.CharacterAtlus.Add('n', new TexturedCharacter('n', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseN"), fontColor)); + this.CharacterAtlus.Add('o', new TexturedCharacter('o', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseO"), fontColor)); + this.CharacterAtlus.Add('p', new TexturedCharacter('p', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseP"), fontColor)); + this.CharacterAtlus.Add('q', new TexturedCharacter('q', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseQ"), fontColor)); + this.CharacterAtlus.Add('r', new TexturedCharacter('r', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseR"), fontColor)); + this.CharacterAtlus.Add('s', new TexturedCharacter('s', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseS"), fontColor)); + this.CharacterAtlus.Add('t', new TexturedCharacter('t', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseT"), fontColor)); + this.CharacterAtlus.Add('u', new TexturedCharacter('u', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseU"), fontColor)); + this.CharacterAtlus.Add('v', new TexturedCharacter('v', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseV"), fontColor)); + this.CharacterAtlus.Add('w', new TexturedCharacter('w', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseW"), fontColor)); + this.CharacterAtlus.Add('x', new TexturedCharacter('x', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseX"), fontColor)); + this.CharacterAtlus.Add('y', new TexturedCharacter('y', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseY"), fontColor)); + this.CharacterAtlus.Add('z', new TexturedCharacter('z', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseZ"), fontColor)); + + this.CharacterAtlus.Add('-', new TexturedCharacter('-', Path.Combine(Utilities.getRelativePath(directoryToFonts), "minus"), fontColor)); + this.CharacterAtlus.Add('%', new TexturedCharacter('%', Path.Combine(Utilities.getRelativePath(directoryToFonts), "percent"), fontColor)); + this.CharacterAtlus.Add('.', new TexturedCharacter('.', Path.Combine(Utilities.getRelativePath(directoryToFonts), "period"), fontColor)); + this.CharacterAtlus.Add('+', new TexturedCharacter('+', Path.Combine(Utilities.getRelativePath(directoryToFonts), "plus"), fontColor)); + this.CharacterAtlus.Add('#', new TexturedCharacter('#', Path.Combine(Utilities.getRelativePath(directoryToFonts), "pound"), fontColor)); + + this.CharacterAtlus.Add('?', new TexturedCharacter('?', Path.Combine(Utilities.getRelativePath(directoryToFonts), "questionMark"), fontColor)); + this.CharacterAtlus.Add(']', new TexturedCharacter(']', Path.Combine(Utilities.getRelativePath(directoryToFonts), "rightBracket"), fontColor)); + this.CharacterAtlus.Add('}', new TexturedCharacter('}', Path.Combine(Utilities.getRelativePath(directoryToFonts), "rightCurlyBracket"), fontColor)); + + this.CharacterAtlus.Add(')', new TexturedCharacter(')', Path.Combine(Utilities.getRelativePath(directoryToFonts), "rightParenthesis"), fontColor)); + + this.CharacterAtlus.Add(';', new TexturedCharacter(';', Path.Combine(Utilities.getRelativePath(directoryToFonts), "semicolon"), fontColor)); + + this.CharacterAtlus.Add('\'', new TexturedCharacter('\'', Path.Combine(Utilities.getRelativePath(directoryToFonts), "singleQuote"), fontColor)); + this.CharacterAtlus.Add(' ', new TexturedCharacter(' ', Path.Combine(Utilities.getRelativePath(directoryToFonts), "space"), fontColor)); + this.CharacterAtlus.Add('~', new TexturedCharacter('~', Path.Combine(Utilities.getRelativePath(directoryToFonts), "tilde"), fontColor)); + this.CharacterAtlus.Add('_', new TexturedCharacter('_', Path.Combine(Utilities.getRelativePath(directoryToFonts), "underScore"), fontColor)); + this.CharacterAtlus.Add('|', new TexturedCharacter('|', Path.Combine(Utilities.getRelativePath(directoryToFonts), "verticalLine"), fontColor)); + + this.CharacterAtlus.Add('$', new TexturedCharacter('$', Path.Combine(Utilities.getRelativePath(directoryToFonts), "coin"), fontColor)); + this.CharacterAtlus.Add('=', new TexturedCharacter('=', Path.Combine(Utilities.getRelativePath(directoryToFonts), "star"), fontColor)); + this.CharacterAtlus.Add('@', new TexturedCharacter('@', Path.Combine(Utilities.getRelativePath(directoryToFonts), "heart"), fontColor)); + } + + public VanillaCharacterSheet(string directoryToFonts, Color fontColor) + { + this.CharacterAtlus = new Dictionary(); + this.CharacterAtlus.Add('0', new TexturedCharacter('0', Path.Combine(Utilities.getRelativePath(directoryToFonts), "0"), fontColor)); + this.CharacterAtlus.Add('1', new TexturedCharacter('1', Path.Combine(Utilities.getRelativePath(directoryToFonts), "1"), fontColor)); + this.CharacterAtlus.Add('2', new TexturedCharacter('2', Path.Combine(Utilities.getRelativePath(directoryToFonts), "2"), fontColor)); + this.CharacterAtlus.Add('3', new TexturedCharacter('3', Path.Combine(Utilities.getRelativePath(directoryToFonts), "3"), fontColor)); + this.CharacterAtlus.Add('4', new TexturedCharacter('4', Path.Combine(Utilities.getRelativePath(directoryToFonts), "4"), fontColor)); + this.CharacterAtlus.Add('5', new TexturedCharacter('5', Path.Combine(Utilities.getRelativePath(directoryToFonts), "5"), fontColor)); + this.CharacterAtlus.Add('6', new TexturedCharacter('6', Path.Combine(Utilities.getRelativePath(directoryToFonts), "6"), fontColor)); + this.CharacterAtlus.Add('7', new TexturedCharacter('7', Path.Combine(Utilities.getRelativePath(directoryToFonts), "7"), fontColor)); + this.CharacterAtlus.Add('8', new TexturedCharacter('8', Path.Combine(Utilities.getRelativePath(directoryToFonts), "8"), fontColor)); + this.CharacterAtlus.Add('9', new TexturedCharacter('9', Path.Combine(Utilities.getRelativePath(directoryToFonts), "9"), fontColor)); + + this.CharacterAtlus.Add('&', new TexturedCharacter('&', Path.Combine(Utilities.getRelativePath(directoryToFonts), "ampersand"), fontColor)); + this.CharacterAtlus.Add('*', new TexturedCharacter('*', Path.Combine(Utilities.getRelativePath(directoryToFonts), "asterisk"), fontColor)); + this.CharacterAtlus.Add('\\', new TexturedCharacter('\\', Path.Combine(Utilities.getRelativePath(directoryToFonts), "backSlash"), fontColor)); + + this.CharacterAtlus.Add('A', new TexturedCharacter('A', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalA"), fontColor)); + this.CharacterAtlus.Add('B', new TexturedCharacter('B', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalB"), fontColor)); + this.CharacterAtlus.Add('C', new TexturedCharacter('C', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalC"), fontColor)); + this.CharacterAtlus.Add('D', new TexturedCharacter('D', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalD"), fontColor)); + this.CharacterAtlus.Add('E', new TexturedCharacter('E', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalE"), fontColor)); + this.CharacterAtlus.Add('F', new TexturedCharacter('F', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalF"), fontColor)); + this.CharacterAtlus.Add('G', new TexturedCharacter('G', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalG"), fontColor)); + this.CharacterAtlus.Add('H', new TexturedCharacter('H', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalH"), fontColor)); + this.CharacterAtlus.Add('I', new TexturedCharacter('I', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalI"), fontColor)); + this.CharacterAtlus.Add('J', new TexturedCharacter('J', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalJ"), fontColor)); + this.CharacterAtlus.Add('K', new TexturedCharacter('K', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalK"), fontColor)); + this.CharacterAtlus.Add('L', new TexturedCharacter('L', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalL"), fontColor)); + this.CharacterAtlus.Add('M', new TexturedCharacter('M', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalM"), fontColor)); + this.CharacterAtlus.Add('N', new TexturedCharacter('N', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalN"), fontColor)); + this.CharacterAtlus.Add('O', new TexturedCharacter('O', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalO"), fontColor)); + this.CharacterAtlus.Add('P', new TexturedCharacter('P', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalP"), fontColor)); + this.CharacterAtlus.Add('Q', new TexturedCharacter('Q', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalQ"), fontColor)); + this.CharacterAtlus.Add('R', new TexturedCharacter('R', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalR"), fontColor)); + this.CharacterAtlus.Add('S', new TexturedCharacter('S', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalS"), fontColor)); + this.CharacterAtlus.Add('T', new TexturedCharacter('T', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalT"), fontColor)); + this.CharacterAtlus.Add('U', new TexturedCharacter('U', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalU"), fontColor)); + this.CharacterAtlus.Add('V', new TexturedCharacter('V', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalV"), fontColor)); + this.CharacterAtlus.Add('W', new TexturedCharacter('W', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalW"), fontColor)); + this.CharacterAtlus.Add('X', new TexturedCharacter('X', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalX"), fontColor)); + this.CharacterAtlus.Add('Y', new TexturedCharacter('Y', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalY"), fontColor)); + this.CharacterAtlus.Add('Z', new TexturedCharacter('Z', Path.Combine(Utilities.getRelativePath(directoryToFonts), "capitalZ"), fontColor)); + + this.CharacterAtlus.Add('^', new TexturedCharacter('^', Path.Combine(Utilities.getRelativePath(directoryToFonts), "caret"), fontColor)); + this.CharacterAtlus.Add(':', new TexturedCharacter(':', Path.Combine(Utilities.getRelativePath(directoryToFonts), "colon"), fontColor)); + this.CharacterAtlus.Add(',', new TexturedCharacter(',', Path.Combine(Utilities.getRelativePath(directoryToFonts), "comma"), fontColor)); + this.CharacterAtlus.Add('\"', new TexturedCharacter('\"', Path.Combine(Utilities.getRelativePath(directoryToFonts), "doubleQuotes"), fontColor)); + this.CharacterAtlus.Add('!', new TexturedCharacter('!', Path.Combine(Utilities.getRelativePath(directoryToFonts), "exclamationMark"), fontColor)); + this.CharacterAtlus.Add('/', new TexturedCharacter('/', Path.Combine(Utilities.getRelativePath(directoryToFonts), "forwardSlash"), fontColor)); + this.CharacterAtlus.Add('`', new TexturedCharacter('`', Path.Combine(Utilities.getRelativePath(directoryToFonts), "grave"), fontColor)); + this.CharacterAtlus.Add('[', new TexturedCharacter('[', Path.Combine(Utilities.getRelativePath(directoryToFonts), "leftBracket"), fontColor)); + this.CharacterAtlus.Add('{', new TexturedCharacter('{', Path.Combine(Utilities.getRelativePath(directoryToFonts), "leftCurlyBracket"), fontColor)); + this.CharacterAtlus.Add('(', new TexturedCharacter('(', Path.Combine(Utilities.getRelativePath(directoryToFonts), "leftParenthesis"), fontColor)); + + this.CharacterAtlus.Add('a', new TexturedCharacter('a', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseA"), fontColor)); + this.CharacterAtlus.Add('b', new TexturedCharacter('b', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseB"), fontColor)); + this.CharacterAtlus.Add('c', new TexturedCharacter('c', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseC"), fontColor)); + this.CharacterAtlus.Add('d', new TexturedCharacter('d', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseD"), fontColor)); + this.CharacterAtlus.Add('e', new TexturedCharacter('e', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseE"), fontColor)); + this.CharacterAtlus.Add('f', new TexturedCharacter('f', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseF"), fontColor)); + this.CharacterAtlus.Add('g', new TexturedCharacter('g', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseG"), fontColor)); + this.CharacterAtlus.Add('h', new TexturedCharacter('h', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseH"), fontColor)); + this.CharacterAtlus.Add('i', new TexturedCharacter('i', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseI"), fontColor)); + this.CharacterAtlus.Add('j', new TexturedCharacter('j', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseJ"), fontColor)); + this.CharacterAtlus.Add('k', new TexturedCharacter('k', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseK"), fontColor)); + this.CharacterAtlus.Add('l', new TexturedCharacter('l', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseL"), fontColor)); + this.CharacterAtlus.Add('m', new TexturedCharacter('m', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseM"), fontColor)); + this.CharacterAtlus.Add('n', new TexturedCharacter('n', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseN"), fontColor)); + this.CharacterAtlus.Add('o', new TexturedCharacter('o', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseO"), fontColor)); + this.CharacterAtlus.Add('p', new TexturedCharacter('p', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseP"), fontColor)); + this.CharacterAtlus.Add('q', new TexturedCharacter('q', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseQ"), fontColor)); + this.CharacterAtlus.Add('r', new TexturedCharacter('r', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseR"), fontColor)); + this.CharacterAtlus.Add('s', new TexturedCharacter('s', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseS"), fontColor)); + this.CharacterAtlus.Add('t', new TexturedCharacter('t', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseT"), fontColor)); + this.CharacterAtlus.Add('u', new TexturedCharacter('u', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseU"), fontColor)); + this.CharacterAtlus.Add('v', new TexturedCharacter('v', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseV"), fontColor)); + this.CharacterAtlus.Add('w', new TexturedCharacter('w', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseW"), fontColor)); + this.CharacterAtlus.Add('x', new TexturedCharacter('x', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseX"), fontColor)); + this.CharacterAtlus.Add('y', new TexturedCharacter('y', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseY"), fontColor)); + this.CharacterAtlus.Add('z', new TexturedCharacter('z', Path.Combine(Utilities.getRelativePath(directoryToFonts), "lowercaseZ"), fontColor)); + + this.CharacterAtlus.Add('-', new TexturedCharacter('-', Path.Combine(Utilities.getRelativePath(directoryToFonts), "minus"), fontColor)); + this.CharacterAtlus.Add('%', new TexturedCharacter('%', Path.Combine(Utilities.getRelativePath(directoryToFonts), "percent"), fontColor)); + this.CharacterAtlus.Add('.', new TexturedCharacter('.', Path.Combine(Utilities.getRelativePath(directoryToFonts), "period"), fontColor)); + this.CharacterAtlus.Add('+', new TexturedCharacter('+', Path.Combine(Utilities.getRelativePath(directoryToFonts), "plus"), fontColor)); + this.CharacterAtlus.Add('#', new TexturedCharacter('#', Path.Combine(Utilities.getRelativePath(directoryToFonts), "pound"), fontColor)); + + this.CharacterAtlus.Add('?', new TexturedCharacter('?', Path.Combine(Utilities.getRelativePath(directoryToFonts), "questionMark"), fontColor)); + this.CharacterAtlus.Add(']', new TexturedCharacter(']', Path.Combine(Utilities.getRelativePath(directoryToFonts), "rightBracket"), fontColor)); + this.CharacterAtlus.Add('}', new TexturedCharacter('}', Path.Combine(Utilities.getRelativePath(directoryToFonts), "rightCurlyBracket"), fontColor)); + + this.CharacterAtlus.Add(')', new TexturedCharacter(')', Path.Combine(Utilities.getRelativePath(directoryToFonts), "rightParenthesis"), fontColor)); + + this.CharacterAtlus.Add(';', new TexturedCharacter(';', Path.Combine(Utilities.getRelativePath(directoryToFonts), "semicolon"), fontColor)); + + this.CharacterAtlus.Add('\'', new TexturedCharacter('\'', Path.Combine(Utilities.getRelativePath(directoryToFonts), "singleQuote"), fontColor)); + this.CharacterAtlus.Add(' ', new TexturedCharacter(' ', Path.Combine(Utilities.getRelativePath(directoryToFonts), "space"), fontColor)); + this.CharacterAtlus.Add('~', new TexturedCharacter('~', Path.Combine(Utilities.getRelativePath(directoryToFonts), "tilde"), fontColor)); + this.CharacterAtlus.Add('_', new TexturedCharacter('_', Path.Combine(Utilities.getRelativePath(directoryToFonts), "underScore"), fontColor)); + this.CharacterAtlus.Add('|', new TexturedCharacter('|', Path.Combine(Utilities.getRelativePath(directoryToFonts), "verticalLine"), fontColor)); + + this.CharacterAtlus.Add('$', new TexturedCharacter('$', Path.Combine(Utilities.getRelativePath(directoryToFonts), "coin"), fontColor)); + this.CharacterAtlus.Add('=', new TexturedCharacter('=', Path.Combine(Utilities.getRelativePath(directoryToFonts), "star"), fontColor)); + this.CharacterAtlus.Add('@', new TexturedCharacter('@', Path.Combine(Utilities.getRelativePath(directoryToFonts), "heart"), fontColor)); + } + + public override TexturedCharacter getTexturedCharacter(char c) + { + var original = this.CharacterAtlus[c]; + return TexturedCharacter.Copy(original); + } + } +} diff --git a/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/Components/CharacterSpacing.cs b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/Components/CharacterSpacing.cs new file mode 100644 index 00000000..34205001 --- /dev/null +++ b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/Components/CharacterSpacing.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardustCore.UIUtilities.SpriteFonts.Components +{ + /// + /// Used to determine spacing between TexturedCharacters. + /// + public class CharacterSpacing + { + /// + /// Padding to offset this chaarcter by the previous character; + /// + public int LeftPadding; + /// + /// Padding to offset the following character by. + /// + public int RightPadding; + /// + /// Padding to offset the top character by. Not sure if this will be used. + /// + public int TopPadding; + /// + /// Padding to offset the bottom character by. Not sure if this will be used. + /// + public int BottomPadding; + + /// + /// Empty constructor; + /// + public CharacterSpacing() + { + + } + + /// + /// Constructor. + /// + /// + /// + /// + /// + public CharacterSpacing(int left, int right, int top, int bottom) + { + this.LeftPadding = left; + this.RightPadding = right; + this.TopPadding = top; + this.BottomPadding = bottom; + } + + /// + /// Save this to a .json file. + /// + /// + public void WriteToJson(string path) + { + StardustCore.ModCore.ModHelper.WriteJsonFile(path, this); + } + + /// + /// Read the data from the .json file. + /// + /// + /// + public static CharacterSpacing ReadFromJson(string path) + { + return StardustCore.ModCore.ModHelper.ReadJsonFile(path); + } + } +} diff --git a/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/Components/TexturedCharacter.cs b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/Components/TexturedCharacter.cs new file mode 100644 index 00000000..c5f89a46 --- /dev/null +++ b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/Components/TexturedCharacter.cs @@ -0,0 +1,61 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardustCore.UIUtilities.SpriteFonts.Components +{ + public class TexturedCharacter + { + public char character; + public string pathToTexture; + public Texture2D texture; + public CharacterSpacing spacing; + public Color drawColor; + public Vector2 position; + + public TexturedCharacter() + { + + } + + public TexturedCharacter(char Character,string PathToTexture,Color color) + { + this.character = Character; + this.pathToTexture = PathToTexture; + string text = this.pathToTexture.Remove(0, 1); + this.texture = StardustCore.ModCore.ModHelper.Content.Load(text+".png"); + this.spacing = new CharacterSpacing(); + this.drawColor = color; + this.position = new Vector2(); + } + + public TexturedCharacter(char Character, string PathToTexture,Color color,int left, int right,int top, int bottom) + { + this.character = Character; + this.pathToTexture = PathToTexture; + string text = this.pathToTexture.Remove(0, 1); + this.texture = StardustCore.ModCore.ModHelper.Content.Load(text + ".png"); + this.spacing = new CharacterSpacing(left,right,top,bottom); + this.drawColor = color; + this.position = new Vector2(); + } + + public static TexturedCharacter Copy(TexturedCharacter original) + { + TexturedCharacter copy = new TexturedCharacter(original.character,original.pathToTexture,original.drawColor); + copy.spacing = new CharacterSpacing(original.spacing.LeftPadding, original.spacing.RightPadding, original.spacing.TopPadding, original.spacing.BottomPadding); + return copy; + } + + + public void draw(SpriteBatch b) + { + b.Draw(this.texture, this.position, this.drawColor); + } + } +} diff --git a/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/Components/TexturedString.cs b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/Components/TexturedString.cs new file mode 100644 index 00000000..878407b3 --- /dev/null +++ b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/Components/TexturedString.cs @@ -0,0 +1,129 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardustCore.UIUtilities.SpriteFonts.Components +{ + public class TexturedString + { + List characters; + Vector2 position; + + public TexturedString(Vector2 Position,List Characters) + { + this.characters = Characters; + this.position = Position; + setCharacterPositions(); + } + + /// + /// Sets the character positions relative to the string's position on screen. + /// + public void setCharacterPositions() + { + int index = 0; + TexturedCharacter lastSeenChar=new TexturedCharacter(); + foreach(var c in characters) + { + if (index == 0) + { + c.position = new Vector2(this.position.X + c.spacing.LeftPadding,this.position.Y); + } + else + { + c.position = new Vector2(this.position.X + c.spacing.LeftPadding + lastSeenChar.spacing.RightPadding+lastSeenChar.texture.Width*index, this.position.Y); + } + StardustCore.ModCore.ModMonitor.Log(c.character.ToString()); + StardustCore.ModCore.ModMonitor.Log(c.position.ToString()); + lastSeenChar = c; + index++; + } + } + + /// + /// Adds a textured character to a textured string. + /// + /// + public void addCharacterToEnd(TexturedCharacter ch) + { + this.characters.Add(ch); + this.setCharacterPositions(); + } + + /// + /// Adds a list of textured characters to a textured string. + /// + /// + public void addCharactersToEnd(List chList) + { + foreach(var ch in chList) + { + this.characters.Add(ch); + } + this.setCharacterPositions(); + } + + /// + /// Adds the strings together and allows the position to be set. + /// + /// + /// + /// + /// + public TexturedString addStrings(TexturedString first,TexturedString second,Vector2 NewPosition) + { + var newString = first + second; + newString.position = NewPosition; + newString.setCharacterPositions(); + return newString; + } + + /// + /// Operator overload of +. Adds the two strings together and sets a new 0,0 position. + /// + /// + /// + /// + public static TexturedString operator+(TexturedString first, TexturedString second) + { + List characterList = new List(); + foreach(var v in first.characters) + { + characterList.Add(v); + } + foreach (var v in second.characters) + { + characterList.Add(v); + } + TexturedString newString = new TexturedString(new Vector2(0, 0), characterList); + return newString; + } + + + /// + /// Removes the characters from the textured word. + /// + /// + /// + public void removeCharactersFromEnd(int index,int howMany) + { + this.characters.RemoveRange(index, howMany); + } + + /// + /// Draw the textured string. + /// + /// + public void draw(SpriteBatch b) + { + foreach(var v in this.characters) + { + v.draw(b); + } + } + } +} diff --git a/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/GenericFont.cs b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/GenericFont.cs new file mode 100644 index 00000000..f5aed4e1 --- /dev/null +++ b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/GenericFont.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardustCore.UIUtilities.SpriteFonts.Fonts +{ + public class GenericFont + { + + public CharacterSheets.GenericCharacterSheets characterSheet; + public string path; + } +} diff --git a/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/VanillaFont.cs b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/VanillaFont.cs new file mode 100644 index 00000000..7e33c682 --- /dev/null +++ b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/Fonts/VanillaFont.cs @@ -0,0 +1,102 @@ +using Microsoft.Xna.Framework; +using StardustCore.UIUtilities.SpriteFonts.CharacterSheets; +using StardustCore.UIUtilities.SpriteFonts.Components; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardustCore.UIUtilities.SpriteFonts.Fonts +{ + public class VanillaFont :GenericFont + { + /// + /// Constructor; + /// + public VanillaFont() + { + this.path = Path.Combine(StardustCore.UIUtilities.SpriteFonts.SpriteFont.FontDirectory, "Vanilla"); + if (!Directory.Exists(path)) Directory.CreateDirectory(path); + this.characterSheet = new VanillaCharacterSheet(path); + } + + /// + /// Takes a string and returns a textured string in it's place. + /// + /// + /// + public TexturedString voidParseString(string str) + { + List characters=new List(); + foreach(var chr in str) + { + characters.Add(characterSheet.getTexturedCharacter(chr)); + } + var tStr = new TexturedString(new Microsoft.Xna.Framework.Vector2(0, 0), characters); + return tStr; + } + + /// + /// Takes a string and returns a textured string in it's place. Also sets the new position. + /// + /// + /// + /// + public TexturedString ParseString(string str,Vector2 Position) + { + List characters = new List(); + foreach (var chr in str) + { + characters.Add(characterSheet.getTexturedCharacter(chr)); + } + var tStr = new TexturedString(Position, characters); + return tStr; + } + + /// + /// Takes a string and returns a textured string in it's place. Also sets the new position and string color. + /// + /// + /// + /// + /// + public TexturedString ParseString(string str, Vector2 Position, Color stringColor) + { + List characters = new List(); + foreach (var chr in str) + { + var c = characterSheet.getTexturedCharacter(chr); + c.drawColor = stringColor; + characters.Add(c); + } + var tStr = new TexturedString(Position, characters); + return tStr; + } + + /// + /// Takes a string and returns a textured string in it's place. Also sets the new position and string color. + /// + /// + /// + /// The color for the individual characters. + /// + public TexturedString ParseString(string str, Vector2 Position, List stringColor) + { + List characters = new List(); + int index = 0; + foreach (var chr in str) + { + var c = characterSheet.getTexturedCharacter(chr); + c.drawColor = stringColor.ElementAt(index); + characters.Add(c); + index++; + } + var tStr = new TexturedString(Position, characters); + return tStr; + } + + + } +} diff --git a/GeneralMods/StardustCore/UIUtilities/SpriteFonts/SpriteFont.cs b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/SpriteFont.cs new file mode 100644 index 00000000..201f0f1b --- /dev/null +++ b/GeneralMods/StardustCore/UIUtilities/SpriteFonts/SpriteFont.cs @@ -0,0 +1,28 @@ +using StardustCore.UIUtilities.SpriteFonts.Fonts; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardustCore.UIUtilities.SpriteFonts +{ + /// + /// Manages Fonts for Stardust core. While all fonts variables can be accessed from their classes, they can also hold a reference here. + /// + public class SpriteFont + { + public static string FontDirectory; + + public static VanillaFont vanillaFont; + + public static void initialize() + { + StardustCore.ModCore.ModMonitor.Log("HEY THERE!!"); + FontDirectory = Path.Combine(StardustCore.ModCore.ContentDirectory, "Fonts"); + if (!Directory.Exists(FontDirectory)) Directory.CreateDirectory(FontDirectory); + vanillaFont = new VanillaFont(); + } + } +} diff --git a/GeneralMods/StardustCore/Utilities.cs b/GeneralMods/StardustCore/Utilities.cs index 9703e5d9..9d1595c7 100644 --- a/GeneralMods/StardustCore/Utilities.cs +++ b/GeneralMods/StardustCore/Utilities.cs @@ -30,8 +30,16 @@ namespace StardustCore return (int)((double)c.price * (1.0 + (double)c.quality * 0.25)); } - - + /// + /// Returns an absolute path past the mod's directory. + /// + /// + /// + public static string getRelativePath(string absolutePath) + { + var ok= absolutePath.Split(new string[] { "StardustCore" }, StringSplitOptions.None); + return ok.ElementAt(1); + } public static void createObjectDebris(Item I, int xTileOrigin, int yTileOrigin, int xTileTarget, int yTileTarget, int groundLevel = -1, int itemQuality = 0, float velocityMultiplyer = 1f, GameLocation location = null) diff --git a/GeneralMods/UIUtilities/UIUtilities.sln b/GeneralMods/UIUtilities/UIUtilities.sln new file mode 100644 index 00000000..9249205d --- /dev/null +++ b/GeneralMods/UIUtilities/UIUtilities.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Express 14 for Windows Desktop +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UIUtilities", "UIUtilities\UIUtilities.csproj", "{ABA29468-BAC9-47E9-983A-393FC5489124}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ABA29468-BAC9-47E9-983A-393FC5489124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ABA29468-BAC9-47E9-983A-393FC5489124}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ABA29468-BAC9-47E9-983A-393FC5489124}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ABA29468-BAC9-47E9-983A-393FC5489124}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/GeneralMods/UIUtilities/UIUtilities/Class1.cs b/GeneralMods/UIUtilities/UIUtilities/Class1.cs new file mode 100644 index 00000000..aa318fee --- /dev/null +++ b/GeneralMods/UIUtilities/UIUtilities/Class1.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UIUtilities +{ + public class Class1 + { + } +} diff --git a/GeneralMods/UIUtilities/UIUtilities/MenuComponents/Button.cs b/GeneralMods/UIUtilities/UIUtilities/MenuComponents/Button.cs new file mode 100644 index 00000000..71eb3c9d --- /dev/null +++ b/GeneralMods/UIUtilities/UIUtilities/MenuComponents/Button.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UIUtilities.MenuComponents +{ + class Button : StardewValley.Menus.ClickableComponent + { + } +} diff --git a/GeneralMods/UIUtilities/UIUtilities/Properties/AssemblyInfo.cs b/GeneralMods/UIUtilities/UIUtilities/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..a20bd801 --- /dev/null +++ b/GeneralMods/UIUtilities/UIUtilities/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("UIUtilities")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("UIUtilities")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("aba29468-bac9-47e9-983a-393fc5489124")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/GeneralMods/UIUtilities/UIUtilities/UIUtilities.csproj b/GeneralMods/UIUtilities/UIUtilities/UIUtilities.csproj new file mode 100644 index 00000000..057f4cef --- /dev/null +++ b/GeneralMods/UIUtilities/UIUtilities/UIUtilities.csproj @@ -0,0 +1,67 @@ + + + + + Debug + AnyCPU + {ABA29468-BAC9-47E9-983A-393FC5489124} + Library + Properties + UIUtilities + UIUtilities + v4.5 + 512 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/GeneralMods/UIUtilities/UIUtilities/packages.config b/GeneralMods/UIUtilities/UIUtilities/packages.config new file mode 100644 index 00000000..028670c6 --- /dev/null +++ b/GeneralMods/UIUtilities/UIUtilities/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file