Added EditorState, moved editor mode management to that IIFE

This commit is contained in:
unsettledgames
2021-07-23 18:54:09 +02:00
parent 366c2d9e2a
commit 404b1c56c1
5 changed files with 78 additions and 82 deletions

View File

@ -134,7 +134,7 @@ const FileManager = (() => {
var img = new Image();
img.onload = function() {
//create a new pixel with the images dimentions
switchMode('Advanced');
EditorState.switchMode('Advanced');
Startup.newPixel(this.width, this.height);
//draw the image onto the canvas
@ -174,7 +174,7 @@ const FileManager = (() => {
dictionary['canvasWidth'] = currentLayer.canvasSize[0];
dictionary['canvasHeight'] = currentLayer.canvasSize[1];
// save editor mode
dictionary['editorMode'] = pixelEditorMode;
dictionary['editorMode'] = EditorState.getCurrentMode();
// save palette
for (let i=0; i<ColorModule.getCurrentPalette().length; i++) {
dictionary["color" + i] = ColorModule.getCurrentPalette()[i];