Skip to content

Commit 0f4e6e8

Browse files
authored
remove transparency from asset pack gallery and allow multiple categories (#11144)
1 parent 4cf8433 commit 0f4e6e8

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

pxtlib/tilemap.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,28 @@ namespace pxt {
15891589
}
15901590
if (entry.tilemapTile) {
15911591
tags.push("tile");
1592-
tags.push("category-" + namespaceName)
1592+
1593+
let category: string = undefined;
1594+
if (entry.displayName && entry.displayName.indexOf("--") !== -1) {
1595+
const rawCategory = entry.displayName.split("--")[1].trim();
1596+
const categoryParts = rawCategory.split(/[\s\-]+/g).map((part, index) => {
1597+
if (index === 0) {
1598+
return part
1599+
}
1600+
else {
1601+
return part.charAt(0).toUpperCase() + part.slice(1);
1602+
}
1603+
});
1604+
category = categoryParts.join("");
1605+
}
1606+
1607+
if (!category && !/^transparency(?:4|8|16|32)$/.test(varName)) {
1608+
category = namespaceName
1609+
}
1610+
1611+
if (category) {
1612+
tags.push("category-" + category);
1613+
}
15931614
}
15941615
}
15951616

0 commit comments

Comments
 (0)