From 28a087d2d4961fd80d827df968de0f6f63da07eb Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 4 Feb 2017 11:14:39 -0500 Subject: Add name changer backend You can use the DefaultTitleAttribute on an IShiftOSWindow to specify a default title for the window and name changer entry. --- ShiftOS.WinForms/Applications/MUDControlCentre.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'ShiftOS.WinForms/Applications/MUDControlCentre.cs') diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.cs index 439d5ab..34086a7 100644 --- a/ShiftOS.WinForms/Applications/MUDControlCentre.cs +++ b/ShiftOS.WinForms/Applications/MUDControlCentre.cs @@ -66,21 +66,27 @@ namespace ShiftOS.WinForms.Applications BannerColor = ConsoleColor.DarkRed }); } - else if(msg.Name == "legion_create_ok") + else if (msg.Name == "legion_create_ok") { SaveSystem.CurrentSave.CurrentLegions.Clear(); SaveSystem.CurrentSave.CurrentLegions.Add(editingLegion.ShortName); SaveSystem.SaveGame(); - myLegionToolStripMenuItem_Click(this, EventArgs.Empty); + this.Invoke(new Action(() => + { + myLegionToolStripMenuItem_Click(this, EventArgs.Empty); + })); } - else if(msg.Name == "legion_alreadyexists") + else if (msg.Name == "legion_alreadyexists") { - Infobox.Show("Legion already exists", "A legion with the short name you provided already exists. Please choose another."); + this.Invoke(new Action(() => + { + Infobox.Show("Legion already exists", "A legion with the short name you provided already exists. Please choose another."); + })); } - else if(msg.Name == "legion_users_found") + else if (msg.Name == "legion_users_found") { lvusers.Items.Clear(); - foreach(var usr in JsonConvert.DeserializeObject(msg.Contents)) + foreach (var usr in JsonConvert.DeserializeObject(msg.Contents)) { lvusers.Items.Add(usr); } @@ -89,7 +95,7 @@ namespace ShiftOS.WinForms.Applications { ShowLegionInfo(JsonConvert.DeserializeObject(msg.Contents)); } - else if(msg.Name == "legion_all") + else if (msg.Name == "legion_all") { PopulateJoinLegion(JsonConvert.DeserializeObject>(msg.Contents)); } -- cgit v1.2.3