diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Content/Graphics/MusicMenu/MusicDisk.png b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Content/Graphics/MusicMenu/MusicDisk.png new file mode 100644 index 00000000..d15119d6 Binary files /dev/null and b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Content/Graphics/MusicMenu/MusicDisk.png differ diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs index 6224111d..17471024 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs @@ -29,14 +29,29 @@ namespace StardewSymphonyRemastered.Framework.Menus int rows = 0; foreach(var v in StardewSymphony.musicManager.musicPacks) { - this.buttons.Add(new Button(v.Key, new Rectangle(100+(numOfButtons*100), 100+(rows*100), 64, 64), StardewSymphony.textureManager.getTexture("MusicNote").Copy(StardewSymphony.ModHelper), "", new Rectangle(0, 0, 16, 16), 4f, new StardustCore.Animations.Animation(new Rectangle(0, 0, 16, 16)), Color.White, Color.White, new ButtonFunctionality(new DelegatePairing(displayMusicPack, new List + if (v.Value.musicPackInformation.Icon == null) { + this.buttons.Add(new Button(v.Key, new Rectangle(100 + (numOfButtons * 100), 125 + (rows * 100), 64, 64), StardewSymphony.textureManager.getTexture("MusicDisk"), "", new Rectangle(0, 0, 16, 16), 4f, new StardustCore.Animations.Animation(new Rectangle(0, 0, 16, 16)), StardustCore.IlluminateFramework.Colors.randomColor(), Color.White, new ButtonFunctionality(new DelegatePairing(displayMusicPack, new List + { + (object)v + } + ), null, new DelegatePairing(null, new List(){ (object)v + } + )), false)); } - ),null, new DelegatePairing(null,new List(){ + else + { + this.buttons.Add(new Button(v.Key, new Rectangle(100 + (numOfButtons * 100), 100 + (rows * 100), 64, 64), v.Value.musicPackInformation.Icon, "", new Rectangle(0, 0, 16, 16), 4f, new StardustCore.Animations.Animation(new Rectangle(0, 0, 16, 16)), StardustCore.IlluminateFramework.LightColorsList.Black, Color.White, new ButtonFunctionality(new DelegatePairing(displayMusicPack, new List + { + (object)v + } + ), null, new DelegatePairing(null, new List(){ (object)v + } + )), false)); } - )), false)); + numOfButtons++; if (numOfButtons > 8) { @@ -61,9 +76,13 @@ namespace StardewSymphonyRemastered.Framework.Menus if (v.containsPoint(x, y)) { var pair = (KeyValuePair)v.buttonFunctionality.hover.paramaters[0]; - v.hoverText = pair.Key; + v.hoverText = (string)pair.Key; v.onHover(); - StardewSymphony.ModMonitor.Log(pair.Key); + //StardewSymphony.ModMonitor.Log(pair.Key); + } + else + { + v.hoverText = ""; } } } diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/MusicPackMetaData.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/MusicPackMetaData.cs index 73f0966a..dbea8807 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/MusicPackMetaData.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/MusicPackMetaData.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework.Graphics; +using StardustCore.UIUtilities; using System; using System.Collections.Generic; using System.Linq; @@ -18,7 +19,7 @@ namespace StardewSymphonyRemastered.Framework public string description; public string versionInfo; public string pathToMusicPackIcon; - public Texture2D Icon; + public Texture2DExtended Icon; /// /// Constrctor /// @@ -35,7 +36,7 @@ namespace StardewSymphonyRemastered.Framework this.pathToMusicPackIcon = PathToMusicPackIcon; try { - this.Icon = StardewSymphony.ModHelper.Content.Load(this.pathToMusicPackIcon); + this.Icon = new Texture2DExtended(StardewSymphony.ModHelper, this.pathToMusicPackIcon); } catch(Exception err) { diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/WavMusicPack.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/WavMusicPack.cs index d9449ede..a1f665be 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/WavMusicPack.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/WavMusicPack.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; +using StardewValley; using System; using System.Collections.Generic; using System.IO; @@ -174,6 +175,14 @@ namespace StardewSymphonyRemastered.Framework dynamicSound.Play(); } + public override void playRandomSong() + { + Random r = Game1.random; + int value=r.Next(0, this.songInformation.listOfSongsWithoutTriggers.Count); + Song s = this.songInformation.listOfSongsWithoutTriggers.ElementAt(value); + this.swapSong(s.name); + } + /// /// Used to resume the currently playing song. /// diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs index d8e22620..de5e977e 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs @@ -131,7 +131,10 @@ namespace StardewSymphonyRemastered string path = Path.Combine(ModHelper.DirectoryPath, "Content", "Graphics", "MusicMenu"); if (!Directory.Exists(path)) Directory.CreateDirectory(path); string musicNote = Path.Combine(path, "MusicNote.png"); + string musicCD = Path.Combine(path, "MusicDisk.png"); textureManager.addTexture("MusicNote",new Texture2DExtended(ModHelper,StardustCore.Utilities.getRelativeDirectory("StardewSymphonyRemastered", musicNote))); + textureManager.addTexture("MusicDisk", new Texture2DExtended(ModHelper, StardustCore.Utilities.getRelativeDirectory("StardewSymphonyRemastered", musicCD))); + textureManager.addTexture("MusicCD", new Texture2DExtended(ModHelper, StardustCore.Utilities.getRelativeDirectory("StardewSymphonyRemastered", musicCD))); if (!Directory.Exists(MusicPath)) Directory.CreateDirectory(MusicPath); if (!Directory.Exists(WavMusicDirectory)) Directory.CreateDirectory(WavMusicDirectory); diff --git a/GeneralMods/StardustCore/IlluminateFramework/Colors.cs b/GeneralMods/StardustCore/IlluminateFramework/Colors.cs index d89f33b0..ae723710 100644 --- a/GeneralMods/StardustCore/IlluminateFramework/Colors.cs +++ b/GeneralMods/StardustCore/IlluminateFramework/Colors.cs @@ -313,6 +313,8 @@ namespace StardustCore.IlluminateFramework { public static Dictionary ColorDictionary; + public static Random colorRandomizer; + public static void initializeColors() { ColorDictionary = new Dictionary(); @@ -609,12 +611,19 @@ namespace StardustCore.IlluminateFramework } + /// + /// Generate a random color! Does not need to be inverted to be properly used. + /// + /// public static Color randomColor() { - Random r = new Random(Game1.player.money + Game1.tileSize + Game1.dayOfMonth+(int)Game1.stats.stepsTaken); - int R = r.Next(0, 255); - int G = r.Next(0, 255); - int B = r.Next(0, 255); + if (colorRandomizer == null) + { + colorRandomizer = new Random(Game1.player.money + Game1.tileSize + Game1.dayOfMonth + (int)Game1.stats.stepsTaken); + } + int R = colorRandomizer.Next(0, 255); + int G = colorRandomizer.Next(0, 255); + int B = colorRandomizer.Next(0, 255); int A = 255; return new Color(R, G, B, A); } diff --git a/GeneralMods/StardustCore/UIUtilities/MenuComponents/Button.cs b/GeneralMods/StardustCore/UIUtilities/MenuComponents/Button.cs index 29e2aa14..781d94d8 100644 --- a/GeneralMods/StardustCore/UIUtilities/MenuComponents/Button.cs +++ b/GeneralMods/StardustCore/UIUtilities/MenuComponents/Button.cs @@ -85,7 +85,7 @@ namespace StardustCore.UIUtilities.MenuComponents /// /// /// - public void draw(SpriteBatch b, float layerDepth) + public void draw(SpriteBatch b,Color color ,float layerDepth) { this.animationManager.tickAnimation(); @@ -108,12 +108,20 @@ namespace StardustCore.UIUtilities.MenuComponents } else { - StardustCore.ModCore.ModMonitor.Log("HOVER???"); - b.DrawString(Game1.smallFont, this.hoverText, 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); + //Game1.drawDialogueBox(Game1.getMousePosition().X, Game1.getMousePosition().Y, false, false, this.hoverText); + //StardustCore.ModCore.ModMonitor.Log("HOVER???"); + b.DrawString(Game1.smallFont, this.hoverText, new Vector2((float)(this.bounds.X + this.bounds.Width), (float)this.bounds.Y + ((float)(this.bounds.Height) - Game1.smallFont.MeasureString(this.label).Y / 2f)), this.textColor,0f,Vector2.Zero,1f,SpriteEffects.None,layerDepth-0.5f); } } + public new void draw(SpriteBatch b) + { + if (!this.visible) + return; + this.draw(b, Color.White, (float)(0.860000014305115 + (double)this.bounds.Y / 20000.0)); + } + /// /// Swaps if the button is visible or not. Also toggles the animation manager appropriately. ///