Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/client/APP.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,31 @@ class APP {

let files = [];

let hasPattern = false;

//Trying to get a pattern
let pattern = textureName.substring(
textureName.indexOf("{") + 1,
textureName.lastIndexOf("}")
);

if(pattern && pattern.includes("$")) { //Checking for pattern to exist and has an "$" to replace for index
hasPattern = true;
}

let ix = 0;
for (let item of this.packResult) {

let fName = textureName + (this.packResult.length > 1 ? "-" + ix : "");
if(this.packResult.length > 1) {
if(hasPattern) {
fName = textureName.replace("{" + pattern + "}", pattern.replace("$", ix));
} else {
fName = textureName + "-" + ix;
}
}
else {
fName = textureName;
}

let buffer = item.renderer.scale(this.packOptions.scale);

Expand Down