Browse Source

Select command upon adding

Hopefully fixes #994. This needs to be tested upon returning home. (This was written at work)

Essentially, once the command is added and the other commands are cleared, the new command is automatically selected, allowing editing right away. It also means that adding commands in succession means additional commands do not go to the bottom of the block, so long as the first command was not deselected.
master
Michael Cox 3 years ago committed by Steve Halliwell
parent
commit
f9c4dd078d
  1. 4
      Assets/Fungus/Scripts/Editor/PopupContent/CommandSelectorPopupWindowContent.cs

4
Assets/Fungus/Scripts/Editor/PopupContent/CommandSelectorPopupWindowContent.cs

@ -176,8 +176,12 @@ namespace Fungus.EditorUtils
// Because this is an async call, we need to force prefab instances to record changes
PrefabUtility.RecordPrefabInstancePropertyModifications(block);
//clear commands just in case there was a selection made prior,
// this way, only one command is selected at the end; the new one.
flowchart.ClearSelectedCommands();
flowchart.SelectedCommands.Add(newCommand); //select the new command.
}
}
}
Loading…
Cancel
Save