Shop fixes

This commit is contained in:
Michael 2017-02-08 18:01:13 -05:00
parent beb2bb27d7
commit 48fd30794f
4 changed files with 21 additions and 13 deletions

View file

@ -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;

View file

@ -407,8 +407,8 @@ Contents:
Name = "shop_taken",
GUID = "server",
}));
return;
}
return;
}
shopFile.Add(newShop);

View file

@ -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);
//

View file

@ -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)