Adding warning if "template" object is used as a variable

This commit is contained in:
David Négrier 2021-07-05 18:48:26 +02:00
parent bf17ad4567
commit 0aa93543bc
4 changed files with 40 additions and 3 deletions

View file

@ -48,6 +48,10 @@ export class SharedVariablesManager {
if (layer.type === 'objectgroup') {
for (const object of layer.objects) {
if (object.type === 'variable') {
if (object.template) {
console.warn('Warning, a variable object is using a Tiled "template". WorkAdventure does not support objects generated from Tiled templates.')
}
// We store a copy of the object (to make it immutable)
objects.set(object.name, this.iTiledObjectToVariable(object));
}

View file

@ -141,6 +141,7 @@ export interface ITiledMapObject {
polyline: { x: number; y: number }[];
text?: ITiledText;
template?: string;
}
export interface ITiledText {

View file

@ -190,7 +190,7 @@ window.addEventListener(
}
const payload = message.data;
console.debug(payload);
//console.debug(payload);
if (isIframeErrorAnswerEvent(payload)) {
const queryId = payload.id;

View file

@ -68,8 +68,40 @@
"y":2.5
},
{
"height":0,
"id":5,
"template":"config.tx",
"name":"config",
"point":true,
"properties":[
{
"name":"default",
"type":"string",
"value":"{}"
},
{
"name":"jsonSchema",
"type":"string",
"value":"{}"
},
{
"name":"persist",
"type":"bool",
"value":true
},
{
"name":"readableBy",
"type":"string",
"value":""
},
{
"name":"writableBy",
"type":"string",
"value":"admin"
}],
"rotation":0,
"type":"variable",
"visible":true,
"width":0,
"x":57.5,
"y":111
},
@ -98,7 +130,7 @@
"y":0
}],
"nextlayerid":8,
"nextobjectid":8,
"nextobjectid":9,
"orientation":"orthogonal",
"properties":[
{