Commit 147a55a6 authored by Christian Winter's avatar Christian Winter

click again on prefab button to exit PrefabBrushState

parent 9e7e4a4f
Pipeline #4801417 passed with stage
in 1 minute and 6 seconds
......@@ -40,11 +40,9 @@
}
static editPrefab(id) {
if (Logic.backlogState)
{
if (Logic.backlogState.currentPrefab == this.prefabs[id])
{
if (Logic.backlogState) {
if (Logic.backlogState.currentPrefab == this.prefabs[id]) {
Logic.backlogState.apply();
Logic.setBacklogState(null);
return;
......@@ -58,14 +56,20 @@
}
static selectPrefabWithID(id) {
Logic.setState(new PrefabBrushState(this.prefabs[id]));
if (Logic.currentState instanceof PrefabBrushState && Logic.currentState.currentPrefab == this.prefabs[id]) {
Logic.currentState.cancel();
Logic.setState(new IdleState());
}
else
Logic.setState(new PrefabBrushState(this.prefabs[id]));
GUI.buildPrefabUI();
}
static changeNameForPrefabWithID(id, name) {
this.prefabs[id].name = name;
}
static deletePrefabWithID(id) {
this._endPreviousPrefabEditIfExisting();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment