From f7c53542052b271e367cf81324034a56d4f7d19e Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 8 Feb 2017 18:19:09 -0500 Subject: Fix shop editor --- ShiftOS.WinForms/Applications/MUDControlCentre.cs | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'ShiftOS.WinForms/Applications/MUDControlCentre.cs') diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.cs index e2758ae..5e93e2f 100644 --- a/ShiftOS.WinForms/Applications/MUDControlCentre.cs +++ b/ShiftOS.WinForms/Applications/MUDControlCentre.cs @@ -180,7 +180,13 @@ namespace ShiftOS.WinForms.Applications public void PopulateShopEditor() { - + txtshopdescription.Text = editingShop.Description; + txtshopname.Text = editingShop.Description; + lbeditingshopitems.Items.Clear(); + foreach(var item in editingShop.Items) + { + lbeditingshopitems.Items.Add(item.Name); + } } public void PopulateShopList(Shop[] shops) @@ -265,6 +271,14 @@ namespace ShiftOS.WinForms.Applications lbprice.Text = $"Cost: {item.Cost} CP"; btnbuy.Show(); }; + if(shop.Owner == SaveSystem.CurrentSave.Username) + { + btneditshop.Show(); + } + else + { + btneditshop.Hide(); + } } private ShopItem item = null; @@ -740,5 +754,13 @@ Current legions: {legionname}"; { ServerManager.SendMessage("user_get_shop", SaveSystem.CurrentSave.Username); } + + private void btneditshop_Click(object sender, EventArgs e) + { + editingShop = CurrentShop; + creatingShop = false; + shop_editor.BringToFront(); + PopulateShopEditor(); + } } } -- cgit v1.2.3