Commit 6d58f64d authored by Christian Winter's avatar Christian Winter

bugfixes regarding prefabs. when creating new prefab it is also placed on (0,...

bugfixes regarding prefabs. when creating new prefab it is also placed on (0, 0). setState logs now created if in devMode
parent cc6510ba
Pipeline #4759071 passed with stage
......@@ -12,10 +12,12 @@
this._endPreviousPrefabEditIfExisting();
let newPrefab = new Prefab();
File.currentLayer.addPrefabInstance(new PrefabInstance(newPrefab, Vector2.zero));
this.addPrefab(newPrefab);
this.editPrefab(this.prefabs.length - 1);
GUI.buildPrefabUI();
Camera.resetView();
}
......
......@@ -76,8 +76,7 @@
case Key.Enter:
if (Logic.backlogState) {
if (Logic.backlogState instanceof EditPrefabState) {
Logic.setState(Logic.backlogState);
Logic.currentState.apply();
Logic.backlogState.apply();
}
} else {
GUI.use2DCursorTogglePressed();
......
......@@ -173,7 +173,8 @@ class Logic {
this.currentState.enter();
Renderer.redraw();
// console.log(this.previousState + " --> " + this.currentState);
if (Preferences.developerMode)
console.log(this.previousState + " --> " + this.currentState);
}
static setWaitingState(state) {
......
......@@ -44,15 +44,6 @@
this.restore();
}
keyDown(keycode) {
switch (keycode) {
case Key.Enter:
this.apply();
break;
}
}
cancel() {
this.restore();
}
......
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