From 2afe025ccb9a86724dde9fcb2bc8d3df48199a46 Mon Sep 17 00:00:00 2001 From: Raanan Weber Date: Wed, 10 Jul 2024 19:14:32 +0200 Subject: [PATCH] Allow part matching in XMLLoader (#15262) --- packages/dev/gui/src/2D/xmlLoader.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/dev/gui/src/2D/xmlLoader.ts b/packages/dev/gui/src/2D/xmlLoader.ts index acdadbb3871..ba43bd112cc 100644 --- a/packages/dev/gui/src/2D/xmlLoader.ts +++ b/packages/dev/gui/src/2D/xmlLoader.ts @@ -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") {