Finished implementing editor modes

This commit is contained in:
unsettledgames
2020-07-20 23:33:17 +02:00
parent e9e1ba96da
commit 6be8791dec
8 changed files with 63 additions and 10 deletions

View File

@@ -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);
}
}