Skip to content

Commit

Permalink
move debugUndoRedo to config
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Aug 30, 2024
1 parent 3fe15c0 commit 75492d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ Inspector.prototype = {
this.sceneHelpers.userData.source = 'INSPECTOR';
this.sceneHelpers.visible = true;
this.inspectorActive = false;
this.debugUndoRedo = false;

this.viewport = new Viewport(this);

Expand Down
8 changes: 4 additions & 4 deletions src/editor/lib/commands/EntityUpdateCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class EntityUpdateCommand extends Command {
payload.property
];
}
if (this.editor.debugUndoRedo) {
if (this.editor.config.debugUndoRedo) {
console.log(this.component, this.oldValue, this.newValue);
}
} else {
Expand All @@ -57,7 +57,7 @@ export class EntityUpdateCommand extends Command {
payload.entity.getAttribute(payload.component)
)
: structuredClone(payload.entity.getDOMAttribute(payload.component));
if (this.editor.debugUndoRedo) {
if (this.editor.config.debugUndoRedo) {
console.log(this.component, this.oldValue, this.newValue);
}
}
Expand All @@ -67,7 +67,7 @@ export class EntityUpdateCommand extends Command {
execute() {
const entity = document.getElementById(this.entityId);
if (entity) {
if (this.editor.debugUndoRedo) {
if (this.editor.config.debugUndoRedo) {
console.log(
'execute',
entity,
Expand All @@ -92,7 +92,7 @@ export class EntityUpdateCommand extends Command {
}

update(command) {
if (this.editor.debugUndoRedo) {
if (this.editor.config.debugUndoRedo) {
console.log('update', command);
}
this.newValue = command.newValue;
Expand Down
2 changes: 2 additions & 0 deletions src/editor/lib/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export function Config() {
return {
// Debug undo/redo
debugUndoRedo: false,
// Default parent to add new elements to
defaultParent: '#street-container'
};
Expand Down

0 comments on commit 75492d0

Please sign in to comment.