Skip to content

Commit

Permalink
Clone items from crate
Browse files Browse the repository at this point in the history
  • Loading branch information
JitteSochin committed Aug 16, 2016
1 parent 86a26ca commit f267827
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
28 changes: 22 additions & 6 deletions LayoutEdit/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion LayoutEdit/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,25 @@ private void btnClone_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dg.SelectedRows)
{
if (chkCloneCrate.Checked)
{
DataRow DRCrate = layout.FindCrateItem(Int64.Parse(row.Cells["ItemID"].Value.ToString()));
if (DRCrate == null) goto NotInCrate;
if (bool.Parse(row.Cells["InCrate"].Value.ToString()) == true) goto NotInCrate;
DRCrate["InCrate"] = bool.Parse(row.Cells["InCrate"].Value.ToString());
DRCrate["ItemID"] = Int64.Parse(row.Cells["ItemID"].Value.ToString());
DRCrate["ItemName"] = row.Cells["ItemName"].Value.ToString();
DRCrate["Pitch"] = decimal.Parse(row.Cells["Pitch"].Value.ToString());
DRCrate["Roll"] = decimal.Parse(row.Cells["Roll"].Value.ToString());
DRCrate["Rotation"] = decimal.Parse(row.Cells["Rotation"].Value.ToString());
DRCrate["Scale"] = decimal.Parse(row.Cells["Scale"].Value.ToString());
DRCrate["x"] = decimal.Parse(row.Cells["x"].Value.ToString());
DRCrate["y"] = decimal.Parse(row.Cells["y"].Value.ToString());
DRCrate["z"] = decimal.Parse(row.Cells["z"].Value.ToString());
goto FoundInCrate;
}
NotInCrate:
DataRow DR = layout.HouseItems.NewRow();

DR["InCrate"] = bool.Parse(row.Cells["InCrate"].Value.ToString());
DR["ItemID"] = Int64.Parse(row.Cells["ItemID"].Value.ToString());
DR["ItemName"] = row.Cells["ItemName"].Value.ToString();
Expand All @@ -326,6 +343,8 @@ private void btnClone_Click(object sender, EventArgs e)
{
goto clonePreAdd;
}
FoundInCrate:
continue;
}
}

Expand Down
4 changes: 2 additions & 2 deletions LayoutEdit/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2016.07.18.0")]
[assembly: AssemblyFileVersion("2016.07.18.0")]
[assembly: AssemblyVersion("2016.08.16.0")]
[assembly: AssemblyFileVersion("2016.08.16.0")]

0 comments on commit f267827

Please sign in to comment.