From 3af2da68fae217abed5efbe28ec85845789ccd27 Mon Sep 17 00:00:00 2001 From: Date: Mon, 6 Aug 2018 14:01:44 -0700 Subject: [PATCH] Tons of 1.3 updates. Also support for multiplayer custom objects in Stardust is slowly coming about! --- GeneralMods/HappyBirthday/HappyBirthday.cs | 12 ++- GeneralMods/HappyBirthday/manifest.json | 4 +- .../SaveAnywhere/API/SaveAnywhereAPI.cs | 15 ++- .../SaveAnywhere/Framework/SaveManager.cs | 15 ++- GeneralMods/SaveAnywhere/SaveAnywhere.cs | 8 +- GeneralMods/SaveAnywhere/manifest.json | 2 +- .../SimpleSoundManager/Framework/Sound.cs | 4 + .../Framework/SoundManager.cs | 102 ++++++++++++++++-- .../SimpleSoundManager/Framework/WavSound.cs | 19 ++-- .../SimpleSoundManager/Framework/XACTSound.cs | 14 +++ .../Framework/XactMusicPair.cs | 2 +- GeneralMods/SimpleSoundManager/manifest.json | 4 +- .../Framework/Menus/MusicManagerMenu.cs | 74 ++++++------- .../Framework/Music/MusicManager.cs | 1 + .../StardewSymphony.cs | 2 +- .../StardewSymphonyRemastered.csproj | 1 + GeneralMods/StardustCore/ModCore.cs | 9 +- .../StardustCore/NetCode/NetCoreObject.cs | 81 ++++++++++++++ .../NetCode/NetTexure2DExtended.cs | 69 ++++++++++++ .../StardustCore/Objects/CoreObject.cs | 16 ++- .../Objects/MultiTileComponent.cs | 17 +++ .../StardustCore/Objects/MultiTileObject.cs | 9 +- GeneralMods/StardustCore/StardustCore.csproj | 2 + GeneralMods/TimeFreeze/TimeFreeze.cs | 2 +- GeneralMods/TimeFreeze/manifest.json | 2 +- 25 files changed, 415 insertions(+), 71 deletions(-) create mode 100644 GeneralMods/StardustCore/NetCode/NetCoreObject.cs create mode 100644 GeneralMods/StardustCore/NetCode/NetTexure2DExtended.cs diff --git a/GeneralMods/HappyBirthday/HappyBirthday.cs b/GeneralMods/HappyBirthday/HappyBirthday.cs index b923fb56..28a5913f 100644 --- a/GeneralMods/HappyBirthday/HappyBirthday.cs +++ b/GeneralMods/HappyBirthday/HappyBirthday.cs @@ -189,7 +189,7 @@ namespace Omegasis.HappyBirthday { if (!Context.IsWorldReady || Game1.eventUp || Game1.isFestival()) return; - if (!this.HasChosenBirthday && Game1.activeClickableMenu == null) + if (!this.HasChosenBirthday && Game1.activeClickableMenu == null && Game1.player.Name.ToLower()!="unnamed farmhand") { Game1.activeClickableMenu = new BirthdayMenu(this.PlayerData.BirthdaySeason, this.PlayerData.BirthdayDay, this.SetBirthday); this.CheckedForBirthday = false; @@ -362,6 +362,16 @@ namespace Omegasis.HappyBirthday Random rnd2 = new Random(); int r2 = rnd2.Next(this.PossibleBirthdayGifts.Count); gift = this.PossibleBirthdayGifts.ElementAt(r2); + //Attempt to balance sapplings from being too OP as a birthday gift. + if (gift.Name.Contains("Sapling")) + { + gift.Stack = 1; //A good investment? + } + if(gift.Name.Contains("Rare Seed")) + { + gift.Stack = 2; //Still a little op but less so than 5. + } + if (Game1.player.isInventoryFull()) Game1.createItemDebris(gift, Game1.player.getStandingPosition(), Game1.player.getDirection()); else diff --git a/GeneralMods/HappyBirthday/manifest.json b/GeneralMods/HappyBirthday/manifest.json index bf199687..6a5a2101 100644 --- a/GeneralMods/HappyBirthday/manifest.json +++ b/GeneralMods/HappyBirthday/manifest.json @@ -3,8 +3,8 @@ "Author": "Alpha_Omegasis", "Version": { "MajorVersion": 1, - "MinorVersion": 6, - "PatchVersion": 0, + "MinorVersion": 7, + "PatchVersion": 1, "Build": null }, "MinimumApiVersion": "1.15", diff --git a/GeneralMods/SaveAnywhere/API/SaveAnywhereAPI.cs b/GeneralMods/SaveAnywhere/API/SaveAnywhereAPI.cs index ec34bb97..36aab4f2 100644 --- a/GeneralMods/SaveAnywhere/API/SaveAnywhereAPI.cs +++ b/GeneralMods/SaveAnywhere/API/SaveAnywhereAPI.cs @@ -9,11 +9,24 @@ namespace Omegasis.SaveAnywhere.API public event EventHandler AfterSave; public event EventHandler AfterLoad; + public SaveAnywhereAPI(SaveManager manager) { + BeforeSave = new EventHandler(empty); + AfterSave= new EventHandler(empty); + AfterLoad= new EventHandler(empty); manager.BeforeSave += (sender, e) => { BeforeSave.Invoke(sender, e); }; manager.AfterSave += (sender, e) => { AfterSave.Invoke(sender, e); }; manager.AfterLoad += (sender, e) => { AfterLoad.Invoke(sender, e); }; - } + } + + /// + /// Used to initialize empty event handlers. + /// + /// + /// + private void empty(object o, EventArgs args){ + + } } } diff --git a/GeneralMods/SaveAnywhere/Framework/SaveManager.cs b/GeneralMods/SaveAnywhere/Framework/SaveManager.cs index fc1a1ef4..3be29bc0 100644 --- a/GeneralMods/SaveAnywhere/Framework/SaveManager.cs +++ b/GeneralMods/SaveAnywhere/Framework/SaveManager.cs @@ -63,6 +63,16 @@ namespace Omegasis.SaveAnywhere.Framework this.Helper = helper; this.Reflection = reflection; this.OnLoaded = onLoaded; + + this.BeforeSave = new EventHandler(empty); + this.AfterSave = new EventHandler(empty); + this.AfterLoad = new EventHandler(empty); + + } + + private void empty(object o, EventArgs args) + { + } /// Perform any required update logic. @@ -87,8 +97,8 @@ namespace Omegasis.SaveAnywhere.Framework { currentSaveMenu.SaveComplete -= CurrentSaveMenu_SaveComplete; currentSaveMenu = null; - AfterSave.Invoke(this, EventArgs.Empty); + } /// Clear saved data. @@ -103,7 +113,7 @@ namespace Omegasis.SaveAnywhere.Framework { // Fire Event before saving data BeforeSave.Invoke(this, EventArgs.Empty); - + // save game data Farm farm = Game1.getFarm(); if (farm.shippingBin.Any()) @@ -155,6 +165,7 @@ namespace Omegasis.SaveAnywhere.Framework // Notify other mods that load is complete AfterLoad.Invoke(this, EventArgs.Empty); + } /// diff --git a/GeneralMods/SaveAnywhere/SaveAnywhere.cs b/GeneralMods/SaveAnywhere/SaveAnywhere.cs index 08463a61..e3a96d92 100644 --- a/GeneralMods/SaveAnywhere/SaveAnywhere.cs +++ b/GeneralMods/SaveAnywhere/SaveAnywhere.cs @@ -79,10 +79,12 @@ namespace Omegasis.SaveAnywhere return api; } + /*Notes. Mods that want to support save anywhere will get the api for Save anywhere and then add their clean up code to the events that happen for Before/After Save and Loading. + Example with pseudo code. + SaveAnywhere.api.BeforeSave+=StardustCore.Objects.CleanUpBeforeSave; + We then can use function wrapping (is that what it's called?) to just handle calling the actual function that deals with clean-up code. - - - + */ /********* ** Private methods *********/ diff --git a/GeneralMods/SaveAnywhere/manifest.json b/GeneralMods/SaveAnywhere/manifest.json index d53330f2..326d1e30 100644 --- a/GeneralMods/SaveAnywhere/manifest.json +++ b/GeneralMods/SaveAnywhere/manifest.json @@ -1,7 +1,7 @@ { "Name": "Save Anywhere", "Author": "Alpha_Omegasis", - "Version": "2.7.2", + "Version": "2.8.1", "Description": "Lets you save almost anywhere.", "UniqueID": "Omegasis.SaveAnywhere", "EntryDll": "SaveAnywhere.dll", diff --git a/GeneralMods/SimpleSoundManager/Framework/Sound.cs b/GeneralMods/SimpleSoundManager/Framework/Sound.cs index 7524e046..03fa9081 100644 --- a/GeneralMods/SimpleSoundManager/Framework/Sound.cs +++ b/GeneralMods/SimpleSoundManager/Framework/Sound.cs @@ -32,5 +32,9 @@ namespace SimpleSoundManager.Framework /// /// Sound clone(); + + string getSoundName(); + + bool isStopped(); } } diff --git a/GeneralMods/SimpleSoundManager/Framework/SoundManager.cs b/GeneralMods/SimpleSoundManager/Framework/SoundManager.cs index 8fd53482..3eb34171 100644 --- a/GeneralMods/SimpleSoundManager/Framework/SoundManager.cs +++ b/GeneralMods/SimpleSoundManager/Framework/SoundManager.cs @@ -9,18 +9,14 @@ using System.Threading.Tasks; namespace SimpleSoundManager.Framework { - - /// - /// TODO: - /// Play, stop, pause songs. - /// - class SoundManager + public class SoundManager { public Dictionary sounds; public Dictionary musicBanks; + public List currentlyPlayingSounds = new List(); /// /// Constructor for this class. /// @@ -28,6 +24,7 @@ namespace SimpleSoundManager.Framework { this.sounds = new Dictionary(); this.musicBanks = new Dictionary(); + currentlyPlayingSounds = new List(); } /// @@ -37,7 +34,7 @@ namespace SimpleSoundManager.Framework /// public void loadWavFile(string soundName,string pathToWav) { - WavSound wav = new WavSound(pathToWav); + WavSound wav = new WavSound(soundName,pathToWav); this.sounds.Add(soundName,wav); } @@ -49,7 +46,7 @@ namespace SimpleSoundManager.Framework /// public void loadWavFile(IModHelper helper,string soundName,string pathToWav) { - WavSound wav = new WavSound(helper ,pathToWav); + WavSound wav = new WavSound(helper ,soundName,pathToWav); this.sounds.Add(soundName,wav); } @@ -61,7 +58,7 @@ namespace SimpleSoundManager.Framework /// public void loadWavFile(IModHelper helper,string songName,List pathToWav) { - WavSound wav = new WavSound(helper,pathToWav); + WavSound wav = new WavSound(helper,songName,pathToWav); this.sounds.Add(songName,wav); } @@ -133,5 +130,92 @@ namespace SimpleSoundManager.Framework return null; } + /// + /// Play the sound with the given name. + /// + /// + public void playSound(string soundName) + { + foreach(var sound in this.sounds) + { + if (sound.Key == soundName) + { + var s=getSoundClone(soundName); + s.play(); + this.currentlyPlayingSounds.Add(s); + break; + } + } + } + + /// + /// Stop the sound that is playing. + /// + /// + public void stopSound(string soundName) + { + List removalList = new List(); + foreach (var sound in this.currentlyPlayingSounds) + { + if (sound.getSoundName() == soundName) + { + sound.stop(); + removalList.Add(sound); + } + } + foreach(var v in removalList) + { + this.currentlyPlayingSounds.Remove(v); + } + } + + /// + /// Pause the sound with this name? + /// + /// + public void pauseSound(string soundName) + { + List removalList = new List(); + foreach (var sound in this.currentlyPlayingSounds) + { + if (sound.getSoundName() == soundName) + { + sound.pause(); + removalList.Add(sound); + } + } + foreach (var v in removalList) + { + this.currentlyPlayingSounds.Remove(v); + } + } + + public void update() + { + List removalList = new List(); + foreach(Sound song in this.currentlyPlayingSounds) + { + if (song.isStopped()) + { + removalList.Add(song); + } + } + foreach(var v in removalList) + { + this.currentlyPlayingSounds.Remove(v); + } + } + + public void stopAllSounds() + { + foreach(var v in this.currentlyPlayingSounds) + { + v.stop(); + } + } + + + + } } diff --git a/GeneralMods/SimpleSoundManager/Framework/WavSound.cs b/GeneralMods/SimpleSoundManager/Framework/WavSound.cs index 2a2114d6..7478b5da 100644 --- a/GeneralMods/SimpleSoundManager/Framework/WavSound.cs +++ b/GeneralMods/SimpleSoundManager/Framework/WavSound.cs @@ -31,20 +31,20 @@ namespace SimpleSoundManager /// byte[] byteArray; - public List sounds; public string path; - + public string soundName; /// /// Get a raw disk path to the wav file. /// /// - public WavSound(string pathToWavFile) + public WavSound(string name,string pathToWavFile) { this.path = pathToWavFile; LoadWavFromFileToStream(); + this.soundName = name; } /// @@ -52,10 +52,11 @@ namespace SimpleSoundManager /// /// /// - public WavSound(IModHelper modHelper, string pathInModDirectory) + public WavSound(IModHelper modHelper,string name, string pathInModDirectory) { string path = Path.Combine(modHelper.DirectoryPath, pathInModDirectory); this.path = path; + this.soundName = name; } /// @@ -63,7 +64,7 @@ namespace SimpleSoundManager /// /// The mod helper for the mod you wish to use to load the music files from. /// The list of folders and files that make up a complete path. - public WavSound(IModHelper modHelper, List pathPieces) + public WavSound(IModHelper modHelper,string soundName, List pathPieces) { string s = modHelper.DirectoryPath; foreach(var str in pathPieces) @@ -71,6 +72,7 @@ namespace SimpleSoundManager s = Path.Combine(s, str); } this.path = s; + this.soundName = soundName; } /// @@ -224,7 +226,12 @@ namespace SimpleSoundManager public Sound clone() { - return new WavSound(this.path); + return new WavSound(this.getSoundName(),this.path); + } + + public string getSoundName() + { + return this.soundName; } public void restart() diff --git a/GeneralMods/SimpleSoundManager/Framework/XACTSound.cs b/GeneralMods/SimpleSoundManager/Framework/XACTSound.cs index 196d34d2..47f6c8f6 100644 --- a/GeneralMods/SimpleSoundManager/Framework/XACTSound.cs +++ b/GeneralMods/SimpleSoundManager/Framework/XACTSound.cs @@ -130,5 +130,19 @@ namespace SimpleSoundManager.Framework { return new XACTSound(this.waveBank, this.soundBank, this.soundName); } + + public string getSoundName() + { + return this.soundName; + } + + public bool isStopped() + { + if (this.song == null) return true; + if (this.song.IsStopped) return true; + return false; + } + + } } diff --git a/GeneralMods/SimpleSoundManager/Framework/XactMusicPair.cs b/GeneralMods/SimpleSoundManager/Framework/XactMusicPair.cs index 999a34af..fe3a77c2 100644 --- a/GeneralMods/SimpleSoundManager/Framework/XactMusicPair.cs +++ b/GeneralMods/SimpleSoundManager/Framework/XactMusicPair.cs @@ -10,7 +10,7 @@ using System.Threading.Tasks; namespace SimpleSoundManager { - class XACTMusicPair + public class XACTMusicPair { public WaveBank waveBank; public ISoundBank soundBank; diff --git a/GeneralMods/SimpleSoundManager/manifest.json b/GeneralMods/SimpleSoundManager/manifest.json index 9f93e023..e5e92fab 100644 --- a/GeneralMods/SimpleSoundManager/manifest.json +++ b/GeneralMods/SimpleSoundManager/manifest.json @@ -1,8 +1,8 @@ { "Name": "Simple Sound Manager", "Author": "Alpha_Omegasis", - "Version": "2.0.0", - "Description": "A simple framework to play sounds from wave banks.", + "Version": "2.0.1", + "Description": "A simple framework to play sounds from wave banks and wav files.", "UniqueID": "Omegasis.SimpleSoundManager", "EntryDll": "SimpleSoundManager.dll", "MinimumApiVersion": "2.0", diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs index aa5e8439..dc433087 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Menus/MusicManagerMenu.cs @@ -112,7 +112,7 @@ namespace StardewSymphonyRemastered.Framework.Menus if (v.Value.musicPackInformation.getTexture() == null) { Texture2DExtended texture = StardewSymphony.textureManager.getTexture("MusicDisk"); - float scale = 1.00f / ((float)texture.texture.Width / 64f); + float scale = 1.00f / ((float)texture.getTexture().Width / 64f); this.musicAlbumButtons.Add(new Button(v.Key, new Rectangle(100 + (numOfButtons * 100), 125 + (rows * 100), 64, 64),texture, "", new Rectangle(0, 0, 16, 16), scale, new StardustCore.Animations.Animation(new Rectangle(0, 0, 16, 16)), StardustCore.IlluminateFramework.Colors.randomColor(), Color.White,new ButtonFunctionality(new DelegatePairing(null, new List { @@ -125,8 +125,8 @@ namespace StardewSymphonyRemastered.Framework.Menus } else { - float scale = 1.00f / ((float)v.Value.musicPackInformation.getTexture().texture.Width / 64f); - this.musicAlbumButtons.Add(new Button(v.Key, new Rectangle(100 + (numOfButtons * 100), 125 + (rows * 100), 64, 64), v.Value.musicPackInformation.getTexture(), "", new Rectangle(0, 0, v.Value.musicPackInformation.getTexture().texture.Width, v.Value.musicPackInformation.getTexture().texture.Height), scale, new StardustCore.Animations.Animation(new Rectangle(0, 0, 16, 16)), StardustCore.IlluminateFramework.LightColorsList.Black, StardustCore.IlluminateFramework.LightColorsList.Black, new ButtonFunctionality(new DelegatePairing(null, new List + float scale = 1.00f / ((float)v.Value.musicPackInformation.getTexture().getTexture().Width / 64f); + this.musicAlbumButtons.Add(new Button(v.Key, new Rectangle(100 + (numOfButtons * 100), 125 + (rows * 100), 64, 64), v.Value.musicPackInformation.getTexture(), "", new Rectangle(0, 0, v.Value.musicPackInformation.getTexture().getTexture().Width, v.Value.musicPackInformation.getTexture().getTexture().Height), scale, new StardustCore.Animations.Animation(new Rectangle(0, 0, 16, 16)), StardustCore.IlluminateFramework.LightColorsList.Black, StardustCore.IlluminateFramework.LightColorsList.Black, new ButtonFunctionality(new DelegatePairing(null, new List { (object)v } @@ -452,9 +452,9 @@ namespace StardewSymphonyRemastered.Framework.Menus //Allow 8 songs to be displayed per page. Texture2DExtended texture = StardewSymphony.textureManager.getTexture("MusicNote"); - float scale = 1.00f / ((float)texture.texture.Width / 64f); + float scale = 1.00f / ((float)texture.getTexture().Width / 64f); Song s = musicPackSongList.ElementAt(i); - Rectangle srcRect = new Rectangle(0, 0, texture.texture.Width, texture.texture.Height); + Rectangle srcRect = new Rectangle(0, 0, texture.getTexture().Width, texture.getTexture().Height); this.fancyButtons.Add(new Button(s.name, new Rectangle((int)placement2.X+25, (int)placement2.Y + ((i%6) * 100)+100, 64, 64), texture, s.name, srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } @@ -472,8 +472,8 @@ namespace StardewSymphonyRemastered.Framework.Menus //Allow 8 songs to be displayed per page. Texture2DExtended texture = StardewSymphony.textureManager.getTexture("GreenBallon"); - float scale = 1.00f / ((float)texture.texture.Height / 64f); - Rectangle srcRect = new Rectangle(0, 0, texture.texture.Width, texture.texture.Height); + float scale = 1.00f / ((float)texture.getTexture().Height / 64f); + Rectangle srcRect = new Rectangle(0, 0, texture.getTexture().Width, texture.getTexture().Height); this.fancyButtons.Add(new Button(SongSpecifics.festivals.ElementAt(i), new Rectangle((int)placement2.X + 50, (int)placement2.Y + ((i % 6) * 100) + 100, 64, 64), texture, SongSpecifics.festivals.ElementAt(i), srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } @@ -493,8 +493,8 @@ namespace StardewSymphonyRemastered.Framework.Menus //Allow 8 songs to be displayed per page. Texture2DExtended texture = StardewSymphony.textureManager.getTexture("MenuIcon"); - float scale = 1.00f / ((float)texture.texture.Width / 64f); - Rectangle srcRect = new Rectangle(0, 0, texture.texture.Width, texture.texture.Height); + float scale = 1.00f / ((float)texture.getTexture().Width / 64f); + Rectangle srcRect = new Rectangle(0, 0, texture.getTexture().Width, texture.getTexture().Height); this.fancyButtons.Add(new Button(SongSpecifics.menus.ElementAt(i), new Rectangle((int)placement2.X + 50, (int)placement2.Y + ((i % 6) * 100) + 100, 64, 64), texture, SongSpecifics.menus.ElementAt(i), srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } @@ -512,8 +512,8 @@ namespace StardewSymphonyRemastered.Framework.Menus //Allow 8 songs to be displayed per page. Texture2DExtended texture = StardewSymphony.textureManager.getTexture("StarIcon"); - float scale = 1.00f / ((float)texture.texture.Width / 64f); - Rectangle srcRect = new Rectangle(0, 0, texture.texture.Width, texture.texture.Height); + float scale = 1.00f / ((float)texture.getTexture().Width / 64f); + Rectangle srcRect = new Rectangle(0, 0, texture.getTexture().Width, texture.getTexture().Height); this.fancyButtons.Add(new Button(SongSpecifics.events.ElementAt(i), new Rectangle((int)placement2.X + 50, (int)placement2.Y + ((i % 6) * 100) + 100, 64, 64), texture, SongSpecifics.events.ElementAt(i), srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } @@ -538,8 +538,8 @@ namespace StardewSymphonyRemastered.Framework.Menus StardewSymphony.ModMonitor.Log("SPRING TEXTURE NULL!"); return; } - float scale = 1.00f / ((float)springTexture.texture.Width / 64f); - Rectangle srcRect = new Rectangle(0, 0, springTexture.texture.Width, springTexture.texture.Height); + float scale = 1.00f / ((float)springTexture.getTexture().Width / 64f); + Rectangle srcRect = new Rectangle(0, 0, springTexture.getTexture().Width, springTexture.getTexture().Height); this.fancyButtons.Add(new Button("SeasonIcon", new Rectangle((int)seasonPlacement.X, (int)seasonPlacement.Y, 64, 64), springTexture, "Spring Music", srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } if (Game1.currentSeason == "summer") @@ -552,8 +552,8 @@ namespace StardewSymphonyRemastered.Framework.Menus StardewSymphony.ModMonitor.Log("SUMMER TEXTURE NULL!"); return; } - float scale = 1.00f / ((float)summerTexture.texture.Width / 64f); - Rectangle srcRect = new Rectangle(0, 0, summerTexture.texture.Width, summerTexture.texture.Height); + float scale = 1.00f / ((float)summerTexture.getTexture().Width / 64f); + Rectangle srcRect = new Rectangle(0, 0, summerTexture.getTexture().Width, summerTexture.getTexture().Height); this.fancyButtons.Add(new Button("SeasonIcon", new Rectangle((int)seasonPlacement.X, (int)seasonPlacement.Y, 64, 64), summerTexture, "Summer Music", srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } if (Game1.currentSeason == "fall") @@ -566,8 +566,8 @@ namespace StardewSymphonyRemastered.Framework.Menus StardewSymphony.ModMonitor.Log("FALL TEXTURE NULL!"); return; } - float scale = 1.00f / ((float)fallTexture.texture.Width / 64f); - Rectangle srcRect = new Rectangle(0, 0, fallTexture.texture.Width, fallTexture.texture.Height); + float scale = 1.00f / ((float)fallTexture.getTexture().Width / 64f); + Rectangle srcRect = new Rectangle(0, 0, fallTexture.getTexture().Width, fallTexture.getTexture().Height); this.fancyButtons.Add(new Button("SeasonIcon", new Rectangle((int)seasonPlacement.X, (int)seasonPlacement.Y, 64, 64), fallTexture, "Fall Music", srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } if (Game1.currentSeason == "winter") @@ -580,8 +580,8 @@ namespace StardewSymphonyRemastered.Framework.Menus StardewSymphony.ModMonitor.Log("WINTER TEXTURE NULL!"); return; } - float scale = 1.00f / ((float)winterTexture.texture.Width / 64f); - Rectangle srcRect = new Rectangle(0, 0, winterTexture.texture.Width, winterTexture.texture.Height); + float scale = 1.00f / ((float)winterTexture.getTexture().Width / 64f); + Rectangle srcRect = new Rectangle(0, 0, winterTexture.getTexture().Width, winterTexture.getTexture().Height); this.fancyButtons.Add(new Button("SeasonIcon", new Rectangle((int)seasonPlacement.X, (int)seasonPlacement.Y, 64, 64), winterTexture, "Winter Music", srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } @@ -591,8 +591,8 @@ namespace StardewSymphonyRemastered.Framework.Menus //Festival Icon placement. Texture2DExtended festivalTexture = StardewSymphony.textureManager.getTexture("FestivalIcon"); - float festivalScale = 1.00f / ((float)festivalTexture.texture.Width / 64f); - Rectangle festivalSrcRect = new Rectangle(0, 0, festivalTexture.texture.Width, festivalTexture.texture.Height); + float festivalScale = 1.00f / ((float)festivalTexture.getTexture().Width / 64f); + Rectangle festivalSrcRect = new Rectangle(0, 0, festivalTexture.getTexture().Width, festivalTexture.getTexture().Height); this.fancyButtons.Add(new Button("FestivalIcon", new Rectangle((int)festivalPlacement.X, (int)festivalPlacement.Y, 64, 64), festivalTexture, "Festival Music", festivalSrcRect, festivalScale, new Animation(festivalSrcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); if (festivalTexture == null) { @@ -603,8 +603,8 @@ namespace StardewSymphonyRemastered.Framework.Menus //Event Icon placement. Texture2DExtended eventTexture = StardewSymphony.textureManager.getTexture("EventIcon"); - float eventScale = 1.00f / ((float)eventTexture.texture.Width / 64f); - Rectangle eventSrcRectangle = new Rectangle(0, 0, eventTexture.texture.Width, eventTexture.texture.Height); + float eventScale = 1.00f / ((float)eventTexture.getTexture().Width / 64f); + Rectangle eventSrcRectangle = new Rectangle(0, 0, eventTexture.getTexture().Width, eventTexture.getTexture().Height); this.fancyButtons.Add(new Button("EventIcon", new Rectangle((int)eventPlacement.X, (int)eventPlacement.Y, 64, 64), eventTexture, "Event Music", eventSrcRectangle, eventScale, new Animation(eventSrcRectangle), Color.White, Color.White, new ButtonFunctionality(null, null, null))); if (eventTexture == null) @@ -616,8 +616,8 @@ namespace StardewSymphonyRemastered.Framework.Menus //Menu Icon placement. Texture2DExtended menuTexture = StardewSymphony.textureManager.getTexture("MenuIcon"); - float menuScale = 1.00f / ((float)menuTexture.texture.Width / 64f); - Rectangle menuSrcRectangle = new Rectangle(0, 0, menuTexture.texture.Width, menuTexture.texture.Height); + float menuScale = 1.00f / ((float)menuTexture.getTexture().Width / 64f); + Rectangle menuSrcRectangle = new Rectangle(0, 0, menuTexture.getTexture().Width, menuTexture.getTexture().Height); this.fancyButtons.Add(new Button("MenuIcon", new Rectangle((int)menuPlacement.X, (int)menuPlacement.Y, 64, 64), menuTexture, "Menu Music", menuSrcRectangle, menuScale, new Animation(menuSrcRectangle), Color.White, Color.White, new ButtonFunctionality(null, null, null))); if (menuTexture == null) @@ -705,8 +705,8 @@ namespace StardewSymphonyRemastered.Framework.Menus display = "Wedding Music"; } - float scale = 1.00f / ((float)texture.texture.Width / 64f); - Rectangle srcRect = new Rectangle(0, 0, texture.texture.Width, texture.texture.Height); + float scale = 1.00f / ((float)texture.getTexture().Width / 64f); + Rectangle srcRect = new Rectangle(0, 0, texture.getTexture().Width, texture.getTexture().Height); this.fancyButtons.Add(new Button(name, new Rectangle((int)placement2.X + 50, (int)placement2.Y + ((i % 7) * 100), 64, 64), texture, display, srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } @@ -742,8 +742,8 @@ namespace StardewSymphonyRemastered.Framework.Menus { StardewSymphony.ModMonitor.Log("HMM A TEXTURE IS NULL: " + i.ToString()); } - float scale = 1.00f / ((float)texture.texture.Width / 64f); - Rectangle srcRect = new Rectangle(0, 0, texture.texture.Width, texture.texture.Height); + float scale = 1.00f / ((float)texture.getTexture().Width / 64f); + Rectangle srcRect = new Rectangle(0, 0, texture.getTexture().Width, texture.getTexture().Height); this.fancyButtons.Add(new Button(name, new Rectangle((int)placement2.X + 50, (int)placement2.Y + ((i % 7) * 100), 64, 64), texture, display, srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } @@ -777,8 +777,8 @@ namespace StardewSymphonyRemastered.Framework.Menus numOfEmptyCabin++; } Texture2DExtended texture2 = StardewSymphony.textureManager.getTexture("HouseIcon"); - float scale2 = 1.00f / ((float)texture2.texture.Width / 64f); - Rectangle srcRect2 = new Rectangle(0, 0, texture2.texture.Width, texture2.texture.Height); + float scale2 = 1.00f / ((float)texture2.getTexture().Width / 64f); + Rectangle srcRect2 = new Rectangle(0, 0, texture2.getTexture().Width, texture2.getTexture().Height); this.fancyButtons.Add(new Button(locName, new Rectangle((int)placement2.X + 25, (int)placement2.Y + ((i % 6) * 100) + 100, 64, 64), texture2, displayName, srcRect2, scale2, new Animation(srcRect2), Color.White, Color.White, new ButtonFunctionality(null, null, null))); continue; } @@ -787,8 +787,8 @@ namespace StardewSymphonyRemastered.Framework.Menus string displayName = "Empty Cabin "+(numOfEmptyCabin); numOfEmptyCabin++; Texture2DExtended texture2 = StardewSymphony.textureManager.getTexture("HouseIcon"); - float scale2 = 1.00f / ((float)texture2.texture.Width / 64f); - Rectangle srcRect2 = new Rectangle(0, 0, texture2.texture.Width, texture2.texture.Height); + float scale2 = 1.00f / ((float)texture2.getTexture().Width / 64f); + Rectangle srcRect2 = new Rectangle(0, 0, texture2.getTexture().Width, texture2.getTexture().Height); this.fancyButtons.Add(new Button(locName, new Rectangle((int)placement2.X + 25, (int)placement2.Y + ((i % 6) * 100) + 100, 64, 64), texture2, displayName, srcRect2, scale2, new Animation(srcRect2), Color.White, Color.White, new ButtonFunctionality(null, null, null))); continue; } @@ -802,8 +802,8 @@ namespace StardewSymphonyRemastered.Framework.Menus //Allow 8 songs to be displayed per page. Texture2DExtended texture = StardewSymphony.textureManager.getTexture("HouseIcon"); - float scale = 1.00f / ((float)texture.texture.Width / 64f); - Rectangle srcRect = new Rectangle(0, 0, texture.texture.Width, texture.texture.Height); + float scale = 1.00f / ((float)texture.getTexture().Width / 64f); + Rectangle srcRect = new Rectangle(0, 0, texture.getTexture().Width, texture.getTexture().Height); this.fancyButtons.Add(new Button(locName, new Rectangle((int)placement2.X + 25, (int)placement2.Y + ((i % 6) * 100) + 100, 64, 64), texture, locName, srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } @@ -866,8 +866,8 @@ namespace StardewSymphonyRemastered.Framework.Menus display = "Saturday Music"; } - float scale = 1.00f / ((float)texture.texture.Width / 64f); - Rectangle srcRect = new Rectangle(0, 0, texture.texture.Width, texture.texture.Height); + float scale = 1.00f / ((float)texture.getTexture().Width / 64f); + Rectangle srcRect = new Rectangle(0, 0, texture.getTexture().Width, texture.getTexture().Height); this.fancyButtons.Add(new Button(name, new Rectangle((int)placement2.X + 50, (int)placement2.Y + ((i % 7) * 100), 64, 64), texture, display, srcRect, scale, new Animation(srcRect), Color.White, Color.White, new ButtonFunctionality(null, null, null))); } diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/MusicManager.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/MusicManager.cs index 3cfab832..0c7d6cfe 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/MusicManager.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/Music/MusicManager.cs @@ -67,6 +67,7 @@ namespace StardewSymphonyRemastered.Framework public void updateTimer() { + if (this.currentMusicPack == null) return; if (this.currentMusicPack.isPlaying()) return; else { diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs index af54fc60..b97d366d 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs @@ -216,7 +216,7 @@ namespace StardewSymphonyRemastered /// private void ControlEvents_KeyPressed(object sender, StardewModdingAPI.Events.EventArgsKeyPressed e) { - if (e.KeyPressed.ToString() == Config.KeyBinding) + if (e.KeyPressed.ToString() == Config.KeyBinding && Game1.activeClickableMenu==null) { Game1.activeClickableMenu = new Framework.Menus.MusicManagerMenu(Game1.viewport.Width,Game1.viewport.Height); } diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj index 69ded58c..26d3a58d 100644 --- a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj @@ -240,6 +240,7 @@ + diff --git a/GeneralMods/StardustCore/ModCore.cs b/GeneralMods/StardustCore/ModCore.cs index fe44a221..babdddac 100644 --- a/GeneralMods/StardustCore/ModCore.cs +++ b/GeneralMods/StardustCore/ModCore.cs @@ -61,6 +61,7 @@ namespace StardustCore { SerializationManager.restoreAllModObjects(SerializationManager.trackedObjectList); List> objs = new List>(); + /* MultiTileComponent tile1 = new MultiTileComponent(0,"Tileobj1","A basic tile obj",new Texture2DExtended(ModCore.ModHelper, Path.Combine("Content", "Graphics", "MultiTest", "Test1.png"))); MultiTileComponent tile2 = new MultiTileComponent(0,"Tileobj2", "A basic tile obj", new Texture2DExtended(ModCore.ModHelper, Path.Combine("Content", "Graphics", "MultiTest", "Test2.png"))); MultiTileComponent tile3 = new MultiTileComponent(0,"Tileobj3", "A basic tile obj", new Texture2DExtended(ModCore.ModHelper, Path.Combine("Content", "Graphics", "MultiTest", "Test3.png"))); @@ -69,8 +70,14 @@ namespace StardustCore objs.Add(new KeyValuePair(new Vector2(2, 0), tile3)); MultiTileObject collection= new MultiTileObject("MultiTest", "Trying to get multi object testing working", Vector2.Zero, new Texture2DExtended(ModCore.ModHelper, Path.Combine("Content", "Graphics", "MultiTest", "Test3.png")), objs, StardustCore.IlluminateFramework.Colors.invertColor(StardustCore.IlluminateFramework.LightColorsList.Purple), "MultiTest"); + */ - Game1.player.addItemToInventory(collection); + // Game1.player.addItemToInventory(collection); + CoreObject tile1 = new CoreObject(new Texture2DExtended(ModCore.ModHelper, Path.Combine("Content", "Graphics", "MultiTest", "Test1.png")),0, Vector2.Zero,9); + tile1.description = "Hello"; + tile1.Name = "test"; + tile1.displayName = "test"; + Game1.player.addItemToInventory(tile1); } private void SaveEvents_AfterSave(object sender, EventArgs e) diff --git a/GeneralMods/StardustCore/NetCode/NetCoreObject.cs b/GeneralMods/StardustCore/NetCode/NetCoreObject.cs new file mode 100644 index 00000000..80e19a9c --- /dev/null +++ b/GeneralMods/StardustCore/NetCode/NetCoreObject.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.Serialization.Formatters.Binary; +using System.Text; +using System.Threading.Tasks; +using Netcode; +using StardustCore.UIUtilities; + +namespace StardustCore.NetCode +{ + class NetCoreObject : Netcode.NetField + { + + public NetTexture2DExtended texture; + public NetInt which; + public NetVector2 tilePos; + public NetInt InventoryMaxSize; + public NetRectangle sourceRect; + public NetRectangle boundingBox; + + public NetCoreObject() + { + + } + + public NetCoreObject(CoreObject value) : base(value) + { + } + + + protected override void ReadDelta(BinaryReader reader, NetVersion version) + { + texture = new NetTexture2DExtended(); + texture.Read(reader, version); + Value.setExtendedTexture(texture.Value); + + which = new NetInt(); + which.Read(reader, version); + Value.ParentSheetIndex = which.Value; + + tilePos = new NetVector2(); + tilePos.Read(reader, version); + Value.TileLocation = tilePos.Value; + + InventoryMaxSize = new NetInt(); + InventoryMaxSize.Read(reader, version); + Value.inventoryMaxSize = InventoryMaxSize.Value; + + sourceRect = new NetRectangle(); + sourceRect.Read(reader, version); + Value.sourceRect = sourceRect.Value; + + boundingBox = new NetRectangle(); + boundingBox.Read(reader, version); + Value.boundingBox.Value = boundingBox.Value; + } + + protected override void WriteDelta(BinaryWriter writer) + { + texture = new NetTexture2DExtended(Value.getExtendedTexture()); + texture.Write(writer); + + which = new NetInt(Value.ParentSheetIndex); + which.Write(writer); + + tilePos = new NetVector2(Value.TileLocation); + tilePos.Write(writer); + + InventoryMaxSize = new NetInt(Value.inventoryMaxSize); + InventoryMaxSize.Write(writer); + + sourceRect = new NetRectangle(Value.sourceRect); + sourceRect.Write(writer); + + boundingBox = new NetRectangle(Value.boundingBox.Value); + sourceRect.Write(writer); + } + } +} diff --git a/GeneralMods/StardustCore/NetCode/NetTexure2DExtended.cs b/GeneralMods/StardustCore/NetCode/NetTexure2DExtended.cs new file mode 100644 index 00000000..20cdba49 --- /dev/null +++ b/GeneralMods/StardustCore/NetCode/NetTexure2DExtended.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Netcode; +using StardewValley; +using StardustCore.UIUtilities; + +namespace StardustCore.NetCode +{ + public class NetTexture2DExtended : Netcode.NetField + { + + public string Name; + public Texture2D texture; + public string path; + public int width; + public int height; + + + public NetTexture2DExtended() + { + + } + + public NetTexture2DExtended(Texture2DExtended value) : base(value) + { + } + + protected override void ReadDelta(BinaryReader reader, NetVersion version) + { + int width = reader.ReadInt32(); + int height = reader.ReadInt32(); + Byte[] colorsOne = new byte[width*height*4]; + colorsOne = reader.ReadBytes(width*height*4); + texture = new Texture2D(Game1.graphics.GraphicsDevice,width,height); + texture.SetData(colorsOne); + + string Name = reader.ReadString(); + string path = reader.ReadString(); + + if (version.IsPriorityOver(this.ChangeVersion)) + { + this.CleanSet(new UIUtilities.Texture2DExtended(ModCore.ModHelper, path),true); + } + } + + protected override void WriteDelta(BinaryWriter writer) + { + + int size = base.Value.getTexture().Width * base.Value.getTexture().Height * 4; + writer.Write(base.Value.getTexture().Width); + writer.Write(base.Value.getTexture().Height); + //writer.Write(size); + texture = Value.getTexture(); + Byte[] colorsOne = new byte[size]; //The hard to read,1D array + texture.GetData(colorsOne); + writer.Write(colorsOne); + writer.Write(base.Value.Name); + writer.Write(base.Value.path); + } + + + } +} diff --git a/GeneralMods/StardustCore/Objects/CoreObject.cs b/GeneralMods/StardustCore/Objects/CoreObject.cs index c6ed6a00..feaadf7a 100644 --- a/GeneralMods/StardustCore/Objects/CoreObject.cs +++ b/GeneralMods/StardustCore/Objects/CoreObject.cs @@ -103,17 +103,21 @@ namespace StardustCore lightColor = Color.Black; thisType = this.GetType().ToString(); + + this.NetFields.AddField(new NetCode.NetCoreObject(this)); } public CoreObject() { this.updateDrawPosition(); + this.NetFields.AddField(new NetCode.NetCoreObject(this)); } public CoreObject(bool f) { //does nothng + this.NetFields.AddField(new NetCode.NetCoreObject(this)); } public CoreObject(Texture2DExtended texture,int which, Vector2 Tile, int InventoryMaxSize) @@ -1286,11 +1290,16 @@ namespace StardustCore { if (x == -1) { + //ERROR IS HERE?!?!?!?!? + if (TextureSheet == null) + { + ModCore.ModMonitor.Log("WHY IS EX TEXT NULL?????"); + } spriteBatch.Draw(TextureSheet.getTexture(), Game1.GlobalToLocal(Game1.viewport, this.drawPosition), new Rectangle?(this.sourceRect), Color.White * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f)); } else { - spriteBatch.Draw(TextureSheet.getTexture(), Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize - (this.sourceRect.Height * Game1.pixelZoom - this.boundingBox.Height)))), new Rectangle?(this.sourceRect), Color.White * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f)); + spriteBatch.Draw(TextureSheet.getTexture(), Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize))), new Rectangle?(this.sourceRect), Color.White * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); } if (this.heldObject.Value != null) { @@ -1492,6 +1501,11 @@ namespace StardustCore { return this.TextureSheet; } + + public virtual void setExtendedTexture(Texture2DExtended texture) + { + this.TextureSheet = texture; + } } } diff --git a/GeneralMods/StardustCore/Objects/MultiTileComponent.cs b/GeneralMods/StardustCore/Objects/MultiTileComponent.cs index 27a74cef..f9feb37a 100644 --- a/GeneralMods/StardustCore/Objects/MultiTileComponent.cs +++ b/GeneralMods/StardustCore/Objects/MultiTileComponent.cs @@ -15,6 +15,11 @@ namespace StardustCore.Objects //Pass in different function pointers that return bool to check if this default code will run. If not public MultiTileObject containerObject; + public MultiTileComponent() + { + //this.TextureSheet = new Texture2DExtended(); + this.NetFields.AddField(new NetCode.NetTexture2DExtended(this.getExtendedTexture())); + } public MultiTileComponent(CoreObject part) { @@ -28,6 +33,8 @@ namespace StardustCore.Objects } this.defaultBoundingBox = new Rectangle(0, 0, 16, 16); this.boundingBox.Value = new Rectangle((int)0 * Game1.tileSize, (int)0* Game1.tileSize, 1 * Game1.tileSize, 1 * Game1.tileSize); + + this.NetFields.AddField(new NetCode.NetTexture2DExtended(this.getExtendedTexture())); } public MultiTileComponent(int which,String name, String description, Texture2DExtended texture) @@ -44,6 +51,8 @@ namespace StardustCore.Objects this.defaultSourceRect = this.sourceRect; this.serializationName = this.GetType().ToString(); this.ParentSheetIndex = which; + + this.NetFields.AddField(new NetCode.NetTexture2DExtended(this.getExtendedTexture())); } public MultiTileComponent(int which,String name, String description, Animations.AnimationManager animationManager) @@ -61,6 +70,8 @@ namespace StardustCore.Objects this.defaultSourceRect = this.sourceRect; this.serializationName = this.GetType().ToString(); this.ParentSheetIndex = which; + + this.NetFields.AddField(new NetCode.NetTexture2DExtended(this.getExtendedTexture())); } public override bool clicked(Farmer who) @@ -148,6 +159,12 @@ namespace StardustCore.Objects //The actual planter box being drawn. if (animationManager == null) { + if (this.TextureSheet == null) + { + ModCore.ModMonitor.Log("Tex Extended is null???"); + + } + spriteBatch.Draw(this.TextureSheet.getTexture(), Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.sourceRect), Color.White * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); // Log.AsyncG("ANIMATION IS NULL?!?!?!?!"); } diff --git a/GeneralMods/StardustCore/Objects/MultiTileObject.cs b/GeneralMods/StardustCore/Objects/MultiTileObject.cs index 63085359..50642c70 100644 --- a/GeneralMods/StardustCore/Objects/MultiTileObject.cs +++ b/GeneralMods/StardustCore/Objects/MultiTileObject.cs @@ -4,7 +4,9 @@ using StardewValley; using StardustCore.UIUtilities; using System; using System.Collections.Generic; +using System.IO; using System.Linq; +using System.Runtime.Serialization.Formatters.Binary; using System.Text; using System.Threading.Tasks; @@ -16,6 +18,11 @@ namespace StardustCore.Objects public Color categoryColor; public String categoryName; + public MultiTileObject() + { + + } + public MultiTileObject(String Name, String Description,Vector2 tile, Texture2DExtended texture, List> Objects, Color CategoryColor, String CategoryName) :base(texture,0,tile,0) { this.objects = Objects; @@ -197,7 +204,7 @@ namespace StardustCore.Objects if (animationManager == null) { //FIX SCALE SIZE AND POSITION APPROPRIATELY DEPENDING ON # OF OBJECTS!!! - aosdkpoasdopjsa + //fsfsd spriteBatch.Draw(v.Value.getExtendedTexture().getTexture(), location+new Vector2(v.Key.X*16,v.Key.Y*16), this.defaultSourceRect, Color.White * transparency, 0f, new Vector2(0, 0), 1, SpriteEffects.None, layerDepth); } else diff --git a/GeneralMods/StardustCore/StardustCore.csproj b/GeneralMods/StardustCore/StardustCore.csproj index 7e5f69b9..fd8c09bd 100644 --- a/GeneralMods/StardustCore/StardustCore.csproj +++ b/GeneralMods/StardustCore/StardustCore.csproj @@ -89,6 +89,8 @@ + + diff --git a/GeneralMods/TimeFreeze/TimeFreeze.cs b/GeneralMods/TimeFreeze/TimeFreeze.cs index 5c41ca5a..1d0a7964 100644 --- a/GeneralMods/TimeFreeze/TimeFreeze.cs +++ b/GeneralMods/TimeFreeze/TimeFreeze.cs @@ -49,7 +49,7 @@ namespace Omegasis.TimeFreeze /// The location to check. private bool ShouldFreezeTime(StardewValley.Farmer player, GameLocation location) { - if (location.Name == "Mine" || location.Name == "SkullCave" || location.Name == "UndergroundMine" || location.IsOutdoors) + if (location.Name == "Mine" || location.Name == "SkullCave"|| location.Name.StartsWith("SkullCave") || location.Name.StartsWith("UndergroundMine") || location.IsOutdoors) return false; if (player.swimming.Value) { diff --git a/GeneralMods/TimeFreeze/manifest.json b/GeneralMods/TimeFreeze/manifest.json index 0352e8f2..d79ba422 100644 --- a/GeneralMods/TimeFreeze/manifest.json +++ b/GeneralMods/TimeFreeze/manifest.json @@ -1,7 +1,7 @@ { "Name": "Time Freeze", "Author": "Alpha_Omegasis", - "Version": "1.3.0", + "Version": "1.4.0", "Description": "Emulates old Harvest Moon-style games where time is frozen inside.", "UniqueID": "Omegasis.TimeFreeze", "EntryDll": "TimeFreeze.dll",