From e3f9a6028b3774f7376617502e7f6016dc50dd0e Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 17 Jun 2017 14:45:42 -0400 Subject: Localize a LOT of the UI --- ShiftOS.WinForms/MainMenu/MainMenu.cs | 47 +++-------------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) (limited to 'ShiftOS.WinForms/MainMenu/MainMenu.cs') diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.cs b/ShiftOS.WinForms/MainMenu/MainMenu.cs index 1936fec..7ace42a 100644 --- a/ShiftOS.WinForms/MainMenu/MainMenu.cs +++ b/ShiftOS.WinForms/MainMenu/MainMenu.cs @@ -116,29 +116,7 @@ namespace ShiftOS.WinForms.MainMenu private string GetTickerMessage() { - switch (rnd.Next(0, 10)) - { - case 0: - return "Did you know that you can skin this very menu? Just goes to show how much you can shift it your way."; - case 1: - return "Want to pick up a few skins or mods from the community? Head on over to http://getshiftos.ml/Skins!"; - case 2: - return "Sandbox mode is a special version of ShiftOS that allows you to use the operating system without having to deal with Codepoints, the Shiftorium or having to play through the storyline. Handy..."; - case 3: - return "ArtPad not good enough? You can use an external image editor to create ShiftOS skin textures. Just save your files to the Shared Directory and they'll be imported into ShiftOS on the 1:/ drive."; - case 4: - return "Terminal too weird for ya? You can use the Format Editor to generate your own Terminal command parser. No coding knowledge needed!"; - case 5: - return "Contests are a good way to earn heaps of Codepoints. Head on over to http://getshiftos.ml/Contests for info on current community contests."; - case 6: - return "There's no bugs in this game... But if you find some, please submit them to http://getshiftos.ml/Bugs."; - case 7: - return "SHIFTOS - PROPERTY OF MICHAEL VANOVERBEEK. FOR INTERNAL USE ONLY. Build number = sos_tr_133764 [Just kidding. ShiftOS is open-source. Find the code at http://github.com/shiftos-game/ShiftOS!]"; - case 8: - return "Hold your Codepoints against the wall... when they take everything away. Hold your Codepoints against the wall..."; - default: - return "Good God. We don't know what to put here."; - } + return Localization.Parse("{MAINMENU_TIPTEXT_" + rnd.Next(10) + "}"); } private void button1_Click(object sender, EventArgs e) @@ -175,7 +153,6 @@ namespace ShiftOS.WinForms.MainMenu { var conf = ShiftOS.Objects.UserConfig.Get(); - txtubase.Text = conf.UniteUrl; txtdsaddress.Text = conf.DigitalSocietyAddress; txtdsport.Text = conf.DigitalSocietyPort.ToString(); @@ -201,32 +178,14 @@ namespace ShiftOS.WinForms.MainMenu int p = 0; - if(int.TryParse(txtdsport.Text, out p) == false) + if(int.TryParse(txtdsport.Text, out p) == false || p < 0 || p > 65535) { - Infobox.Show("Invalid port number", "The Digital Society Port must be a valid whole number between 0 and 65535."); + Infobox.Show("{TITLE_INVALIDPORT}", "{PROMPT_INVALIDPORT}"); return; } - else - { - if(p < 0 || p > 65535) - { - Infobox.Show("Invalid port number", "The Digital Society Port must be a valid whole number between 0 and 65535."); - return; - } - } conf.DigitalSocietyPort = p; - string unite = txtubase.Text; - if (unite.EndsWith("/")) - { - int len = unite.Length; - int index = len - 1; - int end = 1; - unite = unite.Remove(index, end); - } - conf.UniteUrl = unite; - System.IO.File.WriteAllText("servers.json", Newtonsoft.Json.JsonConvert.SerializeObject(conf, Newtonsoft.Json.Formatting.Indented)); HideOptions(); -- cgit v1.2.3