diff options
| author | lempamo <[email protected]> | 2017-04-06 10:17:19 -0400 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-04-06 10:17:19 -0400 |
| commit | 9a8949cffcd454f6297923c7001cfb036604e02f (patch) | |
| tree | f974f5cb6d1cf892ac97a7381a536eac629aebd6 /ShiftOS_TheReturn/Commands.cs | |
| parent | 07376e9ecd6687b2c4278661d0eaf3795d5124c3 (diff) | |
| download | shiftos_thereturn-9a8949cffcd454f6297923c7001cfb036604e02f.tar.gz shiftos_thereturn-9a8949cffcd454f6297923c7001cfb036604e02f.tar.bz2 shiftos_thereturn-9a8949cffcd454f6297923c7001cfb036604e02f.zip | |
language changing actually works
Diffstat (limited to 'ShiftOS_TheReturn/Commands.cs')
| -rw-r--r-- | ShiftOS_TheReturn/Commands.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs index 9f85a25..fedff19 100644 --- a/ShiftOS_TheReturn/Commands.cs +++ b/ShiftOS_TheReturn/Commands.cs @@ -357,6 +357,35 @@ namespace ShiftOS.Engine return true; } + [Command("lang", usage = "{{COMMAND_SOS_LANG_USAGE}}", description = "{{COMMAND_SOS_LANG_DESCRIPTION}}")] + [RequiresArgument("language")] + public static bool SetLanguage(Dictionary<string, object> userArgs) + { + try + { + string lang = ""; + + if (userArgs.ContainsKey("language")) + lang = (string)userArgs["language"]; + else + throw new Exception("You must specify a valid 'language' value."); + + if (Localization.GetAllLanguages().Contains(lang)) + { + SaveSystem.CurrentSave.Language = lang; + SaveSystem.SaveGame(); + Console.WriteLine("{LANGUAGE_CHANGED}"); + return true; + } + + throw new Exception($"Couldn't find language with ID: {lang}"); + } + catch + { + return false; + } + } + [Command("help", "{COMMAND_HELP_USAGE}", "{COMMAND_HELP_DESCRIPTION}")] public static bool Help() { |
