Fix shop editor

This commit is contained in:
Michael 2017-02-08 18:19:09 -05:00
parent 48fd30794f
commit f7c5354205
3 changed files with 41 additions and 5 deletions

View file

@ -145,6 +145,7 @@ namespace ShiftOS.WinForms.Applications
this.btnedititem = new System.Windows.Forms.Button();
this.txtshopname = new System.Windows.Forms.TextBox();
this.txtshopdescription = new System.Windows.Forms.TextBox();
this.btneditshop = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();
@ -332,8 +333,8 @@ namespace ShiftOS.WinForms.Applications
//
// toolStripContainer1.ContentPanel
//
this.toolStripContainer1.ContentPanel.Controls.Add(this.shop_editor);
this.toolStripContainer1.ContentPanel.Controls.Add(this.shop_view);
this.toolStripContainer1.ContentPanel.Controls.Add(this.shop_editor);
this.toolStripContainer1.ContentPanel.Controls.Add(this.shop_all);
this.toolStripContainer1.ContentPanel.Controls.Add(this.lgn_create);
this.toolStripContainer1.ContentPanel.Controls.Add(this.job_current);
@ -618,6 +619,7 @@ namespace ShiftOS.WinForms.Applications
//
// pnlbuy
//
this.pnlbuy.Controls.Add(this.btneditshop);
this.pnlbuy.Controls.Add(this.lbprice);
this.pnlbuy.Controls.Add(this.btnbuy);
this.pnlbuy.Dock = System.Windows.Forms.DockStyle.Bottom;
@ -1186,6 +1188,17 @@ namespace ShiftOS.WinForms.Applications
this.txtshopdescription.TabIndex = 2;
this.txtshopdescription.TextChanged += new System.EventHandler(this.txtshopdescription_TextChanged);
//
// btneditshop
//
this.btneditshop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btneditshop.Location = new System.Drawing.Point(198, 3);
this.btneditshop.Name = "btneditshop";
this.btneditshop.Size = new System.Drawing.Size(75, 23);
this.btneditshop.TabIndex = 2;
this.btneditshop.Text = "Edit shop";
this.btneditshop.UseVisualStyleBackColor = true;
this.btneditshop.Click += new System.EventHandler(this.btneditshop_Click);
//
// MUDControlCentre
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1348,5 +1361,6 @@ namespace ShiftOS.WinForms.Applications
private System.Windows.Forms.Button btnaddshopitem;
private System.Windows.Forms.Button btnremoveitem;
private System.Windows.Forms.Button btnedititem;
private System.Windows.Forms.Button btneditshop;
}
}

View file

@ -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();
}
}
}

View file

@ -123,6 +123,9 @@
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
<data name="label12.Text" xml:space="preserve">
<value>The multi-user domain has many unique shops selling many items such as applications, skins and other things. Just choose a shop, browse for an item you'd like, then pay Codepoints and the download will begin.</value>
</data>
<data name="label10.Text" xml:space="preserve">
<value>On this screen you can customize your legion profile. This is how users will see your legion inside the Join Legion screen.
@ -130,7 +133,4 @@ You can set up a banner color, short and long name, and a description on this sc
The description will be what explains your legion - what does it do? Why should the user join it? Stuff like that.</value>
</data>
<data name="label12.Text" xml:space="preserve">
<value>The multi-user domain has many unique shops selling many items such as applications, skins and other things. Just choose a shop, browse for an item you'd like, then pay Codepoints and the download will begin.</value>
</data>
</root>