diff options
| author | Michael <[email protected]> | 2017-06-02 11:38:38 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-06-02 11:38:38 -0400 |
| commit | 11e80a6a6134e2cbee1041d6ddc95781a265bead (patch) | |
| tree | 033f8d78a4e40986849e4d6be11f10e04d4c2c7e /ShiftOS_TheReturn/Commands.cs | |
| parent | bae2c837573d01ee4c8e6548a3ebd2a3df8f054d (diff) | |
| download | shiftos_thereturn-11e80a6a6134e2cbee1041d6ddc95781a265bead.tar.gz shiftos_thereturn-11e80a6a6134e2cbee1041d6ddc95781a265bead.tar.bz2 shiftos_thereturn-11e80a6a6134e2cbee1041d6ddc95781a265bead.zip | |
fix the audio system
Diffstat (limited to 'ShiftOS_TheReturn/Commands.cs')
| -rw-r--r-- | ShiftOS_TheReturn/Commands.cs | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs index ec89539..e379a50 100644 --- a/ShiftOS_TheReturn/Commands.cs +++ b/ShiftOS_TheReturn/Commands.cs @@ -383,26 +383,48 @@ namespace ShiftOS.Engine [Namespace("sos")] public static class ShiftOSCommands { - [Command("setsfxvolume", description = "Set the volume of various sound effects to a value between 1 and 100.")] + + [Command("setsfxenabled", description = "Set whether or not sound effects are enabled in the system.")] [RequiresArgument("value")] - public static bool SetSfxVolume(Dictionary<string, object> args) + public static bool SetSfxEnabled(Dictionary<string, object> args) { - int value = int.Parse(args["value"].ToString()); - if (value >= 0 && value <= 100) + try { - SaveSystem.CurrentSave.SfxVolume = value; + bool value = Convert.ToBoolean(args["value"].ToString()); + SaveSystem.CurrentSave.SoundEnabled = value; SaveSystem.SaveGame(); } - else + catch { - Console.WriteLine("Volume must be between 0 and 100!"); + Console.WriteLine("Error: Value must be either true or false."); } return true; } - [Command("setmusicvolume", description ="Set the music volume to a value between 1 and 100.")] + + + [Command("setmusicenabled", description = "Set whether or not music is enabled in the system.")] [RequiresArgument("value")] - public static bool SetMusicVolume(Dictionary<string, object> args) + public static bool SetMusicEnabled(Dictionary<string, object> args) + { + try + { + bool value = Convert.ToBoolean(args["value"].ToString()); + SaveSystem.CurrentSave.MusicEnabled = value; + SaveSystem.SaveGame(); + } + catch + { + Console.WriteLine("Error: Value must be either true or false."); + } + return true; + } + + + + [Command("setsfxvolume", description ="Set the system sound volume to a value between 1 and 100.")] + [RequiresArgument("value")] + public static bool SetSfxVolume(Dictionary<string, object> args) { int value = int.Parse(args["value"].ToString()); if(value >= 0 && value <= 100) |
