From 347bea3315d40405c6ed5a479c605ae983b530d4 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 8 Jan 2017 14:50:03 -0500 Subject: Murdered WPF and edited some legion stuff --- ShiftOS.WinForms/Applications/MUDControlCentre.cs | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'ShiftOS.WinForms/Applications/MUDControlCentre.cs') diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.cs index aeb69ae..baf6c31 100644 --- a/ShiftOS.WinForms/Applications/MUDControlCentre.cs +++ b/ShiftOS.WinForms/Applications/MUDControlCentre.cs @@ -334,5 +334,49 @@ Current legions: {legionname}"; ServerManager.SendMessage("user_get_legion", JsonConvert.SerializeObject(SaveSystem.CurrentSave)); } + + Legion newLegion = null; + + private void createLegionToolStripMenuItem_Click(object sender, EventArgs e) + { + newLegion = new Legion(); + + SetupLegionEditor(newLegion); + } + + public void SetupLegionEditor(Legion l) + { + if (l.ShortName == null) + l.ShortName = "NAME"; + if (l.Name == null) + l.Name = "Legion name"; + if (l.Description == null) + l.Description = "This is your legion description."; + + txtnewlegionshortname.Text = l.ShortName; + txtnewlegiondescription.Text = l.Description; + txtnewlegiontitle.Text = l.Name; + + lgn_create.BringToFront(); + } + + private void txtnewlegionshortname_TextChanged(object sender, EventArgs e) + { + var g = txtnewlegionshortname.CreateGraphics(); + + SizeF sf = g.MeasureString(txtnewlegionshortname.Text, txtnewlegionshortname.Font); + + txtnewlegionshortname.Size = new Size((int)sf.Width, (int)sf.Height); + } + + private void txtnewlegiontitle_TextChanged(object sender, EventArgs e) + { + var g = txtnewlegiontitle.CreateGraphics(); + + SizeF sf = g.MeasureString(txtnewlegiontitle.Text, txtnewlegiontitle.Font); + + txtnewlegiontitle.Size = new Size((int)sf.Width, (int)sf.Height); + + } } } -- cgit v1.2.3