Skip to content

Commit

Permalink
Select command upon adding
Browse files Browse the repository at this point in the history
Hopefully fixes snozbot#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.
  • Loading branch information
Arylos07 authored and stevehalliwell committed Jun 24, 2021
1 parent 8b21749 commit f9c4dd0
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ static protected void AddCommandCallback(Type commandType)
// Because this is an async call, we need to force prefab instances to record changes
PrefabUtility.RecordPrefabInstancePropertyModifications(block);

flowchart.ClearSelectedCommands();
//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.

}
}
}
}

0 comments on commit f9c4dd0

Please sign in to comment.