aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-04-06 10:17:19 -0400
committerlempamo <[email protected]>2017-04-06 10:17:19 -0400
commit9a8949cffcd454f6297923c7001cfb036604e02f (patch)
treef974f5cb6d1cf892ac97a7381a536eac629aebd6 /ShiftOS_TheReturn
parent07376e9ecd6687b2c4278661d0eaf3795d5124c3 (diff)
downloadshiftos_thereturn-9a8949cffcd454f6297923c7001cfb036604e02f.tar.gz
shiftos_thereturn-9a8949cffcd454f6297923c7001cfb036604e02f.tar.bz2
shiftos_thereturn-9a8949cffcd454f6297923c7001cfb036604e02f.zip
language changing actually works
Diffstat (limited to 'ShiftOS_TheReturn')
-rw-r--r--ShiftOS_TheReturn/Commands.cs29
-rw-r--r--ShiftOS_TheReturn/Localization.cs6
-rw-r--r--ShiftOS_TheReturn/SaveSystem.cs3
3 files changed, 37 insertions, 1 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()
{
diff --git a/ShiftOS_TheReturn/Localization.cs b/ShiftOS_TheReturn/Localization.cs
index a9d24b8..c1a6bd6 100644
--- a/ShiftOS_TheReturn/Localization.cs
+++ b/ShiftOS_TheReturn/Localization.cs
@@ -67,6 +67,12 @@ namespace ShiftOS.Engine
var path = "english.local";
Utils.WriteAllText(Paths.GetPath(path), lines);
}
+ else if (SaveSystem.CurrentSave == null)
+ {
+ var lines = Properties.Resources.strings_en;
+ var path = "english.local";
+ Utils.WriteAllText(Paths.GetPath(path), lines);
+ }
else
{
_provider.WriteTranscript();
diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs
index 5188bf1..9ff3111 100644
--- a/ShiftOS_TheReturn/SaveSystem.cs
+++ b/ShiftOS_TheReturn/SaveSystem.cs
@@ -70,7 +70,6 @@ namespace ShiftOS.Engine
root.permissions = Permissions.All;
System.IO.File.WriteAllText(Paths.SaveFile, JsonConvert.SerializeObject(root));
}
- CurrentSave.Language = Localization.GetLanguageID();
if (Utils.Mounts.Count == 0)
Utils.Mount(System.IO.File.ReadAllText(Paths.SaveFile));
@@ -176,6 +175,8 @@ namespace ShiftOS.Engine
}
+ Localization.SetupTHETRUEDefaultLocals();
+
Shiftorium.Init();
while (CurrentSave.StoryPosition < 1)