aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-02-08 18:19:09 -0500
committerMichael <[email protected]>2017-02-08 18:19:09 -0500
commitf7c53542052b271e367cf81324034a56d4f7d19e (patch)
treef9c999597984171edb98a63daeb9fe8a1193f021 /ShiftOS.WinForms/Applications
parent48fd30794f61de671fd556c05226c2cfc7c548ee (diff)
downloadshiftos_thereturn-f7c53542052b271e367cf81324034a56d4f7d19e.tar.gz
shiftos_thereturn-f7c53542052b271e367cf81324034a56d4f7d19e.tar.bz2
shiftos_thereturn-f7c53542052b271e367cf81324034a56d4f7d19e.zip
Fix shop editor
Diffstat (limited to 'ShiftOS.WinForms/Applications')
-rw-r--r--ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs16
-rw-r--r--ShiftOS.WinForms/Applications/MUDControlCentre.cs24
-rw-r--r--ShiftOS.WinForms/Applications/MUDControlCentre.resx6
3 files changed, 41 insertions, 5 deletions
diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs
index cced521..9539632 100644
--- a/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs
+++ b/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs
@@ -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;
}
}
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();
+ }
}
}
diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.resx b/ShiftOS.WinForms/Applications/MUDControlCentre.resx
index 5dafdb5..4c4f474 100644
--- a/ShiftOS.WinForms/Applications/MUDControlCentre.resx
+++ b/ShiftOS.WinForms/Applications/MUDControlCentre.resx
@@ -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> \ No newline at end of file