Skip to content

Commit

Permalink
Close menu in all scenarios and disconnect interactive upon ejection
Browse files Browse the repository at this point in the history
Co-authored-by: T4rikA <[email protected]>
  • Loading branch information
linusha and T4rikA committed Jun 8, 2021
1 parent 93978cc commit ed4bdcd
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,16 @@ export class InteractivesEditor extends QinoqMorph {
if (!this._deserializing) this.ui = {};
}
},
settings: {},
settings: {
set (settings) {
if (!settings) {
if (this.settings) {
this.settings.owner.close();
}
}
this.setProperty('settings', settings);
}
},
_snappingDisabled: {}
};
}
Expand Down Expand Up @@ -291,7 +300,7 @@ export class InteractivesEditor extends QinoqMorph {

clearInteractive () {
if (!this.interactive) return;

this.settings = null;
this.interactiveInEditMode = false;

this.interactive.sequences.forEach(sequence => {
Expand Down Expand Up @@ -351,13 +360,10 @@ export class InteractivesEditor extends QinoqMorph {
}

ejectInteractive () {
if (!this.interactive) return;

const interactive = $world.addMorph(this.interactive);
const interactive = this.interactive;
this.reset();
$world.addMorph(interactive);
interactive.position = pt(100, 100);
this.clearInteractive();
this.settings.owner.close();
this.settings = null;
}

reset () {
Expand Down Expand Up @@ -1471,7 +1477,6 @@ class Settings extends QinoqMorph {
}

buildInteractiveSettings () {
debugger;
this.ui.interactiveSettings = new QinoqMorph({
name: 'interactive settings'
});
Expand Down

0 comments on commit ed4bdcd

Please sign in to comment.