Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions engine/src/ToolSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,9 @@ Wick.ToolSettings = class {
loadSettingsFromLocalstorage () {
Wick.ToolSettings.DEFAULT_SETTINGS.forEach(setting => {
// Get stored tool setting if it exists.
localforage.getItem(this.getStorageKey(name)).then( (value) => {
if (value) {
this._settings[args.name] = {
type: args.type,
name: args.name,
value: type === 'color' ? new window.Wick.Color(value) : value,
default: args.default,
min: args.min,
max: args.max,
step: args.step,
options: args.options,
};
localforage.getItem(this.getStorageKey(setting.name)).then( (value) => {
if (value !== null && value !== undefined) {
this._settings[setting.name].value = setting.type === 'color' ? new window.Wick.Color(value) : value;
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion engine/src/base/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Wick.Timeline = class extends Wick.Base {

this._playing = true;

this._fillGapsMethod = "auto_extend";
this._fillGapsMethod = localStorage.getItem('wickEditorFillGapsMethod') || "auto_extend";
this._frameForced = false;
}

Expand Down
16 changes: 16 additions & 0 deletions engine/src/gui/GUIElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,22 @@ if(isTablet) {
Wick.GUIElement.GRID_DEFAULT_CELL_WIDTH = Wick.GUIElement.GRID_NORMAL_CELL_WIDTH;
Wick.GUIElement.GRID_DEFAULT_CELL_HEIGHT = Wick.GUIElement.GRID_NORMAL_CELL_HEIGHT;
}
// Restore saved frame size preference (overrides tablet/desktop default)
const _savedFrameSize = localStorage.getItem('wickEditorFrameSizeMode');
if(_savedFrameSize) switch(_savedFrameSize){
case 'small':
Wick.GUIElement.GRID_DEFAULT_CELL_WIDTH = Wick.GUIElement.GRID_SMALL_CELL_WIDTH;
Wick.GUIElement.GRID_DEFAULT_CELL_HEIGHT = Wick.GUIElement.GRID_SMALL_CELL_HEIGHT;
break;
case 'large':
Wick.GUIElement.GRID_DEFAULT_CELL_WIDTH = Wick.GUIElement.GRID_LARGE_CELL_WIDTH;
Wick.GUIElement.GRID_DEFAULT_CELL_HEIGHT = Wick.GUIElement.GRID_LARGE_CELL_HEIGHT;
break;
case 'normal':
default:
Wick.GUIElement.GRID_DEFAULT_CELL_WIDTH = Wick.GUIElement.GRID_NORMAL_CELL_WIDTH;
Wick.GUIElement.GRID_DEFAULT_CELL_HEIGHT = Wick.GUIElement.GRID_NORMAL_CELL_HEIGHT;
}
Wick.GUIElement.GRID_MARGIN = 1;

Wick.GUIElement.TIMELINE_BACKGROUND_COLOR = '#2A2E30';
Expand Down
5 changes: 5 additions & 0 deletions engine/src/gui/PopupMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Wick.GUIElement.PopupMenu = class extends Wick.GUIElement {
icon: 'gap_fill_extend_frames',
clickFn: () => {
this.project.model.activeTimeline.fillGapsMethod = 'auto_extend';
localStorage.setItem('wickEditorFillGapsMethod', 'auto_extend');
this.projectWasModified();
}
});
Expand All @@ -42,6 +43,7 @@ Wick.GUIElement.PopupMenu = class extends Wick.GUIElement {
icon: 'gap_fill_empty_frames',
clickFn: () => {
this.project.model.activeTimeline.fillGapsMethod = 'blank_frames';
localStorage.setItem('wickEditorFillGapsMethod', 'blank_frames');
this.projectWasModified();
}
});
Expand All @@ -52,6 +54,7 @@ Wick.GUIElement.PopupMenu = class extends Wick.GUIElement {
clickFn: () => {
Wick.GUIElement.GRID_DEFAULT_CELL_WIDTH = Wick.GUIElement.GRID_SMALL_CELL_WIDTH;
Wick.GUIElement.GRID_DEFAULT_CELL_HEIGHT = Wick.GUIElement.GRID_SMALL_CELL_HEIGHT;
localStorage.setItem('wickEditorFrameSizeMode', 'small');
}
});

Expand All @@ -61,6 +64,7 @@ Wick.GUIElement.PopupMenu = class extends Wick.GUIElement {
clickFn: () => {
Wick.GUIElement.GRID_DEFAULT_CELL_WIDTH = Wick.GUIElement.GRID_NORMAL_CELL_WIDTH;
Wick.GUIElement.GRID_DEFAULT_CELL_HEIGHT = Wick.GUIElement.GRID_NORMAL_CELL_HEIGHT;
localStorage.setItem('wickEditorFrameSizeMode', 'normal');
}
});

Expand All @@ -70,6 +74,7 @@ Wick.GUIElement.PopupMenu = class extends Wick.GUIElement {
clickFn: () => {
Wick.GUIElement.GRID_DEFAULT_CELL_WIDTH = Wick.GUIElement.GRID_LARGE_CELL_WIDTH;
Wick.GUIElement.GRID_DEFAULT_CELL_HEIGHT = Wick.GUIElement.GRID_LARGE_CELL_HEIGHT;
localStorage.setItem('wickEditorFrameSizeMode', 'large');
}
});
};
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.