mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:17:41 +08:00
Fix unexpected key types
This commit is contained in:
14
dist/ueblueprint.js
vendored
14
dist/ueblueprint.js
vendored
@@ -935,8 +935,9 @@ class IEntity {
|
||||
|
||||
if (!suppressWarns) {
|
||||
if (!(attributeName in attributes)) {
|
||||
const typeName = value instanceof Array ? `[${value[0].constructor.name}]` : value.constructor.name;
|
||||
console.warn(
|
||||
`UEBlueprint: Attribute ${attributeName} in the serialized data is not defined in `
|
||||
`UEBlueprint: Attribute ${attributeName} (of type ${typeName}) in the serialized data is not defined in `
|
||||
+ `${this.constructor.name}.attributes`
|
||||
);
|
||||
} else if (
|
||||
@@ -1231,7 +1232,7 @@ class FormatTextEntity extends IEntity {
|
||||
static lookbehind = "LOCGEN_FORMAT_NAMED"
|
||||
static attributes = {
|
||||
value: {
|
||||
type: [new UnionType(LocalizedTextEntity, InvariantTextEntity, FormatTextEntity)],
|
||||
type: [new UnionType(LocalizedTextEntity, String, InvariantTextEntity, FormatTextEntity)],
|
||||
},
|
||||
}
|
||||
|
||||
@@ -2025,6 +2026,14 @@ class PinEntity extends IEntity {
|
||||
type: [PinReferenceEntity],
|
||||
showDefault: false,
|
||||
},
|
||||
SubPins: {
|
||||
type: [PinReferenceEntity],
|
||||
showDefault: false,
|
||||
},
|
||||
ParentPin: {
|
||||
type: PinReferenceEntity,
|
||||
showDefault: false,
|
||||
},
|
||||
DefaultValue: {
|
||||
/** @param {PinEntity} pinEntity */
|
||||
type: new ComputedType(pinEntity => pinEntity.getEntityType(true) ?? String),
|
||||
@@ -3704,6 +3713,7 @@ class Grammar {
|
||||
this.objectReferenceEntity,
|
||||
this.unknownKeysEntity,
|
||||
this.symbol,
|
||||
this.grammarFor(undefined, [PinReferenceEntity]),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
2
dist/ueblueprint.min.js
vendored
2
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -8,7 +8,7 @@ export default class FormatTextEntity extends IEntity {
|
||||
static lookbehind = "LOCGEN_FORMAT_NAMED"
|
||||
static attributes = {
|
||||
value: {
|
||||
type: [new UnionType(LocalizedTextEntity, InvariantTextEntity, FormatTextEntity)],
|
||||
type: [new UnionType(LocalizedTextEntity, String, InvariantTextEntity, FormatTextEntity)],
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -59,8 +59,9 @@ export default class IEntity {
|
||||
|
||||
if (!suppressWarns) {
|
||||
if (!(attributeName in attributes)) {
|
||||
const typeName = value instanceof Array ? `[${value[0].constructor.name}]` : value.constructor.name
|
||||
console.warn(
|
||||
`UEBlueprint: Attribute ${attributeName} in the serialized data is not defined in `
|
||||
`UEBlueprint: Attribute ${attributeName} (of type ${typeName}) in the serialized data is not defined in `
|
||||
+ `${this.constructor.name}.attributes`
|
||||
)
|
||||
} else if (
|
||||
|
||||
@@ -110,6 +110,14 @@ export default class PinEntity extends IEntity {
|
||||
type: [PinReferenceEntity],
|
||||
showDefault: false,
|
||||
},
|
||||
SubPins: {
|
||||
type: [PinReferenceEntity],
|
||||
showDefault: false,
|
||||
},
|
||||
ParentPin: {
|
||||
type: PinReferenceEntity,
|
||||
showDefault: false,
|
||||
},
|
||||
DefaultValue: {
|
||||
/** @param {PinEntity} pinEntity */
|
||||
type: new ComputedType(pinEntity => pinEntity.getEntityType(true) ?? String),
|
||||
|
||||
@@ -531,6 +531,7 @@ export default class Grammar {
|
||||
this.objectReferenceEntity,
|
||||
this.unknownKeysEntity,
|
||||
this.symbol,
|
||||
this.grammarFor(undefined, [PinReferenceEntity]),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user