Added LayerList to handle all the functions that involve more than 1 layer

Merge, flatten, add layer, delete layer etc, I'm planning to move a few global variables in Layer to LayerList.
This commit is contained in:
unsettledgames
2021-07-22 22:42:41 +02:00
parent 804a0335b1
commit 6e4ab3990d
10 changed files with 692 additions and 694 deletions

View File

@@ -67,7 +67,7 @@ const Startup = (() => {
if (fileContent != null) {
loadFromLPE(fileContent);
// Deleting the default layer
deleteLayer(false);
LayerList.deleteLayer(false);
// Selecting the new one
layers[1].selectLayer();
}
@@ -92,7 +92,7 @@ const Startup = (() => {
if (currentEntry != null) {
// Getting the associated layer
associatedLayer = getLayerByID(currentEntry.id);
associatedLayer = LayerList.getLayerByID(currentEntry.id);
// Deleting its canvas
associatedLayer.canvas.remove();
@@ -197,7 +197,7 @@ const Startup = (() => {
if (layerData != null) {
// Setting id
let createdLayer = addLayer(layerData.id, false);
let createdLayer = LayerList.addLayer(layerData.id, false);
// Setting name
createdLayer.menuEntry.getElementsByTagName("p")[0].innerHTML = layerData.name;