mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-19 12:27:39 +08:00
Default attributes warning
This commit is contained in:
@@ -19,11 +19,17 @@ export default class IEntity {
|
||||
Object.getOwnPropertyNames(properties),
|
||||
Object.getOwnPropertyNames(values ?? {})
|
||||
)) {
|
||||
if (!(property in properties)) {
|
||||
console.warn(`Property ${prefix}${property} is not defined in ${this.constructor.name}`)
|
||||
}
|
||||
let defaultValue = properties[property]
|
||||
const defaultType = Utility.getType(defaultValue)
|
||||
if (!(property in properties)) {
|
||||
console.warn(`Property ${prefix}${property} is not defined in ${this.constructor.name}`)
|
||||
} else if (
|
||||
defaultValue != null
|
||||
&& !(defaultValue instanceof TypeInitialization && !defaultValue.showDefault)
|
||||
&& !(property in values)
|
||||
) {
|
||||
console.warn(`${this.constructor.name} adds property ${prefix}${property} not defined in the serialized data`)
|
||||
}
|
||||
// Not instanceof because all objects are instenceof Object, exact match needed
|
||||
if (defaultType === Object) {
|
||||
target[property] = {}
|
||||
|
||||
@@ -15,6 +15,11 @@ export default class KeyBindingEntity extends IEntity {
|
||||
}
|
||||
|
||||
constructor(options = {}) {
|
||||
options.ActionName = options.ActionName ?? ""
|
||||
options.bShift = options.bShift ?? false
|
||||
options.bCtrl = options.bCtrl ?? false
|
||||
options.bAlt = options.bAlt ?? false
|
||||
options.bCmd = options.bCmd ?? false
|
||||
super(options)
|
||||
/** @type {String} */ this.ActionName
|
||||
/** @type {Boolean} */ this.bShift
|
||||
|
||||
@@ -27,10 +27,11 @@ export default class PinEntity extends IEntity {
|
||||
bIsConst: false,
|
||||
bIsWeakPointer: false,
|
||||
bIsUObjectWrapper: false,
|
||||
bSerializeAsSinglePrecisionFloat: false,
|
||||
},
|
||||
LinkedTo: new TypeInitialization([PinReferenceEntity], false),
|
||||
DefaultValue: new TypeInitialization(String, false),
|
||||
AutogeneratedDefaultValue: "",
|
||||
AutogeneratedDefaultValue: new TypeInitialization(String, false),
|
||||
DefaultObject: new TypeInitialization(ObjectReferenceEntity, false, null),
|
||||
PersistentGuid: GuidEntity,
|
||||
bHidden: false,
|
||||
|
||||
Reference in New Issue
Block a user