mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Finished implementing editor modes
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
let firstPixel = true;
|
||||
|
||||
function newPixel (width, height, palette, fileContent = null) {
|
||||
function newPixel (width, height, editorMode, fileContent = null) {
|
||||
pixelEditorMode = editorMode;
|
||||
|
||||
currentPalette = [];
|
||||
if (firstPixel) {
|
||||
layerList = document.getElementById("layers-menu");
|
||||
@@ -121,7 +123,6 @@ function newPixel (width, height, palette, fileContent = null) {
|
||||
firstPixel = false;
|
||||
|
||||
if (fileContent != null) {
|
||||
console.log(fileContent);
|
||||
for (let i=0; i<fileContent['nLayers']; i++) {
|
||||
let layerData = fileContent['layer' + i];
|
||||
let layerImage = fileContent['layer' + i + 'ImageData'];
|
||||
@@ -158,4 +159,11 @@ function newPixel (width, height, palette, fileContent = null) {
|
||||
// Deleting the default layer
|
||||
deleteLayer(false);
|
||||
}
|
||||
|
||||
if (pixelEditorMode == 'Basic') {
|
||||
switchMode('Advanced', false);
|
||||
}
|
||||
else {
|
||||
switchMode('Basic', false);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user