diff options
| author | william341 <[email protected]> | 2017-06-19 12:16:31 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-06-19 12:16:31 -0700 |
| commit | 09e2268bc220b299ef2c1b8779c4df0b5ef4df3c (patch) | |
| tree | 4ebdeea150ea168678d6b08c8d1d20d246ee6ac2 /ShiftOS.WinForms/MainMenu/MainMenu.cs | |
| parent | c22370d643008e55121c0ddeaca0b81d755573ff (diff) | |
| parent | df37f3c366fe5884b17fa0b66d154536f8df93d2 (diff) | |
| download | shiftos_thereturn-09e2268bc220b299ef2c1b8779c4df0b5ef4df3c.tar.gz shiftos_thereturn-09e2268bc220b299ef2c1b8779c4df0b5ef4df3c.tar.bz2 shiftos_thereturn-09e2268bc220b299ef2c1b8779c4df0b5ef4df3c.zip | |
Merge pull request #4 from shiftos-game/master
pulling
Diffstat (limited to 'ShiftOS.WinForms/MainMenu/MainMenu.cs')
| -rw-r--r-- | ShiftOS.WinForms/MainMenu/MainMenu.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.cs b/ShiftOS.WinForms/MainMenu/MainMenu.cs index f6bc833..b957c28 100644 --- a/ShiftOS.WinForms/MainMenu/MainMenu.cs +++ b/ShiftOS.WinForms/MainMenu/MainMenu.cs @@ -156,6 +156,15 @@ namespace ShiftOS.WinForms.MainMenu txtdsaddress.Text = conf.DigitalSocietyAddress; txtdsport.Text = conf.DigitalSocietyPort.ToString(); + cblanguage.Items.Clear(); + foreach(var lang in Localization.GetAllLanguages()) + { + var finf = new System.IO.FileInfo(lang); + int nameindex = finf.Name.Length - 5; + cblanguage.Items.Add(finf.Name.Remove(nameindex, 5)); + } + + cblanguage.Text = conf.Language; pnloptions.Show(); pnloptions.BringToFront(); @@ -186,9 +195,20 @@ namespace ShiftOS.WinForms.MainMenu conf.DigitalSocietyPort = p; + bool requiresRestart = (conf.Language != cblanguage.Text); + conf.Language = cblanguage.Text; + + System.IO.File.WriteAllText("servers.json", Newtonsoft.Json.JsonConvert.SerializeObject(conf, Newtonsoft.Json.Formatting.Indented)); HideOptions(); + if(requiresRestart == true) + { + Infobox.Show("{TITLE_RESTARTREQUIRED}", "{PROMPT_RESTARTREQUIRED}", () => + { + Application.Restart(); + }); + } } private void button10_Click(object sender, EventArgs e) |
