diff --git a/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier.sln b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier.sln new file mode 100644 index 00000000..ff8ae933 --- /dev/null +++ b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier.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}") = "CustomAssetModifier", "CustomAssetModifier\CustomAssetModifier.csproj", "{679F7D40-2728-47BB-A86F-D044816752E2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {679F7D40-2728-47BB-A86F-D044816752E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {679F7D40-2728-47BB-A86F-D044816752E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {679F7D40-2728-47BB-A86F-D044816752E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {679F7D40-2728-47BB-A86F-D044816752E2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier.cs b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier.cs new file mode 100644 index 00000000..c75678cd --- /dev/null +++ b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using StardewModdingAPI; +using System.IO; +using CustomAssetModifier.Framework.Editors; +using CustomAssetModifier.Framework; + +namespace CustomAssetModifier +{ + + public class CustomAssetModifier : Mod + { + /// + /// Static reference to this mod's helper. + /// + public static IModHelper ModHelper; + /// + /// Static reference to this mod's monitor. + /// + public static IMonitor ModMonitor; + + /// + /// Path for Mod/Content. + /// + public static string contentPath; + /// + /// Path for Mod/Content/Data + /// + public static string dataPath; + /// + /// Path for Mod/Content/Data/ObjectInformation + /// + public static string objectInformationPath; + /// + /// Path for Mod/Content/Templates/ObjectInformation + /// + public static string TemplatePath; + + + /// + /// Entry function for the mod. + /// + /// + public override void Entry(IModHelper helper) + { + ModHelper = helper; + ModMonitor = Monitor; + + //Just setting up a bunch of paths for the mod. + contentPath = Path.Combine(ModHelper.DirectoryPath, "Content"); + dataPath = Path.Combine(contentPath, "Data"); + objectInformationPath = Path.Combine(dataPath, "ObjectInformation"); + TemplatePath = Path.Combine(contentPath, "Templates"); + + createDirectories(); + createBlankObjectTemplate(); + + //Add the ObjectInformationEditor asset editor to the list of asset editors that SMAPI uses. + ModHelper.Content.AssetEditors.Add(new ObjectInformationEditor()); + } + + + /// + /// Creates the necessary directories for the mod. + /// + public void createDirectories() + { + //Create the Mod/Content directory. + if (!Directory.Exists(contentPath)){ + Directory.CreateDirectory(contentPath); + } + //Create the Mod/Content/Data directory. + if (!Directory.Exists(dataPath)) + { + Directory.CreateDirectory(dataPath); + } + //Create the Mod/Content/Data/ObjectInformation directory. + if (!Directory.Exists(objectInformationPath)) + { + Directory.CreateDirectory(objectInformationPath); + } + //Create the Mod/Content/Template/ObjectInformation directory. + if (!Directory.Exists(TemplatePath)) + { + Directory.CreateDirectory(TemplatePath); + } + } + + /// + /// Creates the blank object example for dinosaur eggs. + /// + public void createBlankObjectTemplate() + { + var ok = new AssetInformation("107","Dinosaur Egg / 720 / -300 / Arch / A giant dino egg...The entire shell is still intact!/ Mine .01 Mountain .008 / Item 1 107"); + ok.writeJson(Path.Combine(TemplatePath,"ObjectInformation",ok.id.ToString()+".json")); + } + + + } +} diff --git a/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier.csproj b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier.csproj new file mode 100644 index 00000000..cfff725e --- /dev/null +++ b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier.csproj @@ -0,0 +1,68 @@ + + + + + Debug + AnyCPU + {679F7D40-2728-47BB-A86F-D044816752E2} + Library + Properties + CustomAssetModifier + CustomAssetModifier + 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/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/Framework/AssetInformation.cs b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/Framework/AssetInformation.cs new file mode 100644 index 00000000..7ca21349 --- /dev/null +++ b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/Framework/AssetInformation.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CustomAssetModifier.Framework +{ + /// + /// Used to easily store Dictionary key pair values of (string,string) that are commonly used in .xnb files. + /// + public class AssetInformation + { + public string id; // + public string informationString; + + /// + /// Blank constructor. + /// + public AssetInformation() + { + + } + + /// + /// Normal constructor. + /// + /// The id key used in the asset file. Aslo will be the file's name. + /// The data string that is to be set after the edit. + public AssetInformation(string ID, string DataString) + { + this.id = ID; + this.informationString = DataString; + } + + /// + /// Write the information to a .json file. + /// + /// + public void writeJson(string path) + { + CustomAssetModifier.ModHelper.WriteJsonFile(path, this); + } + + /// + /// Read the information from a .json file and return an instance of AssetInformation. + /// + /// + /// + public static AssetInformation readJson(string path) + { + return CustomAssetModifier.ModHelper.ReadJsonFile(path); + } + } + +} diff --git a/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/Framework/Editors/ObjectInformationEditor.cs b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/Framework/Editors/ObjectInformationEditor.cs new file mode 100644 index 00000000..ceaa348e --- /dev/null +++ b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/Framework/Editors/ObjectInformationEditor.cs @@ -0,0 +1,39 @@ +using StardewModdingAPI; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CustomAssetModifier.Framework.Editors +{ + + /// + /// Asset editor for assets stored in ObjectInformation.xnb + /// + public class ObjectInformationEditor : IAssetEditor + { + /// Get whether this instance can edit the given asset. + /// Basic metadata about the asset being loaded. + public bool CanEdit(IAssetInfo asset) + { + return asset.AssetNameEquals(@"Data\ObjectInformation"); + } + + /// Edit a matched asset. + /// A helper which encapsulates metadata about an asset and enables changes to it. + public void Edit(IAssetData asset) + { + string[] files = Directory.GetFiles(CustomAssetModifier.objectInformationPath); + foreach (var file in files) + { + var ok = AssetInformation.readJson(file); + asset + .AsDictionary() + .Set(Convert.ToInt32(ok.id), ok.informationString); + } + } + } + +} diff --git a/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/Properties/AssemblyInfo.cs b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..8df3fd53 --- /dev/null +++ b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/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("CustomAssetModifier")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CustomAssetModifier")] +[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("679f7d40-2728-47bb-a86f-d044816752e2")] + +// 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/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/manifest.json b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/manifest.json new file mode 100644 index 00000000..ebd65b47 --- /dev/null +++ b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/manifest.json @@ -0,0 +1,15 @@ +{ + "Name": "Custom Asset Editor", + "Author": "Alpha_Omegasis", + "Version": { + "MajorVersion": 1, + "MinorVersion": 0, + "PatchVersion": 0, + "Build": null + }, + "MinimumApiVersion": "2.3", + "Description": "Allows players to edit basic vanilla assets using text files.", + "UniqueID": "Omegasis.CustomAssetModifier", + "EntryDll": "CustomAssetModifier.dll", + "UpdateKeys": [ "" ] +} diff --git a/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/packages.config b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/packages.config new file mode 100644 index 00000000..028670c6 --- /dev/null +++ b/GeneralMods/CustomAssetModifier/CustomAssetModifier/CustomAssetModifier/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs b/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs index 909a403c..d12dff3d 100644 --- a/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs +++ b/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs @@ -170,13 +170,17 @@ namespace Omegasis.HappyBirthday.Framework /// Whether to enable sound. public override void receiveLeftClick(int x, int y, bool playSound = true) { - foreach (ClickableTextureComponent button in this.DayButtons) + //If the season is not selected then the day buttons can't be clicked. Thanks to @Potato#5266 on the SDV discord for this tip. + if (this.BirthdaySeason == "spring" || this.BirthdaySeason == "summer" || this.BirthdaySeason == "fall" || this.BirthdaySeason == "winter") { - if (button.containsPoint(x, y)) + foreach (ClickableTextureComponent button in this.DayButtons) { - this.HandleButtonClick(button.name); - button.scale -= 0.5f; - button.scale = Math.Max(3.5f, button.scale); + if (button.containsPoint(x, y)) + { + this.HandleButtonClick(button.name); + button.scale -= 0.5f; + button.scale = Math.Max(3.5f, button.scale); + } } } diff --git a/GeneralMods/HappyBirthday/HappyBirthday.cs b/GeneralMods/HappyBirthday/HappyBirthday.cs index cf928916..869e4829 100644 --- a/GeneralMods/HappyBirthday/HappyBirthday.cs +++ b/GeneralMods/HappyBirthday/HappyBirthday.cs @@ -100,6 +100,7 @@ namespace Omegasis.HappyBirthday // load settings this.MigrateLegacyData(); this.PlayerData = this.Helper.ReadJsonFile(this.DataFilePath) ?? new PlayerData(); + //this.SeenEvent = false; //this.Dialogue = new Dictionary(); } @@ -501,28 +502,35 @@ namespace Omegasis.HappyBirthday private void MigrateLegacyData() { // skip if no legacy data or new data already exists - if (!File.Exists(this.LegacyDataFilePath) || File.Exists(this.DataFilePath)) - return; - - // migrate to new file try { - string[] text = File.ReadAllLines(this.LegacyDataFilePath); - this.Helper.WriteJsonFile(this.DataFilePath, new PlayerData - { - BirthdaySeason = text[3], - BirthdayDay = Convert.ToInt32(text[5]) - }); - - FileInfo file = new FileInfo(this.LegacyDataFilePath); - file.Delete(); - if (!file.Directory.EnumerateFiles().Any()) - file.Directory.Delete(); + if (!File.Exists(this.LegacyDataFilePath) || File.Exists(this.DataFilePath)) + if (this.PlayerData == null) this.PlayerData = new PlayerData(); + return; } - catch (Exception ex) + catch(Exception err) { - this.Monitor.Log($"Error migrating data from the legacy 'Player_Birthdays' folder for the current player. Technical details:\n {ex}", LogLevel.Error); + // migrate to new file + try + { + string[] text = File.ReadAllLines(this.LegacyDataFilePath); + this.Helper.WriteJsonFile(this.DataFilePath, new PlayerData + { + BirthdaySeason = text[3], + BirthdayDay = Convert.ToInt32(text[5]) + }); + + FileInfo file = new FileInfo(this.LegacyDataFilePath); + file.Delete(); + if (!file.Directory.EnumerateFiles().Any()) + file.Directory.Delete(); + } + catch (Exception ex) + { + this.Monitor.Log($"Error migrating data from the legacy 'Player_Birthdays' folder for the current player. Technical details:\n {ex}", LogLevel.Error); + } } + } } } diff --git a/GeneralMods/HappyBirthday/manifest.json b/GeneralMods/HappyBirthday/manifest.json index 5186e9f5..2cffb970 100644 --- a/GeneralMods/HappyBirthday/manifest.json +++ b/GeneralMods/HappyBirthday/manifest.json @@ -1,7 +1,13 @@ { "Name": "Happy Birthday", "Author": "Alpha_Omegasis", - "Version": "1.4.1", + "Version": { + "MajorVersion": 1, + "MinorVersion": 4, + "PatchVersion": 3, + "Build": null + }, + "MinimumApiVersion": "1.15", "Description": "Adds the farmer's birthday to the game.", "UniqueID": "Omegasis.HappyBirthday", "EntryDll": "HappyBirthday.dll", diff --git a/GeneralMods/StardewMods.sln b/GeneralMods/StardewMods.sln index 3b6fd1e0..3230c825 100644 --- a/GeneralMods/StardewMods.sln +++ b/GeneralMods/StardewMods.sln @@ -66,6 +66,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StarAI", "..\StarAI\StarAI\ {0756D36A-95C8-480D-8EA6-4584C03010C6} = {0756D36A-95C8-480D-8EA6-4584C03010C6} EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StardewSymphonyRemastered", "StardewSymphonyRemastered\StardewSymphonyRemastered\StardewSymphonyRemastered.csproj", "{19F64B03-6A9B-49E1-854A-C05D5A014646}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -160,6 +162,10 @@ Global {93632675-991D-425B-96F9-9C2B6BFC4EFE}.Debug|Any CPU.Build.0 = Debug|Any CPU {93632675-991D-425B-96F9-9C2B6BFC4EFE}.Release|Any CPU.ActiveCfg = Release|Any CPU {93632675-991D-425B-96F9-9C2B6BFC4EFE}.Release|Any CPU.Build.0 = Release|Any CPU + {19F64B03-6A9B-49E1-854A-C05D5A014646}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F64B03-6A9B-49E1-854A-C05D5A014646}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F64B03-6A9B-49E1-854A-C05D5A014646}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F64B03-6A9B-49E1-854A-C05D5A014646}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/GeneralMods/StardewSymphony/Framework/SongsProcessor/MusicPack.cs b/GeneralMods/StardewSymphony/Framework/SongsProcessor/MusicPack.cs new file mode 100644 index 00000000..46ec95f3 --- /dev/null +++ b/GeneralMods/StardewSymphony/Framework/SongsProcessor/MusicPack.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Omegasis.StardewSymphony.Framework.SongsProcessor +{ + public class MusicPack + { + public MusicPackMetaData musicPackInformation; + public List listOfAllSongs; + + + public MusicPack(string Name,string pathToFiles) + { + string extentionInformation = Path.GetExtension(pathToFiles); + + + if (extentionInformation==".xwb") { + this.musicPackInformation = new MusicPackMetaData(Name,pathToFiles); + } + else + { + this.musicPackInformation = new MusicPackMetaData(Name); + this.getAllWavFileFromDirectory(); + } + } + + public void getAllWavFileFromDirectory() + { + string[] files = System.IO.Directory.GetFiles(musicPackInformation.fileLocation, "*.wav"); + + foreach(var s in files) + { + Song song = new Song(Path.GetFileName(musicPackInformation.fileLocation), s, false); + this.listOfAllSongs.Add(song); + } + } + + public void playSong(string name) + { + Song song = returnSong(name); + if (song != null) + { + song.play(); + } + } + + public void stopSong(string name) + { + Song song = returnSong(name); + if (song != null) + { + song.stop(); + } + } + + public void resumeSong(string name) + { + Song song = returnSong(name); + if (song != null) + { + song.resume(); + } + } + + public void pauseSong(string name) + { + Song song = returnSong(name); + if (song != null) + { + song.pause(); + } + } + + public void changeVolume(string name,float amount) + { + Song song = returnSong(name); + if (song != null) + { + song.changeVolume(amount); + } + } + + /// + /// Get's the song from the list. + /// + /// + /// + public Song returnSong(string Name) + { + return listOfAllSongs.Find(item => item.name == Name); + } + + + } +} diff --git a/GeneralMods/StardewSymphony/Framework/SongsProcessor/MusicPackMetaData.cs b/GeneralMods/StardewSymphony/Framework/SongsProcessor/MusicPackMetaData.cs new file mode 100644 index 00000000..a3e87ce9 --- /dev/null +++ b/GeneralMods/StardewSymphony/Framework/SongsProcessor/MusicPackMetaData.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Omegasis.StardewSymphony.Framework.SongsProcessor +{ + public class MusicPackMetaData + { + public string name; + public string fileLocation; + public bool xwbWavePack; + + + /// + /// Constructor for non-xwb music packs + /// + /// + public MusicPackMetaData(string name) + { + + this.name = name; + this.xwbWavePack = false; + } + + /// + /// Constructor for xnb music packs + /// + /// + /// + public MusicPackMetaData(string name,string fileLocation) + { + this.name = name; + this.fileLocation = fileLocation; + this.xwbWavePack = true; + } + + } +} diff --git a/GeneralMods/StardewSymphony/Framework/SongsProcessor/Song.cs b/GeneralMods/StardewSymphony/Framework/SongsProcessor/Song.cs new file mode 100644 index 00000000..97e22b43 --- /dev/null +++ b/GeneralMods/StardewSymphony/Framework/SongsProcessor/Song.cs @@ -0,0 +1,221 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Omegasis.StardewSymphony.Framework.SongsProcessor +{ + public class Song + { + public string name; + public string fileLocation; + public bool existsInMusicXNBFile; + + + public DynamicSoundEffectInstance dynamicSound; + public int position; + public int count; + public byte[] byteArray; + + public EventHandler bufferHandler; + + public SongsProcessor.SongState songState; + + /// + /// Constructor. + /// + /// Name of the song. + /// Path to the song. + /// Checks if this song comes from a .xwb file or a .wav file. + public Song(string Name, string FileLocation, bool ExistsInXNBWavePack) + { + this.name = Name; + this.fileLocation = FileLocation; + this.existsInMusicXNBFile = ExistsInXNBWavePack; + } + + /// + /// Load the song from the path so that we can stream it. + /// + /// + public DynamicSoundEffectInstance loadSongIntoStream() + { + + System.IO.Stream waveFileStream = TitleContainer.OpenStream(this.fileLocation); + + BinaryReader reader = new BinaryReader(waveFileStream); + + int chunkID = reader.ReadInt32(); + int fileSize = reader.ReadInt32(); + int riffType = reader.ReadInt32(); + int fmtID = reader.ReadInt32(); + int fmtSize = reader.ReadInt32(); + int fmtCode = reader.ReadInt16(); + int channels = reader.ReadInt16(); + int sampleRate = reader.ReadInt32(); + int fmtAvgBPS = reader.ReadInt32(); + int fmtBlockAlign = reader.ReadInt16(); + int bitDepth = reader.ReadInt16(); + + if (fmtSize == 18) + { + // Read any extra values + int fmtExtraSize = reader.ReadInt16(); + reader.ReadBytes(fmtExtraSize); + } + + int dataID = reader.ReadInt32(); + int dataSize = reader.ReadInt32(); + + byteArray = reader.ReadBytes(dataSize); + + dynamicSound = new DynamicSoundEffectInstance(sampleRate, (AudioChannels)channels); + count = dynamicSound.GetSampleSizeInBytes(TimeSpan.FromMilliseconds(100)); + bufferHandler= new EventHandler(DynamicSound_BufferNeeded); + dynamicSound.BufferNeeded += bufferHandler; + + return this.dynamicSound; + } + + /// + /// Null the song out so that we can remove it from memory and switch to another song??? + /// + public void unloadSongFromStream() + { + dynamicSound.Stop(); + dynamicSound.BufferNeeded -= bufferHandler; + dynamicSound = null; + } + + /// + /// Taken from an example. I'm sure this is necessary to keep streaming the audio. + /// + /// + /// + void DynamicSound_BufferNeeded(object sender, EventArgs e) + { + dynamicSound.SubmitBuffer(byteArray, position, count / 2); + dynamicSound.SubmitBuffer(byteArray, position + count / 2, count / 2); + + position += count; + if (position + count > byteArray.Length) + { + position = 0; + } + } + + /// + /// Stop the currently playing song. + /// + public void stop() + { + if (this.dynamicSound != null) + { + if(this.songState==SongState.Playing || this.songState == SongState.Paused) + { + this.dynamicSound.Stop(); + this.songState = SongState.Stopped; + } + } + } + + /// + /// Plays the current song. + /// + public void play() + { + if (this.dynamicSound != null) + { + if (getSongState() == SongState.Stopped || getSongState() == SongState.Paused) + { + this.dynamicSound.Play(); + this.songState = SongState.Playing; + } + } + } + + + /// + /// Resume the current song from being paused. + /// + public void resume() + { + if (this.dynamicSound != null) + { + if (getSongState() == SongState.Stopped || getSongState() == SongState.Paused) + { + this.dynamicSound.Resume(); + this.songState = SongState.Playing; + } + } + } + + /// + /// Pauses the current song. + /// + public void pause() + { + if (getSongState() == SongState.Playing || getSongState() == SongState.Stopped) + { + this.dynamicSound.Pause(); + this.songState = SongState.Paused; + } + } + + /// + /// Changes the volume of the song playing. + /// + /// + public void changeVolume(float newVolumeAmount) + { + if (this.dynamicSound != null) + { + this.dynamicSound.Volume = newVolumeAmount; + } + } + + /// + /// Returns the state of the song so that users know if the song is playing, stopped, or paused. + /// + /// + public SongState getSongState() + { + return this.songState; + } + + + /// + /// Checks if the song is playing or not. + /// + /// + public bool isPlaying() + { + if (getSongState() == SongState.Playing) return true; + else return false; + } + + /// + /// Checks is the song is paused or not. + /// + /// + public bool isPaused() + { + if (getSongState() == SongState.Paused) return true; + else return false; + } + + /// + /// Checks if the song is stopped or not. + /// + /// + public bool isStopped() + { + if (getSongState() == SongState.Stopped) return true; + else return false; + } + } +} diff --git a/GeneralMods/StardewSymphony/Framework/SongsProcessor/SongState.cs b/GeneralMods/StardewSymphony/Framework/SongsProcessor/SongState.cs new file mode 100644 index 00000000..ca25c986 --- /dev/null +++ b/GeneralMods/StardewSymphony/Framework/SongsProcessor/SongState.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Omegasis.StardewSymphony.Framework.SongsProcessor +{ + public enum SongState + { + /// The song is currently playing. + Playing, + + /// The song is currently paused. + Paused, + + /// The song is currently stopped. + Stopped + } +} diff --git a/GeneralMods/StardewSymphony/Framework/SongsProcessor/WaveFile.cs b/GeneralMods/StardewSymphony/Framework/SongsProcessor/WaveFile.cs new file mode 100644 index 00000000..e35ac3a4 Binary files /dev/null and b/GeneralMods/StardewSymphony/Framework/SongsProcessor/WaveFile.cs differ diff --git a/GeneralMods/StardewSymphony/StardewSymphony.cs b/GeneralMods/StardewSymphony/StardewSymphony.cs index 8d1a83e8..614d3704 100644 --- a/GeneralMods/StardewSymphony/StardewSymphony.cs +++ b/GeneralMods/StardewSymphony/StardewSymphony.cs @@ -154,7 +154,7 @@ namespace Omegasis.StardewSymphony } // init sound - this.HexProcessor.ProcessHex(); + this.HexProcessor.ProcessHex(); //Get all of the songs from the music packs. this.SelectMusic(); } diff --git a/GeneralMods/StardewSymphony/StardewSymphony.csproj b/GeneralMods/StardewSymphony/StardewSymphony.csproj index 0378e92d..47723424 100644 --- a/GeneralMods/StardewSymphony/StardewSymphony.csproj +++ b/GeneralMods/StardewSymphony/StardewSymphony.csproj @@ -40,6 +40,11 @@ Properties\GlobalAssemblyInfo.cs + + + + + diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered.sln b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered.sln new file mode 100644 index 00000000..93d924f2 --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered.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}") = "StardewSymphonyRemastered", "StardewSymphonyRemastered\StardewSymphonyRemastered.csproj", "{19F64B03-6A9B-49E1-854A-C05D5A014646}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {19F64B03-6A9B-49E1-854A-C05D5A014646}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F64B03-6A9B-49E1-854A-C05D5A014646}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F64B03-6A9B-49E1-854A-C05D5A014646}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F64B03-6A9B-49E1-854A-C05D5A014646}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicHexProcessor.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicHexProcessor.cs new file mode 100644 index 00000000..a8ac41dc --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicHexProcessor.cs @@ -0,0 +1,188 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using StardewValley; +using StardewSymphonyRemastered.Framework; + +namespace StardewSymphonyRemastered.Framework +{ + public class MusicHexProcessor + { + /********* + ** Properties + *********/ + /// All of the music/soundbanks and their locations. + private readonly XACTMusicPack MasterList; + + /// The registered soundbanks. + private readonly List SoundBanks = new List(); + + /// The callback to reset the game audio. + private readonly Action Reset; + + + /********* + ** Public methods + *********/ + /// Construct an instance. + /// All of the music/soundbanks and their locations. + /// The callback to reset the game audio. + public MusicHexProcessor(XACTMusicPack masterList, Action reset) + { + this.MasterList = masterList; + this.Reset = reset; + } + + /// Add a file path to the list of soundbanks. + /// The soundbank file path. + public void AddSoundBank(string path) + { + this.SoundBanks.Add(path); + } + + public static List ProcessSongNamesFromHex(XACTMusicPack musicPack, Action reset, string FileName) + { + int counter = 0; + List cleanCueNames = new List(); + byte[] array = File.ReadAllBytes(FileName); + string rawName = FileName.Substring(0, FileName.Length - 4); + string cueName = rawName + "CueList.txt"; + + if (File.Exists(cueName)) + { + string[] arr = File.ReadAllLines(cueName); + List names = new List(); + foreach(var v in arr) + { + names.Add(v); + } + return names; + } + string hexDumpContents = HexDump(array); + + string rawHexName = rawName + "HexDump.txt"; + File.WriteAllText(rawHexName, hexDumpContents); + + string[] readText = File.ReadAllLines(rawHexName); + string largeString = ""; + foreach (var line in readText) + { + try + { + string newString = ""; + for (int i = 62; i <= 77; i++) + newString += line[i]; + largeString += newString; + } + catch { } + } + string[] splits = largeString.Split('ÿ'); + string fix = ""; + foreach (string s in splits) + { + if (s == "") continue; + fix += s; + } + splits = fix.Split('.'); + + foreach (var split in splits) + { + if (split == "") continue; + + try + { + Game1.waveBank = musicPack.WaveBank; + Game1.soundBank = musicPack.SoundBank; + + if (Game1.soundBank.GetCue(split) != null) + cleanCueNames.Add(split); + + reset.Invoke(); + } + catch { } + } + + return cleanCueNames; + } + + /********* + ** Private methods + *********/ + public static string HexDump(byte[] bytes, int bytesPerLine = 16) + { + if (bytes == null) + return ""; + + int bytesLength = bytes.Length; + + char[] hexChars = "0123456789ABCDEF".ToCharArray(); + + int firstHexColumn = + 8 // 8 characters for the address + + 3; // 3 spaces + + int firstCharColumn = firstHexColumn + + bytesPerLine * 3 // - 2 digit for the hexadecimal value and 1 space + + (bytesPerLine - 1) / 8 // - 1 extra space every 8 characters from the 9th + + 2; // 2 spaces + + int lineLength = firstCharColumn + + bytesPerLine // - characters to show the ascii value + + Environment.NewLine.Length; // Carriage return and line feed (should normally be 2) + + char[] line = (new String(' ', lineLength - 2) + Environment.NewLine).ToCharArray(); + int expectedLines = (bytesLength + bytesPerLine - 1) / bytesPerLine; + StringBuilder result = new StringBuilder(expectedLines * lineLength); + + for (int i = 0; i < bytesLength; i += bytesPerLine) + { + line[0] = hexChars[(i >> 28) & 0xF]; + line[1] = hexChars[(i >> 24) & 0xF]; + line[2] = hexChars[(i >> 20) & 0xF]; + line[3] = hexChars[(i >> 16) & 0xF]; + line[4] = hexChars[(i >> 12) & 0xF]; + line[5] = hexChars[(i >> 8) & 0xF]; + line[6] = hexChars[(i >> 4) & 0xF]; + line[7] = hexChars[(i >> 0) & 0xF]; + + int hexColumn = firstHexColumn; + int charColumn = firstCharColumn; + + for (int j = 0; j < bytesPerLine; j++) + { + if (j > 0 && (j & 7) == 0) hexColumn++; + if (i + j >= bytesLength) + { + line[hexColumn] = ' '; + line[hexColumn + 1] = ' '; + line[charColumn] = ' '; + } + else + { + byte b = bytes[i + j]; + line[hexColumn] = hexChars[(b >> 4) & 0xF]; + line[hexColumn + 1] = hexChars[b & 0xF]; + line[charColumn] = GetAsciiSymbol(b); + } + hexColumn += 3; + charColumn++; + } + result.Append(line); + } + return result.ToString(); + } + + public static char GetAsciiSymbol(byte ch) + { + if (ch < 32) return '.'; // Non-printable ASCII + if (ch < 127) return (char)ch; // Normal ASCII + // Handle the hole in Latin-1 + if (ch == 127) return '.'; + if (ch < 0x90) return "€.‚ƒ„…†‡ˆ‰Š‹Œ.Ž."[ch & 0xF]; + if (ch < 0xA0) return ".‘’“”•–—˜™š›œ.žŸ"[ch & 0xF]; + if (ch == 0xAD) return '.'; // Soft hyphen: this symbol is zero-width even in monospace fonts + return (char)ch; // Normal Latin-1 + } + } +} diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicManager.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicManager.cs new file mode 100644 index 00000000..39409b9e --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicManager.cs @@ -0,0 +1,231 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using StardewSymphonyRemastered; +using StardewValley; + +namespace StardewSymphonyRemastered.Framework +{ + /// + /// TODO: Make this manage all of the music. + /// + /// Make it be able to load in multiple music packs from a general mod/MusicPacks Directory + /// + /// + /// + public class MusicManager + { + /// + /// A dictionary containing all of the music packs loaded in. + /// + public Dictionary musicPacks; + + public MusicPack currentMusicPack; + + Random packSelector; + Random songSelector; + /// + /// Constructor. + /// + public MusicManager() + { + this.musicPacks = new Dictionary(); + this.currentMusicPack = null; + packSelector = new Random(Game1.random.Next(1,1000000)); + songSelector = new Random(Game1.player.deepestMineLevel + Game1.player.facingDirection + packSelector.Next(0,10000)); + } + + /// + /// Swaps between referenced music packs and stops the last playing song. + /// + /// + public void swapMusicPacks(string nameOfNewMusicPack) + { + if (isMusicPackValid(nameOfNewMusicPack) == true) + { + if (this.currentMusicPack.isNull()==false) + { + this.currentMusicPack.stopSong(); + } + this.currentMusicPack = getMusicPack(nameOfNewMusicPack); + } + } + + /// + /// Plays the song from the currently loaded music pack. + /// + /// + public void playSongFromCurrentPack(string songName) + { + if (this.currentMusicPack.isNull() == false) + { + this.currentMusicPack.playSong(songName); + } + } + + /// + /// Resumes the paused song from the current music pack. + /// + public void pauseSongFromCurrentPack() { + if (this.currentMusicPack.isNull() == false) + { + this.currentMusicPack.pauseSong(); + } + } + + /// + /// Stops the song from the current music pack. + /// + public void stopSongFromCurrentMusicPack() + { + if (this.currentMusicPack.isNull() == false) + { + this.currentMusicPack.stopSong(); + } + } + + /// + /// Resumes the song from the current music pack. + /// + public void resumeSongFromCurrentMusicPack() + { + if (this.currentMusicPack.isNull() == false) + { + this.currentMusicPack.resumeSong(); + } + } + + /// + /// Returns the name of the currently playing song. + /// + /// + public string getNameOfCurrentlyPlayingSong() + { + if (this.currentMusicPack.isNull() == false) + { + return this.currentMusicPack.getNameOfCurrentSong(); + } + else + { + return ""; + } + } + + /// + /// Get the information associated with the current music pack. + /// + /// + public MusicPackMetaData getMusicPackInformation() + { + if (this.currentMusicPack.isNull() == false) + { + return this.currentMusicPack.musicPackInformation; + } + else return null; + } + + /// + /// Checks to see if the music pack has been loaded into the Music Manager. + /// + /// + /// + public bool isMusicPackValid(string nameOfMusicPack) + { + if (this.currentMusicPack.isNull() == false) + { + return musicPacks.ContainsKey(nameOfMusicPack); + } + else return false; + } + + /// + /// Gets the music pack from the + /// + /// + /// + public MusicPack getMusicPack(string name) + { + if (isMusicPackValid(name) == false) + { + StardewSymphony.ModMonitor.Log("Error, the music pack: " + name + " is not found. Please make sure it is loaded in and try again."); + return null; + } + else + { + + foreach (var pair in this.musicPacks) + { + if (name == pair.Key) return pair.Value; + } + return null; //Needed I suppose to ensure this function compiles. + } + } + + /// + /// Iterates across all music packs and determines which music packs contain songs that can be played right now. + /// + /// + /// + public Dictionary> getListOfApplicableMusicPacks(string songListKey) + { + Dictionary> listOfValidDictionaries = new Dictionary>(); + foreach(var v in this.musicPacks) + { + var songList= v.Value.songInformation.getSongList(songListKey).Value; + if (songList.Count > 0) + { + listOfValidDictionaries.Add(v.Value, songList); + } + } + return listOfValidDictionaries; + } + + /// + /// Selects the actual song to be played right now based off of the selector key. The selector key should be called when the player's location changes. + /// + /// + public void selectMusic(string songListKey) + { + var listOfValidMusicPacks = getListOfApplicableMusicPacks(songListKey); + if (listOfValidMusicPacks.Count == 0) + { + //No valid songs to play at this time. + StardewSymphony.ModMonitor.Log("Error: There are no songs to play across any music pack. Are you sure you did this properly?"); + return; + } + + int randInt = packSelector.Next(0, listOfValidMusicPacks.Count-1); + + var musicPackPair = listOfValidMusicPacks.ElementAt(randInt); + + //used to swap the music packs and stop the last playing song. + this.swapMusicPacks(musicPackPair.Key.musicPackInformation.name); + + int randInt2 = songSelector.Next(0, musicPackPair.Value.Count); + + var songName = musicPackPair.Value.ElementAt(randInt2); + + this.currentMusicPack.playSong(songName); + } + + /// + /// TODO: Make WAV MUSIC PACKS + /// + /// + public void addMusicPack(WavMusicPack wavMusicPack) + { + + } + + /// + /// Adds a valid xwb music pack to the list of music packs available. + /// + /// + public void addMusicPack(XACTMusicPack xwbMusicPack) + { + this.musicPacks.Add(xwbMusicPack.musicPackInformation.name,xwbMusicPack); + } + } +} diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicPack.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicPack.cs new file mode 100644 index 00000000..a39b1e0a --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicPack.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardewSymphonyRemastered.Framework +{ + /// + /// A base class that xnb and wav packs will derive commonalities from. + /// //Make Music Pack Meta data + /// + public class MusicPack + { + public string directory; + public StardewSymphonyRemastered.Framework.SongSpecifics songInformation; + public MusicPackMetaData musicPackInformation; + + + public virtual void playSong(string name) + { + + } + + public virtual void pauseSong() + { + + } + + public virtual void stopSong() + { + + } + + public virtual void resumeSong() + { + + } + + public virtual void loadMusicFiles() + { + + } + + public virtual void swapSong(string songName) + { + + } + + public virtual string getNameOfCurrentSong() + { + return ""; + } + + } +} diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicPackMetaData.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicPackMetaData.cs new file mode 100644 index 00000000..bb0bb2b9 --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/MusicPackMetaData.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardewSymphonyRemastered.Framework +{ + /// + /// Holds information regarding information relating to music packs such as name, description, author, and version. + /// + public class MusicPackMetaData + { + + public string name; + public string author; + public string description; + public string versionInfo; + + /// + /// Constrctor + /// + /// The name to be displayed for the music pack. + /// The author who compiled ths music pack. + /// The description of + /// + public MusicPackMetaData(string Name,string Author,string Description,string VersionInfo) + { + this.name = Name; + this.author = Author; + this.description = Description; + this.versionInfo = VersionInfo; + } + /// + /// Blank Constructor + /// + public MusicPackMetaData() + { + + } + + /// + /// Loads the music pack information from a json file. + /// + /// + /// + public static MusicPackMetaData readFromJson(string path) + { + return StardewSymphony.ModHelper.ReadJsonFile(path); + } + + /// + /// Writes the music pack information to a json file. + /// + /// + public void writeToJson(string path) + { + StardewSymphony.ModHelper.WriteJsonFile(path,this); + } + + + } +} diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/SongSpecifics.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/SongSpecifics.cs new file mode 100644 index 00000000..f4822747 --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/SongSpecifics.cs @@ -0,0 +1,391 @@ +using StardewValley; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardewSymphonyRemastered.Framework +{ + /// + /// Stores information about what songs play when. + /// + /// TODO: Festivals and events + /// + public class SongSpecifics + { + Dictionary> listOfSongsWithTriggers; //triggerName, + + Dictionary> eventSongs; + + Dictionary> festivalSongs; + + public List listOfSongsWithoutTriggers; + + public static List locations = new List(); + public static List festivals = new List(); + public static List events = new List(); + + string[] seasons; + string[] weather; + string[] daysOfWeek; + string[] timesOfDay; + public static char seperator = '_'; + + /// + /// Constructor. + /// + public SongSpecifics() + { + seasons = new string[] + { + "spring", + "summer", + "fall", + "winter" + }; + + weather = new string[] + { + "sunny", + "rainy", + "debris", + "lightning", + "festival", + "snow", + "wedding" + }; + daysOfWeek = new string[] + { + "sunday", + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday" + }; + timesOfDay = new string[] + { + "day", + "night" + }; + + listOfSongsWithTriggers = new Dictionary>(); + eventSongs = new Dictionary>(); + festivalSongs = new Dictionary>(); + + this.listOfSongsWithoutTriggers = new List(); + + this.addSongLists(); + + } + + + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// + // Static Methods // + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// + #region + + /// + /// TODO: Add functionality for events and festivals + /// Sum up some conditionals to parse the correct string key to access the songs list. + /// + /// + public static string getCurrentConditionalString() + { + string key = ""; + if (Game1.eventUp == true) + { + //Get the event id an hijack it with some different music + //String key="Event_EventName"; + } + else if (Game1.isFestival()) + { + //hijack the name of the festival and load some different songs + // string s="Festival_FestivalName"; + } + else + { + key = getLocationString() + seperator + getSeasonNameString() + seperator + getWeatherString() + seperator + getDayOfWeekString() + seperator + getTimeOfDayString(); + } + return key; + } + + + + /// + /// Initialize the location lists with the names of all of the major locations in the game. + /// + public static void addLocations() + { + foreach (var v in Game1.locations) + { + locations.Add(v.name); + } + } + + /// + /// TODO: Find a way to get all of the festivals in the game for this list. Perhapse have a way to check the season and day of the month and equivilate it to something. + /// Initialize list of festivals for the game. + /// + public static void addFestivals() + { + //Do some logic for festivals here. + } + + /// + /// Add a specific new festival to the list + /// + public static void addFestival(string name) + { + festivals.Add(name); + } + + /// + /// TODO: Get a list of all of the vanilla events in the game. But how to determine what event is playing is the question. + /// + /// + public static void addEvents() + { + //Do some logic here + } + + /// + /// TODO: Custom way to add in event to hijack music. + /// + /// + public static void addEvent(string name) + { + //Do some logic here + } + + /// + /// Add a location to the loctaion list. + /// + /// + public static void addLocation(string name) + { + locations.Add(name); + } + + /// + /// Get the name of the day of the week from what game day it is. + /// + /// + public static string getDayOfWeekString() + { + int day = Game1.dayOfMonth; + int dayOfWeek = day % 7; + if (dayOfWeek == 0) + { + return "sunday"; + } + if (dayOfWeek == 1) + { + return "monday"; + } + if (dayOfWeek == 2) + { + return "tuesday"; + } + if (dayOfWeek == 3) + { + return "wednesday"; + } + if (dayOfWeek == 4) + { + return "thursday"; + } + if (dayOfWeek == 5) + { + return "friday"; + } + if (dayOfWeek == 6) + { + return "saturday"; + } + return ""; + } + + /// + /// Get the name of the current season + /// + /// + public static string getSeasonNameString() + { + return Game1.currentSeason.ToLower(); + } + + /// + /// Get the name for the current weather outside. + /// + /// + public static string getWeatherString() + { + if (Game1.weatherIcon == Game1.weather_sunny) return "sunny"; + if (Game1.weatherIcon == Game1.weather_rain) return "rainy"; + if (Game1.weatherIcon == Game1.weather_debris) return "debris"; + if (Game1.weatherIcon == Game1.weather_lightning) return "lightning"; + if (Game1.weatherIcon == Game1.weather_festival) return "festival"; + if (Game1.weatherIcon == Game1.weather_snow) return "snow"; + if (Game1.weatherIcon == Game1.weather_wedding) return "wedding"; + return ""; + } + + /// + /// Get the name for the time of day that it currently is. + /// + /// + public static string getTimeOfDayString() + { + if (Game1.timeOfDay < Game1.getModeratelyDarkTime()) return "day"; + else return "night"; + } + + /// + /// Get the name of the location of where I am at. + /// + /// + public static string getLocationString() + { + return Game1.currentLocation.name; + } + #endregion + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// + // Non-Static Methods // + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// + + #region + /// + /// Adds the song's reference to a music pack. + /// + /// + public void addSongToMusicPack(string songName) + { + this.listOfSongsWithoutTriggers.Add(songName); + } + + /// + /// Checks if the song exists at all in this music pack. + /// + /// + /// + public bool isSongInList(string songName) + { + return listOfSongsWithoutTriggers.Contains(songName); + } + + /// + /// A pretty big function to add in all of the specific songs that play at certain locations_seasons_weather_dayOfWeek_times. + /// + public void addSongLists() + { + foreach (var loc in locations) + { + foreach (var season in seasons) + { + listOfSongsWithTriggers.Add(loc + seperator + season, new List()); + foreach(var Weather in weather) + { + listOfSongsWithTriggers.Add(loc + seperator + season + seperator + Weather, new List()); + foreach(var day in daysOfWeek) + { + listOfSongsWithTriggers.Add(loc + seperator + season + seperator + Weather + seperator + day, new List()); + foreach(var time in timesOfDay) + { + listOfSongsWithTriggers.Add(loc + seperator + season + seperator + Weather + seperator + day + seperator + time, new List()); + } + } + } + } + } + + //Add in some default seasonal music because maybe a location doesn't have some music? + foreach (var season in seasons) + { + listOfSongsWithTriggers.Add(season, new List()); + foreach (var Weather in weather) + { + listOfSongsWithTriggers.Add( season + seperator + Weather, new List()); + foreach (var day in daysOfWeek) + { + listOfSongsWithTriggers.Add(season + seperator + Weather + seperator + day, new List()); + foreach (var time in timesOfDay) + { + listOfSongsWithTriggers.Add(season + seperator + Weather + seperator + day + seperator + time, new List()); + } + } + } + } + } + + + /// + /// Used to access the master list of songs this music pack contains. + /// + /// + /// + public KeyValuePair>getSongList(string key) + { + string keyPhrase = key.Split(seperator).ElementAt(0); + + if (keyPhrase == "event") + { + /* + foreach (KeyValuePair> pair in eventSongs) + { + if (pair.Key == key) return pair; + } + */ + return new KeyValuePair>(key, eventSongs[key]); + } + else if (keyPhrase == "festival") + { + /* + foreach (KeyValuePair> pair in festivalSongs) + { + if (pair.Key == key) return pair; + } + */ + return new KeyValuePair>(key, festivalSongs[key]); + } + else + { + /* + foreach(KeyValuePair> pair in listOfSongsWithTriggers) + { + if (pair.Key == key) return pair; + } + */ + return new KeyValuePair>(key, listOfSongsWithTriggers[key]); + } + } + + /// + /// Add a song name to a specific list of songs to play that will play under certain conditions. + /// + /// + /// + public void addSongToList(string songListKey,string songName) + { + var songList = getSongList(songListKey); + + songList.Value.Add(songName); + } + + /// + /// Remove a song name from a specific list of songs to play that will play under certain conditions. + /// + /// + /// + public void removeSongFromList(string songListKey,string songName) + { + var songList = getSongList(songListKey); + songList.Value.Remove(songName); + } + #endregion + } +} diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/WavMusicPack.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/WavMusicPack.cs new file mode 100644 index 00000000..061e07bb --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/WavMusicPack.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardewSymphonyRemastered.Framework +{ + /// + /// TODO: Make this class + /// + public class WavMusicPack : MusicPack + { + } +} diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/XACTMusicPack.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/XACTMusicPack.cs new file mode 100644 index 00000000..7e443a9d --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Framework/XACTMusicPack.cs @@ -0,0 +1,160 @@ +using Microsoft.Xna.Framework.Audio; +using StardewValley; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardewSymphonyRemastered.Framework +{ + /// + /// TODO: Make this work and add in overrided functions. + /// + public class XACTMusicPack: MusicPack + { + public Microsoft.Xna.Framework.Audio.WaveBank WaveBank; + public Microsoft.Xna.Framework.Audio.SoundBank SoundBank; + + + + public Cue currentCue; + + + //Make Music pack meta data. Includes author, version, description. + + public string XWBPath; + + /// + /// Constructor. + /// + /// + /// + /// + public XACTMusicPack(string directoryToXwb,string pathToXWB) + { + this.directory = directoryToXwb; + this.XWBPath = pathToXWB; + this.songInformation = new SongSpecifics(); + this.currentCue = null; + this.musicPackInformation = MusicPackMetaData.readFromJson(Path.Combine(directoryToXwb, "MusicPackInformation.json")); + 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"); + } + } + + /// + /// Load all of the generic music file names into the music pack's information. + /// + public override void loadMusicFiles() + { + this.songInformation.listOfSongsWithoutTriggers=StardewSymphonyRemastered.Framework.MusicHexProcessor.ProcessSongNamesFromHex(this,StardewSymphony.Reset,this.XWBPath); + } + + /// + /// Get the cue from the list of songs. + /// + /// The name of the song to get. + /// + private Cue getCue(string name) { + if (this.songInformation.isSongInList(name) == false) + { + StardewSymphony.ModMonitor.Log("Error! The song " + name + " could not be found in music pack " + this.musicPackInformation.name+". Please ensure that this song is part of this music pack located at: "+ this.XWBPath+ " or contact the music pack author: "+this.musicPackInformation.author,StardewModdingAPI.LogLevel.Error); + return null; + } + else + { + return this.SoundBank.GetCue(name); + } + } + + /// + /// Play a song. + /// + /// The name of the song to play. + public override void playSong(string name) + { + this.currentCue = this.getCue(name); + if (this.currentCue == null) + { + return; //getCue will throw the error message. + } + Game1.waveBank = this.WaveBank; + Game1.soundBank = this.SoundBank; + this.currentCue.Play(); + + StardewSymphony.Reset(); + } + + /// + /// Pause the currently playing song. + /// + /// Pause the current song that is playing. + public override void pauseSong() + { + if (this.currentCue == null) return; + else + { + Game1.waveBank = this.WaveBank; + Game1.soundBank = this.SoundBank; + this.currentCue.Pause(); + StardewSymphony.Reset(); + } + } + + /// + /// Resume playing the current set cue. + /// + /// + public override void resumeSong() + { + if (this.currentCue == null) return; + else + { + Game1.waveBank = this.WaveBank; + Game1.soundBank = this.SoundBank; + this.currentCue.Resume(); + StardewSymphony.Reset(); + } + } + + /// + /// Stops the currently playing song and nulls the current song. + /// + public override void stopSong() + { + if (this.currentCue == null) return; + else + { + Game1.waveBank = this.WaveBank; + Game1.soundBank = this.SoundBank; + this.currentCue.Stop(AudioStopOptions.Immediate); + StardewSymphony.Reset(); + this.currentCue = null; + } + } + + /// + /// Stops the currently playing song and starts playing a new song. + /// + /// The name of the new song to play. + public override void swapSong(string newSongName) + { + this.stopSong(); + this.playSong(newSongName); + } + + /// + /// Returns the name of the currently playing song. + /// + /// + public override string getNameOfCurrentSong() + { + return this.currentCue.Name; + } + + } +} diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Properties/AssemblyInfo.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..9769ec10 --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/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("StardewSymphonyRemastered")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("StardewSymphonyRemastered")] +[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("19f64b03-6a9b-49e1-854a-c05d5a014646")] + +// 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/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs new file mode 100644 index 00000000..84dc33ff --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphony.cs @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Microsoft.Xna.Framework.Audio; +using StardewModdingAPI; +using StardewValley; +using StardewSymphonyRemastered.Framework; +using System.IO; + +namespace StardewSymphonyRemastered +{ + + /// + /// BIG WIP. Don't use this at all because it does nothing right now. + /// TODO: + /// 1.Make Xwb packs work + /// 1.5. Make way to load in music packs. + /// 2.Make stream files work + /// 2.5. Make Music Manager + /// 3.Make interface. + /// 4.Make sure stuff doesn't blow up. + /// 5.Release + /// 6.Make videos documenting how to make this mod work. + /// 7.Make way to generate new music packs. + /// + public class StardewSymphony : Mod + { + public static WaveBank DefaultWaveBank; + public static SoundBank DefaultSoundBank; + + + public static IModHelper ModHelper; + public static IMonitor ModMonitor; + + public static MusicManager musicManager; + + private string MusicPath; + public static string WavMusicDirectory; + public static string XACTMusicDirectory; + public static string TemplateMusicDirectory; + + + public override void Entry(IModHelper helper) + { + DefaultSoundBank = Game1.soundBank; + DefaultWaveBank = Game1.waveBank; + ModHelper = helper; + ModMonitor = Monitor; + + StardewModdingAPI.Events.SaveEvents.AfterLoad += SaveEvents_AfterLoad; + StardewModdingAPI.Events.LocationEvents.CurrentLocationChanged += LocationEvents_CurrentLocationChanged; + + musicManager = new MusicManager(); + + MusicPath = Path.Combine(ModHelper.DirectoryPath, "Content", "Music"); + WavMusicDirectory = Path.Combine(MusicPath, "Wav"); + XACTMusicDirectory = Path.Combine(MusicPath, "XACT"); + TemplateMusicDirectory = Path.Combine(MusicPath, "Templates"); + + this.createDirectories(); + this.createBlankXACTTemplate(); + //load in all packs here. + } + + public void createDirectories() + { + if (!Directory.Exists(MusicPath)) Directory.CreateDirectory(MusicPath); + if (!Directory.Exists(WavMusicDirectory)) Directory.CreateDirectory(WavMusicDirectory); + if (!Directory.Exists(XACTMusicDirectory)) Directory.CreateDirectory(XACTMusicDirectory); + if (!Directory.Exists(TemplateMusicDirectory)) Directory.CreateDirectory(TemplateMusicDirectory); + } + public void createBlankXACTTemplate() + { + string path= Path.Combine(TemplateMusicDirectory, "XACT"); + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + if(!File.Exists(Path.Combine(path, "MusicPackInformation.json"))){ + MusicPackMetaData blankMetaData = new MusicPackMetaData(); + blankMetaData.writeToJson(Path.Combine(path, "MusicPackInformation.json")); + } + if (!File.Exists(Path.Combine(path, "readme.txt"))) + { + string info = "Place the Wave Bank.xwb file and Sound Bank.xsb file you created in XACT in a similar directory in Content/Music/XACT/SoundPackName with a new meta data to load it!"; + File.WriteAllText(Path.Combine(path, "readme.txt"),info); + } + } + + + public static void loadXACTMusicPacks() + { + string[] listOfDirectories= Directory.GetDirectories(XACTMusicDirectory); + foreach(string folder in listOfDirectories) + { + string waveBank = Path.Combine(folder, "Wave Bank.xwb"); + string soundBank = Path.Combine(folder, "Sound Bank.xwb"); + string metaData = Path.Combine(folder, "MusicPackInformation.json"); + if (!File.Exists(waveBank)) + { + ModMonitor.Log("Error loading in attempting to load music pack from: " + folder + ". There is no file Wave Bank.xwb located in this directory. AKA there is no valid music here.", LogLevel.Error); + return; + } + + if (!File.Exists(soundBank)) + { + ModMonitor.Log("Error loading in attempting to load music pack from: " + folder + ". There is no file Sound Bank.xwb located in this directory. This is needed to play the music from Wave Bank.xwb", LogLevel.Error); + return; + } + + if (!File.Exists(metaData)) + { + ModMonitor.Log("WARNING! Loading in a music pack from: " + folder + ". There is no MusicPackInformation.json associated with this music pack meaning that while songs can be played from this pack, no information about it will be displayed.", LogLevel.Error); + } + StardewSymphonyRemastered.Framework.XACTMusicPack musicPack = new XACTMusicPack(folder, waveBank); + musicManager.addMusicPack(musicPack); + } + } + + + /// + /// Raised when the player changes locations. This should determine the next song to play. + /// + /// + /// + private void LocationEvents_CurrentLocationChanged(object sender, StardewModdingAPI.Events.EventArgsCurrentLocationChanged e) + { + musicManager.selectMusic(SongSpecifics.getCurrentConditionalString()); + } + + /// + /// Events to occur after the game has loaded in. + /// + /// + /// + private void SaveEvents_AfterLoad(object sender, EventArgs e) + { + StardewSymphonyRemastered.Framework.SongSpecifics.addLocations(); + StardewSymphonyRemastered.Framework.SongSpecifics.addFestivals(); + StardewSymphonyRemastered.Framework.SongSpecifics.addEvents(); + + + + + } + + + /// + /// Reset the music files for the game. + /// + public static void Reset() + { + Game1.waveBank = DefaultWaveBank; + Game1.soundBank = DefaultSoundBank; + } + + + } +} diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj new file mode 100644 index 00000000..c90fa29f --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StardewSymphonyRemastered.csproj @@ -0,0 +1,74 @@ + + + + + Debug + AnyCPU + {19F64B03-6A9B-49E1-854A-C05D5A014646} + Library + Properties + StardewSymphonyRemastered + StardewSymphonyRemastered + 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/StardewSymphonyRemastered/StardewSymphonyRemastered/StaticExtentions.cs b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StaticExtentions.cs new file mode 100644 index 00000000..8f993536 --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/StaticExtentions.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StardewSymphonyRemastered +{ + public static class StaticExtentions + { + + public static bool isNull(this T obj) + { + if (obj == null) return true; + else return false; + } + } +} diff --git a/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/packages.config b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/packages.config new file mode 100644 index 00000000..028670c6 --- /dev/null +++ b/GeneralMods/StardewSymphonyRemastered/StardewSymphonyRemastered/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/GeneralMods/StardustCore/StaticClass.cs b/GeneralMods/StardustCore/StaticClass.cs index 20bfc5dc..df8b84d3 100644 --- a/GeneralMods/StardustCore/StaticClass.cs +++ b/GeneralMods/StardustCore/StaticClass.cs @@ -20,6 +20,7 @@ namespace StardustCore public static bool In(this T obj, params T[] args) { return args.Contains(obj); + } public static bool HasValue(this double value) diff --git a/Revitalize/Revitalize/Revitalize/Aesthetics/Draw/ThingsToDraw.cs b/Revitalize/Revitalize/Revitalize/Aesthetics/Draw/ThingsToDraw.cs index 02a90440..887331f7 100644 --- a/Revitalize/Revitalize/Revitalize/Aesthetics/Draw/ThingsToDraw.cs +++ b/Revitalize/Revitalize/Revitalize/Aesthetics/Draw/ThingsToDraw.cs @@ -22,6 +22,7 @@ namespace Revitalize.Draw public static void drawAllObjects() { + /* foreach (var v in Lists.DecorationsToDraw) { if (Game1.player.currentLocation == v.thisLocation) @@ -29,7 +30,7 @@ namespace Revitalize.Draw v.draw(Game1.spriteBatch,(int)v.tileLocation.X,(int)v.tileLocation.Y); } } - + */ } public static void drawAllFurniture() @@ -38,6 +39,7 @@ namespace Revitalize.Draw //int i = 0; SpriteBatch b = Game1.spriteBatch; b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + /* foreach (var v in Lists.DecorationsToDraw) { //Log.Async(i); @@ -48,6 +50,7 @@ namespace Revitalize.Draw } } b.End(); + */ } } } diff --git a/Revitalize/Revitalize/Revitalize/Aesthetics/Paint/PaintMenu.cs b/Revitalize/Revitalize/Revitalize/Aesthetics/Paint/PaintMenu.cs index 90c308ee..c2e8d8f5 100644 --- a/Revitalize/Revitalize/Revitalize/Aesthetics/Paint/PaintMenu.cs +++ b/Revitalize/Revitalize/Revitalize/Aesthetics/Paint/PaintMenu.cs @@ -145,9 +145,9 @@ namespace Revitalize.Menus } else { - if (this.pixels == null) Log.AsyncC("this pixels null"); - if (CanvasObject == null) Log.AsyncC("cnvas object is null"); - if (CanvasObject.pixels == null) Log.AsyncC("this canvas object ==null"); + if (this.pixels == null) //Log.AsyncC("this pixels null"); + if (CanvasObject == null) //Log.AsyncC("cnvas object is null"); + if (CanvasObject.pixels == null) //Log.AsyncC("this canvas object ==null"); this.pixels = CanvasObject.pixels; } diff --git a/Revitalize/Revitalize/Revitalize/Class1.cs b/Revitalize/Revitalize/Revitalize/Class1.cs index b189b8a7..f8bca6bf 100644 --- a/Revitalize/Revitalize/Revitalize/Class1.cs +++ b/Revitalize/Revitalize/Revitalize/Class1.cs @@ -82,9 +82,9 @@ namespace Revitalize StardewModdingAPI.Events.ControlEvents.KeyPressed += ShopCall; StardewModdingAPI.Events.ControlEvents.MouseChanged += ControlEvents_MouseChanged; StardewModdingAPI.Events.GameEvents.UpdateTick +=gameMenuCall; - StardewModdingAPI.Events.GameEvents.GameLoaded += GameEvents_GameLoaded; + StardewModdingAPI.Events.SaveEvents.AfterLoad += GameEvents_GameLoaded; StardewModdingAPI.Events.GameEvents.OneSecondTick += MapWipe; - StardewModdingAPI.Events.TimeEvents.DayOfMonthChanged += Util.ResetAllDailyBooleans; + StardewModdingAPI.Events.TimeEvents.AfterDayStarted+= Util.ResetAllDailyBooleans; StardewModdingAPI.Events.SaveEvents.BeforeSave += SaveEvents_BeforeSave; StardewModdingAPI.Events.SaveEvents.AfterSave += SaveEvents_AfterSave; StardewModdingAPI.Events.SaveEvents.AfterLoad += SaveEvents_AfterSave; @@ -234,19 +234,19 @@ namespace Revitalize if (R.name == "Town" || R.name == "town") { - Log.AsyncO("Adding Town"); + //Log.AsyncO("Adding Town"); // R = new ModTown(v.Map, v.name); } newLoc.Add(R); - Log.AsyncC("DONE1"); + //Log.AsyncC("DONE1"); } Game1.locations.Clear(); foreach (var v in newLoc) { Game1.locations.Add(v); - Log.AsyncC("DONE2"); + //Log.AsyncC("DONE2"); } - Log.AsyncC("DONE"); + //Log.AsyncC("DONE"); mapWipe = false; } @@ -312,7 +312,7 @@ namespace Revitalize { if (e.KeyPressed.ToString() == "J") { - Log.AsyncC("Mouse Position " + Game1.getMousePosition()); + //Log.AsyncC("Mouse Position " + Game1.getMousePosition()); } if (e.KeyPressed.ToString() == "O") @@ -337,8 +337,8 @@ namespace Revitalize objShopList.Add(new TestMachine(3, Vector2.Zero, Util.invertColor(LightColors.White), LightColors.White, false, 9, true)); objShopList.Add(new SpriteFontObject(0, Vector2.Zero, font.path, Color.White)); objShopList.Add(new Decoration(1391, Vector2.Zero)); - objShopList.Add(new ModularDecoration(1120, Vector2.Zero,"VanillaFurniture")); - objShopList.Add(new ModularDecoration(0, Vector2.Zero, "VanillaFurniture")); + //objShopList.Add(new ModularDecoration(1120, Vector2.Zero,"VanillaFurniture")); + //objShopList.Add(new ModularDecoration(0, Vector2.Zero, "VanillaFurniture")); objShopList.Add(new Magic.Alchemy.Objects.BagofHolding(0, Vector2.Zero, new List>() { new List() @@ -394,7 +394,7 @@ namespace Revitalize } foreach(var v in trash) { - Log.AsyncC("TRASH"); + //Log.AsyncC("TRASH"); objShopList.Remove(v); } @@ -440,8 +440,8 @@ namespace Revitalize if (e.KeyPressed.ToString() == "J") { - Log.AsyncC("Player Position " + Game1.player.getTileLocation()); - Log.AsyncC("Mouse Position " + Game1.currentCursorTile); + //Log.AsyncC("Player Position " + Game1.player.getTileLocation()); + //Log.AsyncC("Mouse Position " + Game1.currentCursorTile); } } diff --git a/Revitalize/Revitalize/Revitalize/Locations/GameLoc.cs b/Revitalize/Revitalize/Revitalize/Locations/GameLoc.cs index bc6f6433..591e3b20 100644 --- a/Revitalize/Revitalize/Revitalize/Locations/GameLoc.cs +++ b/Revitalize/Revitalize/Revitalize/Locations/GameLoc.cs @@ -622,11 +622,11 @@ namespace Revitalize public new bool performAction(string action, StardewValley.Farmer who, Location tileLocation) { - Log.AsyncG("WHY???"); + //Log.AsyncG("WHY???"); - Log.AsyncC(action); - Log.AsyncM(who); - Log.AsyncO(tileLocation); + //Log.AsyncC(action); + //Log.AsyncM(who); + //Log.AsyncO(tileLocation); if (action != null && who.IsMainPlayer) @@ -638,7 +638,7 @@ namespace Revitalize string text = array[0]; - Log.AsyncG(text); + //Log.AsyncG(text); @@ -2280,7 +2280,7 @@ namespace Revitalize */ public override bool checkAction(Location tileLocation, xTile.Dimensions.Rectangle viewport, StardewValley.Farmer who) { - Log.AsyncG("BASLLS"); + //Log.AsyncG("BASLLS"); if (this.currentEvent != null && this.currentEvent.isFestival) { diff --git a/Revitalize/Revitalize/Revitalize/Magic/Alchemy/Objects/BagofHolding.cs b/Revitalize/Revitalize/Revitalize/Magic/Alchemy/Objects/BagofHolding.cs index de697a8c..d5c0c553 100644 --- a/Revitalize/Revitalize/Revitalize/Magic/Alchemy/Objects/BagofHolding.cs +++ b/Revitalize/Revitalize/Revitalize/Magic/Alchemy/Objects/BagofHolding.cs @@ -76,7 +76,7 @@ namespace Revitalize.Magic.Alchemy.Objects this.inventory = InventoriesToAdd[0]; this.inventory.Capacity = InventoriesToAdd[0].Capacity; // this.allInventoriesCapacities.Add(this.inventory.Capacity); - Log.AsyncC("WHT THE SNAG"); + //Log.AsyncC("WHT THE SNAG"); foreach (var v in InventoriesToAdd) { // this.allInventories.Add(v); diff --git a/Revitalize/Revitalize/Revitalize/Magic/MagicFunctions.cs b/Revitalize/Revitalize/Revitalize/Magic/MagicFunctions.cs index 3f3ff5f7..bdd36e71 100644 --- a/Revitalize/Revitalize/Revitalize/Magic/MagicFunctions.cs +++ b/Revitalize/Revitalize/Revitalize/Magic/MagicFunctions.cs @@ -353,13 +353,13 @@ namespace Revitalize.Magic.MagicFunctions } catch (Exception e) { - Log.AsyncR("BAD Water SPELL"); + //Log.AsyncR("BAD Water SPELL"); } } else { - Log.AsyncC(Game1.currentCursorTile); - Log.AsyncC("Cant water here "); + //Log.AsyncC(Game1.currentCursorTile); + //Log.AsyncC("Cant water here "); } } diff --git a/Revitalize/Revitalize/Revitalize/Menus/FarmOptionsMenu.cs b/Revitalize/Revitalize/Revitalize/Menus/FarmOptionsMenu.cs index a8b04487..c71eb21a 100644 --- a/Revitalize/Revitalize/Revitalize/Menus/FarmOptionsMenu.cs +++ b/Revitalize/Revitalize/Revitalize/Menus/FarmOptionsMenu.cs @@ -146,7 +146,7 @@ namespace Revitalize.Menus private void optionButtonClick(string name) { - Log.AsyncC(name); + //Log.AsyncC(name); if (name == "Wilderness") { if (!this.wizardSource) @@ -155,9 +155,9 @@ namespace Revitalize.Menus Utilities.MapUtilities.removeAllWaterTilesFromMap(Game1.getLocationFromName("Farm")); Game1.getLocationFromName("Farm").map = Game1.game1.xTileContent.Load(g); whichFarm = 4; - Log.AsyncG("MAP SWAP!"); + //Log.AsyncG("MAP SWAP!"); Class1.persistentMapSwap.mapPath = Path.Combine(Game1.content.RootDirectory, g); - Log.AsyncG(Class1.persistentMapSwap.mapPath); + //Log.AsyncG(Class1.persistentMapSwap.mapPath); Serialize.serializeMapSwapData(Class1.persistentMapSwap); @@ -174,9 +174,9 @@ namespace Revitalize.Menus string g = Path.Combine("Maps", "Farm"); Utilities.MapUtilities.removeAllWaterTilesFromMap(Game1.getLocationFromName("Farm")); Game1.getLocationFromName("Farm").map = Game1.game1.xTileContent.Load(g); - Log.AsyncG("MAP SWAP!"); + //Log.AsyncG("MAP SWAP!"); Class1.persistentMapSwap.mapPath = Path.Combine(Game1.content.RootDirectory, g); - Log.AsyncG(Class1.persistentMapSwap.mapPath); + //Log.AsyncG(Class1.persistentMapSwap.mapPath); Serialize.serializeMapSwapData(Class1.persistentMapSwap); @@ -192,9 +192,9 @@ namespace Revitalize.Menus string g = Path.Combine("Maps", "Farm_Fishing"); Utilities.MapUtilities.removeAllWaterTilesFromMap(Game1.getLocationFromName("Farm")); Game1.getLocationFromName("Farm").map = Game1.game1.xTileContent.Load(g); - Log.AsyncG("MAP SWAP!"); + //Log.AsyncG("MAP SWAP!"); Class1.persistentMapSwap.mapPath = Path.Combine(Game1.content.RootDirectory, g); - Log.AsyncG(Class1.persistentMapSwap.mapPath); + //Log.AsyncG(Class1.persistentMapSwap.mapPath); Serialize.serializeMapSwapData(Class1.persistentMapSwap); Game1.whichFarm = 1; @@ -228,9 +228,9 @@ namespace Revitalize.Menus string g = Path.Combine("Maps", "Farm_Mining"); Utilities.MapUtilities.removeAllWaterTilesFromMap(Game1.getLocationFromName("Farm")); Game1.getLocationFromName("Farm").map = Game1.game1.xTileContent.Load(g); - Log.AsyncG("MAP SWAP!"); + //Log.AsyncG("MAP SWAP!"); Class1.persistentMapSwap.mapPath = Path.Combine(Game1.content.RootDirectory, g); - Log.AsyncG(Class1.persistentMapSwap.mapPath); + //Log.AsyncG(Class1.persistentMapSwap.mapPath); Serialize.serializeMapSwapData(Class1.persistentMapSwap); Game1.whichFarm = 3; @@ -246,9 +246,9 @@ namespace Revitalize.Menus string g = Path.Combine("Maps", "Farm_Foraging"); Utilities.MapUtilities.removeAllWaterTilesFromMap(Game1.getLocationFromName("Farm")); Game1.getLocationFromName("Farm").map = Game1.game1.xTileContent.Load(g); - Log.AsyncG("MAP SWAP!"); + //Log.AsyncG("MAP SWAP!"); Class1.persistentMapSwap.mapPath = Path.Combine(Game1.content.RootDirectory, g); - Log.AsyncG(Class1.persistentMapSwap.mapPath); + //Log.AsyncG(Class1.persistentMapSwap.mapPath); Serialize.serializeMapSwapData(Class1.persistentMapSwap); @@ -277,10 +277,10 @@ namespace Revitalize.Menus c.map = v.map; // whichFarm = count; - Log.AsyncG("MAP SWAP!"); + //Log.AsyncG("MAP SWAP!"); Class1.persistentMapSwap.mapPath= Path.Combine(Game1.content.RootDirectory,"Maps","Farms", v.clicky.name,v.clicky.name); Class1.persistentMapSwap.folderPath = Path.Combine(Game1.content.RootDirectory, "Maps", "Farms", v.clicky.name); - Log.AsyncG(Class1.persistentMapSwap.mapPath); + //Log.AsyncG(Class1.persistentMapSwap.mapPath); //Game1.getLocationFromName("Farm").map = Game1.game1.xTileContent.Load(Class1.persistentMapSwap.mapPath); Serialize.serializeMapSwapData(Class1.persistentMapSwap); // Util.removeAllWaterTilesFromMap(c); @@ -658,7 +658,7 @@ namespace Revitalize.Menus string[] spliiter=v.Split('\\'); string fileName = spliiter.ElementAt(spliiter.Length-1); string s = fileName; - Log.AsyncC(v); + //Log.AsyncC(v); fileName= Path.Combine(v.Remove(0, 8),s); try { @@ -672,14 +672,14 @@ namespace Revitalize.Menus catch(Exception e) { if (e.ToString().Contains("FarmIcons")) continue; - Log.AsyncR(e); + //Log.AsyncR(e); } } foreach (var v in fi) { dir2.Add(Path.GetFileNameWithoutExtension(v)); - Log.AsyncC(v); + //Log.AsyncC(v); string f=Path.GetDirectoryName(v); string[] spliiter = f.Split('\\'); string fileName = spliiter.ElementAt(spliiter.Length-1); @@ -694,7 +694,7 @@ namespace Revitalize.Menus } catch(Exception e) { - Log.AsyncR(e); + //Log.AsyncR(e); } } @@ -703,7 +703,7 @@ namespace Revitalize.Menus { // Log.AsyncC("BOO"); farmTypeButtons.Add(k.clicky); - Log.AsyncC(k.clicky.name); + //Log.AsyncC(k.clicky.name); } //TODO: CHECK THE DIRECTORY AND ADD ALL DATA NODES TO THIS LIST @@ -733,7 +733,7 @@ namespace Revitalize.Menus catch(Exception e) { - Log.AsyncO(e); + //Log.AsyncO(e); return Game1.mouseCursors; } diff --git a/Revitalize/Revitalize/Revitalize/Menus/GameMenu.cs b/Revitalize/Revitalize/Revitalize/Menus/GameMenu.cs index bda2410e..9c0b21bd 100644 --- a/Revitalize/Revitalize/Revitalize/Menus/GameMenu.cs +++ b/Revitalize/Revitalize/Revitalize/Menus/GameMenu.cs @@ -358,7 +358,7 @@ namespace Revitalize.Menus if (current.containsPoint(x, y)) { this.hoverText = current.label; - Log.AsyncM(current.value); + //Log.AsyncM(current.value); return; } } diff --git a/Revitalize/Revitalize/Revitalize/Menus/ItemGrabMenu.cs b/Revitalize/Revitalize/Revitalize/Menus/ItemGrabMenu.cs index 37eca3ea..657f68be 100644 --- a/Revitalize/Revitalize/Revitalize/Menus/ItemGrabMenu.cs +++ b/Revitalize/Revitalize/Revitalize/Menus/ItemGrabMenu.cs @@ -257,7 +257,7 @@ namespace Revitalize.Menus { this.heldItem = this.ItemsToGrabMenu.leftClick(x, y, this.heldItem, false); Util.addItemToOtherInventory(this.ItemsToGrabMenu.actualInventory, this.heldItem); - Log.AsyncG("not full"); + //Log.AsyncG("not full"); } else { @@ -305,7 +305,7 @@ namespace Revitalize.Menus } // j= this.ItemsToGrabMenu.leftClick(x, y, this.heldItem, false); Util.addItemToOtherInventory(this.ItemsToGrabMenu.actualInventory, i); - Log.AsyncG("item swap"); + //Log.AsyncG("item swap"); Game1.activeClickableMenu = new ItemGrabMenu(this.ItemsToGrabMenu.actualInventory,this.Rows, false, true, new InventoryMenu.highlightThisItem(InventoryMenu.highlightAllItems), this.behaviorFunction, null, this.behaviorOnItemGrab, false, true, true, true, true, this.source, this.sourceItem); Game1.playSound("Ship"); this.heldItem = null; diff --git a/Revitalize/Revitalize/Revitalize/Menus/Machines/MachineInventory.cs b/Revitalize/Revitalize/Revitalize/Menus/Machines/MachineInventory.cs index a45b75d0..cb98a98e 100644 --- a/Revitalize/Revitalize/Revitalize/Menus/Machines/MachineInventory.cs +++ b/Revitalize/Revitalize/Revitalize/Menus/Machines/MachineInventory.cs @@ -83,10 +83,10 @@ namespace Revitalize.Menus.Machines { machine = Machine; Rows = rows; - Log.AsyncC(InputInventory.Capacity); + //Log.AsyncC(InputInventory.Capacity); this.inputInventory = new StardewValley.Menus.InventoryMenu(this.xPositionOnScreen + Game1.tileSize / 2, this.yPositionOnScreen, false, InputInventory, null, 9, 3, 0, 0, true); this.outputInventory = new StardewValley.Menus.InventoryMenu(this.xPositionOnScreen + Game1.tileSize *8, this.yPositionOnScreen, false, OutputInventory, null, 9, 3, 0, 0, true); - Log.AsyncM(this.inputInventory.actualInventory.Capacity); + //Log.AsyncM(this.inputInventory.actualInventory.Capacity); this.inputInventory.capacity = 9; this.outputInventory.capacity = 9; this.inputInventory.actualInventory.Capacity = 9; @@ -136,7 +136,7 @@ namespace Revitalize.Menus.Machines } this.inputInventory = new InventoryMenu(this.xPositionOnScreen + Game1.tileSize / 2, this.yPositionOnScreen, false, InputInventory, highlightFunction, 9, 3, 0, 0, true); this.outputInventory = new StardewValley.Menus.InventoryMenu(this.xPositionOnScreen + Game1.tileSize * 8, this.yPositionOnScreen, false, OutputInventory, null, 9, 3, 0, 0, true); - Log.AsyncM(this.inputInventory.actualInventory.Capacity); + //Log.AsyncM(this.inputInventory.actualInventory.Capacity); this.inputInventory.capacity = 9; this.inputInventory.capacity = 9; this.inputInventory.actualInventory.Capacity = 9; @@ -322,7 +322,7 @@ namespace Revitalize.Menus.Machines if (this.inputInventory.actualInventory == null) { - Log.AsyncG("WTF HOW IS THIS NULL!?!?!?!?!"); + //Log.AsyncG("WTF HOW IS THIS NULL!?!?!?!?!"); } bool f = Util.isInventoryFull(this.inputInventory.actualInventory,true); if (f == false) @@ -337,9 +337,9 @@ namespace Revitalize.Menus.Machines Util.addItemToOtherInventory(this.inputInventory.actualInventory, this.heldItem); // Log.AsyncG("item swap"); - if (this.machine == null) Log.AsyncC("OK MY MACHINE IS NULL"); - if (this.inputInventory == null) Log.AsyncG("Input is null"); - if (this.outputInventory == null) Log.AsyncO("output is null"); + if (this.machine == null) //Log.AsyncC("OK MY MACHINE IS NULL"); + if (this.inputInventory == null) //Log.AsyncG("Input is null"); + if (this.outputInventory == null) //Log.AsyncO("output is null"); //Game1.activeClickableMenu = new MachineInventory(this.machine, this.inputInventory.actualInventory,this.outputInventory.actualInventory, this.Rows, false, true, new InventoryMenu.highlightThisItem(InventoryMenu.highlightAllItems), this.behaviorFunction, null, this.behaviorOnItemGrab, false, true, true, true, true, this.source, this.sourceItem); Game1.activeClickableMenu = new Revitalize.Menus.Machines.MachineInventory(this.machine, this.inputInventory.actualInventory, this.outputInventory.actualInventory, 3); // Game1.playSound("Ship"); @@ -351,7 +351,7 @@ namespace Revitalize.Menus.Machines } else { - Log.AsyncO("Inventory is full?????"); + //Log.AsyncO("Inventory is full?????"); return; } // this.inputInventory.inventory.Add(new ClickableComponent(new Rectangle(inputInventory.xPositionOnScreen + inputInventory.actualInventory.Count-1 % (this.capacity / this.inputInventory.rows) * Game1.tileSize + this.inputInventory.horizontalGap * (inputInventory.actualInventory.Count-1 % (this.capacity / this.inputInventory.rows)), inputInventory.yPositionOnScreen + inputInventory.actualInventory.Count-1 / (this.capacity / this.inputInventory.rows) * (Game1.tileSize + this.inputInventory.verticalGap) + (inputInventory.actualInventory.Count-1 / (this.capacity / this.inputInventory.rows) - 1) * Game1.pixelZoom - (Game1.tileSize / 5), Game1.tileSize, Game1.tileSize), string.Concat(inputInventory.actualInventory.Count-1))); @@ -370,7 +370,7 @@ namespace Revitalize.Menus.Machines //outputInventory.actualInventory.Add(new Decoration(3, Vector2.Zero)); if (this.outputInventory.actualInventory == null) { - Log.AsyncG("WTF HOW IS THIS NULL!?!?!?!?!"); + //Log.AsyncG("WTF HOW IS THIS NULL!?!?!?!?!"); } this.heldItem = this.outputInventory.leftClick(x, y, this.heldItem, false); @@ -448,9 +448,9 @@ namespace Revitalize.Menus.Machines // j= this.inputInventory.leftClick(x, y, this.heldItem, false); // Util.addItemToOtherInventory(this.inputInventory.actualInventory, i); // Log.AsyncG("item swap"); - if (this.machine == null) Log.AsyncC("OK MY MACHINE IS NULL"); - if (this.inputInventory == null) Log.AsyncG("Input is null"); - if (this.outputInventory == null) Log.AsyncO("output is null"); + if (this.machine == null) //Log.AsyncC("OK MY MACHINE IS NULL"); + if (this.inputInventory == null) //Log.AsyncG("Input is null"); + if (this.outputInventory == null) //Log.AsyncO("output is null"); //Game1.activeClickableMenu = new MachineInventory(this.machine, this.inputInventory.actualInventory,this.outputInventory.actualInventory, this.Rows, false, true, new InventoryMenu.highlightThisItem(InventoryMenu.highlightAllItems), this.behaviorFunction, null, this.behaviorOnItemGrab, false, true, true, true, true, this.source, this.sourceItem); Game1.activeClickableMenu = new Revitalize.Menus.Machines.MachineInventory(this.machine, this.inputInventory.actualInventory, this.outputInventory.actualInventory, 3); // Game1.playSound("Ship"); diff --git a/Revitalize/Revitalize/Revitalize/Objects/Machines/Quarry.cs b/Revitalize/Revitalize/Revitalize/Objects/Machines/Quarry.cs index b684a948..42f22293 100644 --- a/Revitalize/Revitalize/Revitalize/Objects/Machines/Quarry.cs +++ b/Revitalize/Revitalize/Revitalize/Objects/Machines/Quarry.cs @@ -53,7 +53,7 @@ namespace Revitalize.Objects.Machines bool works= Dictionaries.quarryList.TryGetValue(resourceName, out t); if (works == false) { - Log.AsyncR("ERROR, invalid resource type for quarry."); + //Log.AsyncR("ERROR, invalid resource type for quarry."); return; } else @@ -133,7 +133,7 @@ namespace Revitalize.Objects.Machines bool works = Dictionaries.quarryList.TryGetValue(resourceName, out t); if (works == false) { - Log.AsyncR("ERROR, invalid resource type for quarry."); + ////Log.AsyncR("ERROR, invalid resource type for quarry."); return; } else @@ -267,7 +267,7 @@ namespace Revitalize.Objects.Machines bool works = Dictionaries.quarryList.TryGetValue(ResourceName, out t); if (works == false) { - Log.AsyncR("ERROR, invalid resource type for quarry."); + ////Log.AsyncR("ERROR, invalid resource type for quarry."); return false; } else @@ -586,7 +586,7 @@ namespace Revitalize.Objects.Machines // Log.Info(this.Decoration_type); if (this.lightSource != null) this.lightSource.color = new Color(0, 255, 255, 255); //THE COLORS ARE REVERSED!!!!!!!!!!!! this.minutesUntilReady = (this.minutesUntilReady - minutes); - Log.Info("minues remaining" + this.minutesUntilReady); + ////Log.Info("minues remaining" + this.minutesUntilReady); // if(this.output!= null) Log.Info("stack size"+this.output.stack); if (Game1.isDarkOut()) diff --git a/Revitalize/Revitalize/Revitalize/Objects/Machines/Spawner.cs b/Revitalize/Revitalize/Revitalize/Objects/Machines/Spawner.cs index 2a52a23b..af73c312 100644 --- a/Revitalize/Revitalize/Revitalize/Objects/Machines/Spawner.cs +++ b/Revitalize/Revitalize/Revitalize/Objects/Machines/Spawner.cs @@ -535,10 +535,10 @@ namespace Revitalize.Objects.Machines if (minutesUntilReady == 0) { - Log.AsyncC(this.name + "Is ready!"); - Log.AsyncC(Game1.player.getStandingPosition()); + // Log.AsyncC(this.name + "Is ready!"); + // Log.AsyncC(Game1.player.getStandingPosition()); Vector2 v2 = new Vector2(this.tileLocation.X * Game1.tileSize, this.tileLocation.Y * Game1.tileSize); - Log.AsyncC(v2); + //Log.AsyncC(v2); //Game1.createItemDebris((Item)this.heldObject, v2, Game1.player.getDirection()); if (this.heldObject != null) { @@ -832,9 +832,9 @@ namespace Revitalize.Objects.Machines } } this.updateDrawPosition(); - Log.AsyncO(this.boundingBox); - Log.AsyncO(x); - Log.AsyncY(y); + //Log.AsyncO(this.boundingBox); + //Log.AsyncO(x); + //Log.AsyncY(y); for (int i = 0; i <= this.boundingBox.X / Game1.tileSize; i++) { return Util.placementAction(this, location, x+1, y, who); diff --git a/Revitalize/Revitalize/Revitalize/Objects/Machines/TestMachine.cs b/Revitalize/Revitalize/Revitalize/Objects/Machines/TestMachine.cs index 8567fbdc..ee2490f4 100644 --- a/Revitalize/Revitalize/Revitalize/Objects/Machines/TestMachine.cs +++ b/Revitalize/Revitalize/Revitalize/Objects/Machines/TestMachine.cs @@ -260,13 +260,13 @@ namespace Revitalize.Objects.Machines //Game1.activeClickableMenu = new Revitalize.Menus.LightCustomizer(this); if (this.inputInventory == null) { - Log.AsyncG(">>>>>>>>??????????????????>>>>>>>>>>>>>"); + //Log.AsyncG(">>>>>>>>??????????????????>>>>>>>>>>>>>"); } if (this.outputInventory == null) { - Log.AsyncC(">??????????????"); + //Log.AsyncC(">??????????????"); } - Log.AsyncM(this.GetType()); + //Log.AsyncM(this.GetType()); // this.outputInventory.Add(new Revitalize.Objects.Light(0, Vector2.Zero, LightColors.Azure, LightColors.Azure)); Game1.activeClickableMenu = new Revitalize.Menus.Machines.MachineInventory(this, this.inputInventory, this.outputInventory, 3); return false; diff --git a/Revitalize/Revitalize/Revitalize/Resources/Lists.cs b/Revitalize/Revitalize/Revitalize/Resources/Lists.cs index c7a0ab8e..38e929ef 100644 --- a/Revitalize/Revitalize/Revitalize/Resources/Lists.cs +++ b/Revitalize/Revitalize/Revitalize/Resources/Lists.cs @@ -16,7 +16,7 @@ namespace Revitalize.Resources public static List trackedTerrainFeaturesDummyList; public static List trackedObjectList; - public static List DecorationsToDraw; + //public static List DecorationsToDraw; public static List serializerTypes; public static List saplingNames; @@ -28,7 +28,7 @@ namespace Revitalize.Resources trackedObjectList = new List(); WeatherDebrisSystem.thisWeatherDebris = new List(); - DecorationsToDraw = new List(); + //DecorationsToDraw = new List(); } public static void loadAllListsAfterMovement() diff --git a/Revitalize/Revitalize/Revitalize/Serialize.cs b/Revitalize/Revitalize/Revitalize/Serialize.cs index 40695833..bbc8eea3 100644 --- a/Revitalize/Revitalize/Revitalize/Serialize.cs +++ b/Revitalize/Revitalize/Revitalize/Serialize.cs @@ -78,7 +78,7 @@ namespace Revitalize { idk.Add(d); } - Log.AsyncC("Progress on saving objects: " + countProcessed + "/" + Lists.trackedObjectList.Count); + //Log.AsyncC("Progress on saving objects: " + countProcessed + "/" + Lists.trackedObjectList.Count); removalList.Add(d); } } @@ -103,14 +103,14 @@ namespace Revitalize { t.worldObj.Invoke(v as CoreObject); } - Log.AsyncG("Progress on saving objects: " + countProcessed + "/" + Lists.trackedObjectList.Count); + //Log.AsyncG("Progress on saving objects: " + countProcessed + "/" + Lists.trackedObjectList.Count); removalList.Add(v as CoreObject); } } } removalList.Clear(); - Log.AsyncM("Revitalize: Done cleaning world for saving."); + //Log.AsyncM("Revitalize: Done cleaning world for saving."); } @@ -160,7 +160,7 @@ namespace Revitalize } removalList.Clear(); - Log.AsyncM("Revitalize: Done cleaning inventory!"); + //Log.AsyncM("Revitalize: Done cleaning inventory!"); } /// @@ -247,7 +247,7 @@ namespace Revitalize string a; string[] b; string s=""; - Log.AsyncC(path); + //Log.AsyncC(path); // Log.AsyncC(data); try { @@ -287,7 +287,7 @@ namespace Revitalize } } - Log.AsyncG("attempting to parse from path and value of s is " + s); + //Log.AsyncG("attempting to parse from path and value of s is " + s); } // var cObj = parseBagOfHolding(path); //pair.Value.parse.Invoke(path); @@ -443,7 +443,7 @@ namespace Revitalize continue; } } - Log.AsyncC("CHECK RESULTS " + false); + ////Log.AsyncC("CHECK RESULTS " + false); return false; // XElement school = doc.Element("School"); // school.Add(new XAttribute("ID", "ID_Value")); @@ -475,12 +475,12 @@ namespace Revitalize private static void serializer_UnknownAttribute(object sender, XmlAttributeEventArgs e) { - Log.AsyncR(e); + //Log.AsyncR(e); } private static void serializer_UnknownNode(object sender, XmlNodeEventArgs e) { - Log.AsyncR(e); + //Log.AsyncR(e); } public static void serializeMapSwapData(MapSwapData d) @@ -989,7 +989,7 @@ namespace Revitalize d.lightsOn = obj.lightsOn; // d.thisLocation = Game1.getLocationFromName(loc); // d.thisLocation = obj.thisLocation; - Log.AsyncC(d.thisLocation); + //Log.AsyncC(d.thisLocation); d.lightColor = obj.lightColor; d.thisType = obj.thisType; d.removable = obj.removable; @@ -1003,7 +1003,7 @@ namespace Revitalize } catch (Exception e) { - Log.AsyncM(e); + //Log.AsyncM(e); return null; } @@ -1085,7 +1085,7 @@ namespace Revitalize d.lightsOn = obj.lightsOn; // d.thisLocation = Game1.getLocationFromName(loc); // d.thisLocation = obj.thisLocation; - Log.AsyncC(d.thisLocation); + //Log.AsyncC(d.thisLocation); d.lightColor = obj.lightColor; d.thisType = obj.thisType; d.removable = obj.removable; @@ -1099,7 +1099,7 @@ namespace Revitalize } catch (Exception e) { - Log.AsyncM(e); + //Log.AsyncM(e); return null; } @@ -1221,7 +1221,7 @@ namespace Revitalize d.lightsOn = obj.lightsOn; // d.thisLocation = Game1.getLocationFromName(loc); // d.thisLocation = obj.thisLocation; - Log.AsyncC(d.thisLocation); + ////Log.AsyncC(d.thisLocation); d.lightColor = obj.lightColor; d.thisType = obj.thisType; d.removable = obj.removable; @@ -1235,7 +1235,7 @@ namespace Revitalize } catch (Exception e) { - Log.AsyncM(e); + //Log.AsyncM(e); return null; } } @@ -1577,7 +1577,7 @@ namespace Revitalize { serializer.TypeNameHandling = TypeNameHandling.Auto; serializer.NullValueHandling = NullValueHandling.Ignore; - Log.AsyncG("DESERIALIZE THE WORLD"); + ////Log.AsyncG("DESERIALIZE THE WORLD"); return base.ReadJson(reader, objectType, existingValue, serializer); } @@ -1614,7 +1614,7 @@ namespace Revitalize TextReader reader = null; try { - Log.AsyncC(filePath); + ////Log.AsyncC(filePath); reader = new StreamReader(filePath); var fileContents = reader.ReadToEnd(); diff --git a/Revitalize/Revitalize/Revitalize/SetUp.cs b/Revitalize/Revitalize/Revitalize/SetUp.cs index 0a41ce1a..24590c76 100644 --- a/Revitalize/Revitalize/Revitalize/SetUp.cs +++ b/Revitalize/Revitalize/Revitalize/SetUp.cs @@ -27,7 +27,7 @@ namespace Revitalize PlayerVariables.initializePlayerVariables(); - Log.AsyncG("Revitalize: Running on API Version: " + StardewModdingAPI.Constants.ApiVersion); + //Log.AsyncG("Revitalize: Running on API Version: " + StardewModdingAPI.Constants.ApiVersion); Lists.loadAllListsAtEntry(); diff --git a/Revitalize/Revitalize/Revitalize/Settings/MachineSettings.cs b/Revitalize/Revitalize/Revitalize/Settings/MachineSettings.cs index cf4c6518..162e7f8d 100644 --- a/Revitalize/Revitalize/Revitalize/Settings/MachineSettings.cs +++ b/Revitalize/Revitalize/Revitalize/Settings/MachineSettings.cs @@ -38,7 +38,7 @@ namespace Revitalize.Settings } catch (Exception e) { - Log.AsyncR("Failed to load Machine Settings"); + ////Log.AsyncR("Failed to load Machine Settings"); } } diff --git a/Revitalize/Revitalize/Revitalize/Settings/PaintSettings.cs b/Revitalize/Revitalize/Revitalize/Settings/PaintSettings.cs index 3884cabd..3ddc6520 100644 --- a/Revitalize/Revitalize/Revitalize/Settings/PaintSettings.cs +++ b/Revitalize/Revitalize/Revitalize/Settings/PaintSettings.cs @@ -22,12 +22,12 @@ namespace Revitalize.Settings if (File.Exists(Path.Combine(Class1.path, "xnb_node.cmd"))) { PaintEnabled = true; - Log.AsyncG("Revitalize: Paint Module Enabled"); + //Log.AsyncG("Revitalize: Paint Module Enabled"); } else { PaintEnabled = false; - Log.AsyncG("Revitalize: Paint Module Disabled"); + //Log.AsyncG("Revitalize: Paint Module Disabled"); } } diff --git a/Revitalize/Revitalize/Revitalize/Settings/SettingsManager.cs b/Revitalize/Revitalize/Revitalize/Settings/SettingsManager.cs index 38ba80ec..26b78941 100644 --- a/Revitalize/Revitalize/Revitalize/Settings/SettingsManager.cs +++ b/Revitalize/Revitalize/Revitalize/Settings/SettingsManager.cs @@ -48,7 +48,7 @@ namespace Revitalize.Settings } catch(Exception e) { - Log.AsyncR(e); + //Log.AsyncR(e); } } } diff --git a/Revitalize/Revitalize/Revitalize/Utilities/MapUtilities.cs b/Revitalize/Revitalize/Revitalize/Utilities/MapUtilities.cs index 04d20978..6f3bc447 100644 --- a/Revitalize/Revitalize/Revitalize/Utilities/MapUtilities.cs +++ b/Revitalize/Revitalize/Revitalize/Utilities/MapUtilities.cs @@ -81,8 +81,8 @@ namespace Revitalize.Utilities public static void removeAllWaterTilesFromMap(GameLocation c) { - Log.AsyncM(c.map.Layers[0].LayerWidth); - Log.AsyncM(c.map.Layers[0].LayerHeight); + //Log.AsyncM(c.map.Layers[0].LayerWidth); + //Log.AsyncM(c.map.Layers[0].LayerHeight); for (int i = 0; i < c.map.Layers[0].LayerWidth; i++) { for (int j = 0; j < c.map.Layers[0].LayerHeight; j++) @@ -97,9 +97,9 @@ namespace Revitalize.Utilities } } - Log.AsyncY("Position: " + i +" of "+ c.map.Layers[0].LayerWidth); + //Log.AsyncY("Position: " + i +" of "+ c.map.Layers[0].LayerWidth); } - Log.AsyncC("Removed All Water Tiles from " + c.name); + //Log.AsyncC("Removed All Water Tiles from " + c.name); } public static Vector2 getMapDimensions(GameLocation loc) @@ -131,7 +131,7 @@ namespace Revitalize.Utilities } } - Log.AsyncY("Position: " + i + " of " + newLoc.map.Layers[0].LayerWidth); + //Log.AsyncY("Position: " + i + " of " + newLoc.map.Layers[0].LayerWidth); } newLoc.waterTiles = newWaterTiles; return; @@ -151,7 +151,7 @@ namespace Revitalize.Utilities } foreach (string file in s) { - Log.AsyncO(file); + //Log.AsyncO(file); string[] reader = File.ReadAllLines(file); try { @@ -160,7 +160,7 @@ namespace Revitalize.Utilities } catch (Exception err) { - Log.AsyncR(err); + //Log.AsyncR(err); } } } diff --git a/Revitalize/Revitalize/Revitalize/Utilities/Util.cs b/Revitalize/Revitalize/Revitalize/Utilities/Util.cs index 81ab1f39..3bc2f683 100644 --- a/Revitalize/Revitalize/Revitalize/Utilities/Util.cs +++ b/Revitalize/Revitalize/Revitalize/Utilities/Util.cs @@ -25,7 +25,7 @@ namespace Revitalize { public static bool hasWateredAllCropsToday; - public static void ResetAllDailyBooleans(object sender, EventArgsIntChanged e) + public static void ResetAllDailyBooleans(object sender, EventArgs e) { SetUp.createDirectories(); hasWateredAllCropsToday = false; @@ -100,8 +100,8 @@ namespace Revitalize { if (logInfo) { - Log.AsyncG("size " + inventory.Count); - Log.AsyncG("max " + inventory.Capacity); + //Log.AsyncG("size " + inventory.Count); + //Log.AsyncG("max " + inventory.Capacity); } if (inventory.Count == inventory.Capacity) return true; @@ -757,7 +757,7 @@ namespace Revitalize else { // Game1.showRedMessage("STEP 2"); - Log.Info(vector); + //Log.Info(vector); Vector2 newVec = new Vector2(vector.X, vector.Y); // cObj.boundingBox.Inflate(32, 32); @@ -768,7 +768,7 @@ namespace Revitalize if(playSound==true) Game1.playSound("woodyStep"); else { - Log.AsyncG("restoring item from file"); + //Log.AsyncG("restoring item from file"); } //Log.AsyncM("Placed and object"); cObj.locationsName = location.name; @@ -788,10 +788,10 @@ namespace Revitalize public static void plantCropHere() { - Log.AsyncY(Game1.player.ActiveObject.name); + //Log.AsyncY(Game1.player.ActiveObject.name); if (Lists.saplingNames.Contains(Game1.player.ActiveObject.name)) { - Log.AsyncY("PLANT THE SAPLING"); + //Log.AsyncY("PLANT THE SAPLING"); bool f = plantSappling(); if (f == true) return; @@ -907,7 +907,7 @@ namespace Revitalize Game1.showRedMessage("Can't be planted here."); return false; } - Log.AsyncR("MAKES NO SENSE"); + //Log.AsyncR("MAKES NO SENSE"); return false; } @@ -962,21 +962,21 @@ namespace Revitalize Class1.persistentMapSwap = Serialize.parseMapSwapData(); if (Class1.persistentMapSwap == null) { - Log.AsyncG("IS NULL"); + //Log.AsyncG("IS NULL"); Class1.persistentMapSwap = new MapSwapData(); } else { try { - Log.AsyncM(parseOutContent(Class1.persistentMapSwap.mapPath)); + //Log.AsyncM(parseOutContent(Class1.persistentMapSwap.mapPath)); m = Game1.content.Load(parseOutContent(Class1.persistentMapSwap.mapPath)); - Log.AsyncG("Successfully loaded custom farm map."); + //Log.AsyncG("Successfully loaded custom farm map."); } catch (Exception err) { m = null; - Log.AsyncM(err); + //Log.AsyncM(err); } @@ -990,14 +990,14 @@ namespace Revitalize bool[,] oldWaterTiles = v.waterTiles; v.map = m;//change this to v.map =(Game1.content.Load("Path.Combine("Maps,"Farms",folderName,"Farm"))); - Log.AsyncG("Sucesfully injected custom farm map"); + //Log.AsyncG("Sucesfully injected custom farm map"); Utilities.MapUtilities.loadCustomFarmMap(v, oldLocDimensions, oldWaterTiles); } } } else { - Log.AsyncM("WTF"); + //Log.AsyncM("WTF"); } } }