Multi-selection, move, undo/redo

This commit is contained in:
dexyfex
2017-09-26 10:27:18 +10:00
Unverified
parent 1a2af6af9e
commit bac531208c
7 changed files with 885 additions and 471 deletions
+10 -4
View File
@@ -22,6 +22,7 @@ namespace CodeWalker
{
WorldForm WorldForm;
MapSelection Selection;
List<MapSelection> SelectionItems;
string SelectionMode = "";
bool MouseSelectEnable = false;
@@ -59,9 +60,10 @@ namespace CodeWalker
MouseSelectCheckBox.Checked = enable;
}
public void SetSelection(MapSelection item)
public void SetSelection(MapSelection item, List<MapSelection> multiItems)
{
Selection = item;
SelectionItems = multiItems;
SelectionNameTextBox.Text = item.GetNameString("Nothing selected");
//SelEntityPropertyGrid.SelectedObject = item.EntityDef;
@@ -87,8 +89,12 @@ namespace CodeWalker
AddSelectionEntityHierarchyNodes(item.EntityDef);
}
if (item.TimeCycleModifier != null)
if (item.MultipleSelection)
{
SelectionEntityTabPage.Text = "Multiple items";
SelEntityPropertyGrid.SelectedObject = multiItems.ToArray();
}
else if (item.TimeCycleModifier != null)
{
SelectionEntityTabPage.Text = "Time Cycle Modifier";
SelEntityPropertyGrid.SelectedObject = item.TimeCycleModifier;
@@ -414,7 +420,7 @@ namespace CodeWalker
private void WorldInfoForm_Load(object sender, EventArgs e)
{
SetSelection(Selection);
SetSelection(Selection, SelectionItems);
}
private void WorldInfoForm_FormClosed(object sender, FormClosedEventArgs e)