Fix saving slot names
This commit is contained in:
@@ -17,6 +17,7 @@ typedef TProjectFormat = {
|
||||
}
|
||||
|
||||
typedef TLayerData = {
|
||||
public var name: String;
|
||||
public var res: Int; // Width pixels
|
||||
public var bpp: Int; // Bits per pixel
|
||||
public var texpaint: haxe.io.Bytes;
|
||||
|
||||
@@ -25,11 +25,10 @@ class BrushSlot {
|
||||
});
|
||||
}
|
||||
canvas = Json.parse(defaultCanvas);
|
||||
canvas.name = "Brush " + (id + 1);
|
||||
}
|
||||
else {
|
||||
canvas = c;
|
||||
}
|
||||
|
||||
canvas.name = "Brush " + (id + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,12 +44,11 @@ class MaterialSlot {
|
||||
});
|
||||
}
|
||||
canvas = Json.parse(defaultCanvas);
|
||||
canvas.name = "Material " + (id + 1);
|
||||
}
|
||||
else {
|
||||
canvas = c;
|
||||
}
|
||||
|
||||
canvas.name = "Material " + (id + 1);
|
||||
}
|
||||
|
||||
public function unload() {
|
||||
|
||||
@@ -46,6 +46,7 @@ class ExportArm {
|
||||
var ld: Array<TLayerData> = [];
|
||||
for (l in Project.layers) {
|
||||
ld.push({
|
||||
name: l.name,
|
||||
res: l.texpaint != null ? l.texpaint.width : Project.layers[0].texpaint.width,
|
||||
bpp: bpp,
|
||||
texpaint: l.texpaint != null ? Lz4.encode(l.texpaint.getPixels()) : null,
|
||||
|
||||
@@ -191,6 +191,7 @@ class ImportArm {
|
||||
var ld = project.layer_datas[i];
|
||||
var isGroup = ld.texpaint == null;
|
||||
var l = new LayerSlot("", isGroup);
|
||||
if (ld.name != null) l.name = ld.name;
|
||||
Project.layers.push(l);
|
||||
|
||||
if (!isGroup) {
|
||||
|
||||
Reference in New Issue
Block a user