aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications/MUDControlCentre.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-01-14 15:55:02 -0500
committerMichael <[email protected]>2017-01-14 15:55:02 -0500
commit34719f3e1760f686d9b03ac439946d2f605d3015 (patch)
tree2789173d9f7bc2f6d6f867e89b3726a15f4bb466 /ShiftOS.WinForms/Applications/MUDControlCentre.cs
parentca7062c3e6527054d805dede838d951333f0cea7 (diff)
downloadshiftos_thereturn-34719f3e1760f686d9b03ac439946d2f605d3015.tar.gz
shiftos_thereturn-34719f3e1760f686d9b03ac439946d2f605d3015.tar.bz2
shiftos_thereturn-34719f3e1760f686d9b03ac439946d2f605d3015.zip
Finish legion creator
Diffstat (limited to 'ShiftOS.WinForms/Applications/MUDControlCentre.cs')
-rw-r--r--ShiftOS.WinForms/Applications/MUDControlCentre.cs69
1 files changed, 58 insertions, 11 deletions
diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.cs
index baf6c31..d4654c8 100644
--- a/ShiftOS.WinForms/Applications/MUDControlCentre.cs
+++ b/ShiftOS.WinForms/Applications/MUDControlCentre.cs
@@ -164,6 +164,7 @@ namespace ShiftOS.WinForms.Applications
case ConsoleColor.DarkRed:
return Color.DarkRed;
case ConsoleColor.DarkYellow:
+ return Color.YellowGreen;
case ConsoleColor.Yellow:
return Color.Yellow;
case ConsoleColor.Green:
@@ -346,26 +347,54 @@ Current legions: {legionname}";
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.";
+ editingLegion = l;
+ cbcolorchooser.Items.Clear();
+ foreach(var name in Enum.GetNames(typeof(ConsoleColor)))
+ {
+ cbcolorchooser.Items.Add(name);
+ }
+ cbcolorchooser.Text = l.BannerColor.ToString();
+ cbcolorchooser.SelectedIndexChanged += (o, a) =>
+ {
+ panel4.BackColor = GetColor((ConsoleColor)Enum.Parse(typeof(ConsoleColor), cbcolorchooser.Text));
+ editingLegion.BannerColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), cbcolorchooser.Text);
+ };
+
+ cbpublicity.Items.Clear();
+ cbpublicity.SelectedIndexChanged += (o, a) =>
+ {
+ var pb = (LegionPublicity)Enum.Parse(typeof(LegionPublicity), cbpublicity.Text);
+ editingLegion.Publicity = pb;
+ };
+ foreach(var pb in Enum.GetNames(typeof(LegionPublicity)))
+ {
+ cbpublicity.Items.Add(pb);
+ }
+ cbpublicity.Text = editingLegion.Publicity.ToString();
- txtnewlegionshortname.Text = l.ShortName;
- txtnewlegiondescription.Text = l.Description;
- txtnewlegiontitle.Text = l.Name;
+ if (editingLegion.ShortName == null)
+ editingLegion.ShortName = "NAME";
+ if (editingLegion.Name == null)
+ editingLegion.Name = "Legion name";
+ if (editingLegion.Description == null)
+ editingLegion.Description = "This is your legion description.";
+
+ txtnewlegionshortname.Text = editingLegion.ShortName;
+ txtnewlegiondescription.Text = editingLegion.Description;
+ txtnewlegiontitle.Text = editingLegion.Name;
+ panel4.BackColor = GetColor(editingLegion.BannerColor);
lgn_create.BringToFront();
}
+ Legion editingLegion;
+
private void txtnewlegionshortname_TextChanged(object sender, EventArgs e)
{
var g = txtnewlegionshortname.CreateGraphics();
SizeF sf = g.MeasureString(txtnewlegionshortname.Text, txtnewlegionshortname.Font);
-
+ editingLegion.ShortName = txtnewlegionshortname.Text;
txtnewlegionshortname.Size = new Size((int)sf.Width, (int)sf.Height);
}
@@ -374,9 +403,27 @@ Current legions: {legionname}";
var g = txtnewlegiontitle.CreateGraphics();
SizeF sf = g.MeasureString(txtnewlegiontitle.Text, txtnewlegiontitle.Font);
-
+ editingLegion.Name = txtnewlegiontitle.Text;
txtnewlegiontitle.Size = new Size((int)sf.Width, (int)sf.Height);
}
+
+ private void flowLayoutPanel3_Paint(object sender, PaintEventArgs e)
+ {
+
+ }
+
+ private void cbcolorchooser_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ }
+
+ private void btncreate_Click(object sender, EventArgs e)
+ {
+ ServerManager.SendMessage("legion_create", JsonConvert.SerializeObject(editingLegion));
+ SaveSystem.CurrentSave.CurrentLegions.Clear();
+ SaveSystem.CurrentSave.CurrentLegions.Add(editingLegion.ShortName);
+ SaveSystem.SaveGame();
+ myLegionToolStripMenuItem_Click(sender, e);
+ }
}
}