Skip to content

Commit

Permalink
Allow part matching in XMLLoader (#15262)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaananW committed Jul 10, 2024
1 parent 8bc5656 commit 2afe025
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/dev/gui/src/2D/xmlLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ export class XmlLoader {
} else {
guiNode.linkWithMesh(window[node.attributes[i].value]);
}
} else if (node.attributes[i].value.startsWith("{{") && node.attributes[i].value.endsWith("}}")) {
const element = this._getChainElement(node.attributes[i].value.substring(2, node.attributes[i].value.length - 2));
} else if (node.attributes[i].value.match(/{{.*}}/)) {
const matches = node.attributes[i].value.match(/{{(.*)}}/);
const element = (node.attributes[i].value as string).replace(/{{.*}}/, `${this._getChainElement(matches[1])}`);
guiNode[node.attributes[i].name] = element;
} else if (!this._objectAttributes[node.attributes[i].name]) {
if (node.attributes[i].value == "true" || node.attributes[i].value == "false") {
Expand Down

0 comments on commit 2afe025

Please sign in to comment.