From 48fd30794f61de671fd556c05226c2cfc7c548ee Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 8 Feb 2017 18:01:13 -0500 Subject: [PATCH] Shop fixes --- ShiftOS.Objects/Save.cs | 15 +++++++++++---- ShiftOS.Server/Program.cs | 2 +- .../Applications/MUDControlCentre.Designer.cs | 2 +- ShiftOS.WinForms/Applications/MUDControlCentre.cs | 15 ++++++++------- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ShiftOS.Objects/Save.cs b/ShiftOS.Objects/Save.cs index 6231875..ddf41ff 100644 --- a/ShiftOS.Objects/Save.cs +++ b/ShiftOS.Objects/Save.cs @@ -77,13 +77,20 @@ namespace ShiftOS.Objects public override bool TrySetMember(SetMemberBinder binder, object value) { - if (_settings.ContainsKey(binder.Name)) + try { - _settings[binder.Name] = value; + if (_settings.ContainsKey(binder.Name)) + { + _settings[binder.Name] = value; + } + else + { + _settings.Add(binder.Name, value); + } } - else + catch { - _settings.Add(binder.Name, value); + } return true; diff --git a/ShiftOS.Server/Program.cs b/ShiftOS.Server/Program.cs index 7a4b457..9ac5702 100644 --- a/ShiftOS.Server/Program.cs +++ b/ShiftOS.Server/Program.cs @@ -407,8 +407,8 @@ Contents: Name = "shop_taken", GUID = "server", })); + return; } - return; } shopFile.Add(newShop); diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs index 220f061..cced521 100644 --- a/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs +++ b/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs @@ -643,7 +643,7 @@ namespace ShiftOS.WinForms.Applications this.btnbuy.Name = "btnbuy"; this.btnbuy.Size = new System.Drawing.Size(75, 23); this.btnbuy.TabIndex = 0; - this.btnbuy.Text = "button3"; + this.btnbuy.Text = "Buy"; this.btnbuy.UseVisualStyleBackColor = true; this.btnbuy.Click += new System.EventHandler(this.btnbuy_Click); // diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.cs index 3fa5984..e2758ae 100644 --- a/ShiftOS.WinForms/Applications/MUDControlCentre.cs +++ b/ShiftOS.WinForms/Applications/MUDControlCentre.cs @@ -147,7 +147,7 @@ namespace ShiftOS.WinForms.Applications Infobox.Show("No shop.", "You do not currently own any shops. You must open one to use this screen."); })); } - else if (msg.Name == "shop_allshops") + else if (msg.Name == "shop_all") { this.Invoke(new Action(() => { @@ -205,10 +205,6 @@ namespace ShiftOS.WinForms.Applications bnr.Controls.Add(lTitle); lTitle.Show(); var desc = new Label(); - desc.Left = lTitle.Left; - desc.Width = (bnr.Width - desc.Left - desc.Left); - desc.Top = lTitle.Top + lTitle.Height; - desc.Height = (bnr.Height - lTitle.Top); desc.Text = shop.Description; bnr.Controls.Add(desc); desc.Show(); @@ -236,6 +232,11 @@ namespace ShiftOS.WinForms.Applications flshoplist.Controls.Add(bnr); bnr.Show(); ControlManager.SetupControls(bnr); + desc.Left = lTitle.Left; + desc.Width = (bnr.Width - desc.Left - desc.Left); + desc.Top = lTitle.Top + lTitle.Height; + desc.Height = (bnr.Height - lTitle.Top); + } } @@ -243,7 +244,7 @@ namespace ShiftOS.WinForms.Applications public void ShowShop(Shop shop) { shop_view.BringToFront(); - + CurrentShop = shop; lbshopname.Text = shop.Name; lbupgradetitle.Text = $"Welcome to {shop.Name}."; lbupgradedesc.Text = shop.Description; @@ -616,7 +617,7 @@ Current legions: {legionname}"; private void browseToolStripMenuItem_Click(object sender, EventArgs e) { - ServerManager.SendMessage("shop_getallshops", ""); + ServerManager.SendMessage("shop_getall", ""); } private void btnbuy_Click(object sender, EventArgs e)