mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-18 20:34:54 +08:00
Generic unknown keys object entity
This commit is contained in:
@@ -109,4 +109,9 @@ export default class IEntity extends Observable {
|
||||
}
|
||||
defineAllAttributes(this, attributes, values)
|
||||
}
|
||||
|
||||
unexpectedKeys() {
|
||||
// @ts-expect-error
|
||||
return Object.getOwnPropertyNames(this).length - Object.getOwnPropertyNames(this.constructor.attributes).length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ export default class ObjectEntity extends IEntity {
|
||||
}
|
||||
|
||||
static nameRegex = /^(\w+?)(?:_(\d+))?$/
|
||||
static sequencerScriptingNameRegex = /\/Script\/SequencerScripting\.MovieSceneScripting(.+)Channel/
|
||||
|
||||
constructor(options = {}) {
|
||||
super(options)
|
||||
@@ -96,6 +97,12 @@ export default class ObjectEntity extends IEntity {
|
||||
let name = ""
|
||||
switch (this.getType()) {
|
||||
case Configuration.nodeType.callFunction:
|
||||
if (this.FunctionReference.MemberName === "AddKey") {
|
||||
let result = this.FunctionReference.MemberParent.path.match(ObjectEntity.sequencerScriptingNameRegex)
|
||||
if (result) {
|
||||
return `Add Key (${Utility.formatStringName(result[1])})`
|
||||
}
|
||||
}
|
||||
return Utility.formatStringName(this.FunctionReference.MemberName)
|
||||
case Configuration.nodeType.dynamicCast:
|
||||
return `Cast To ${this.TargetType.getName()}`
|
||||
|
||||
14
js/entity/UnknownKeysEntity.js
Normal file
14
js/entity/UnknownKeysEntity.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import IEntity from "./IEntity"
|
||||
import TypeInitialization from "./TypeInitialization"
|
||||
|
||||
export default class UnknownKeysEntity extends IEntity {
|
||||
|
||||
static attributes = {
|
||||
lookbehind: new TypeInitialization(String, false, "", false, true)
|
||||
}
|
||||
|
||||
constructor(values = {}) {
|
||||
super(values)
|
||||
/** @type {String} */ this.lookbehind
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,20 @@
|
||||
import IEntity from "./IEntity"
|
||||
import GuidEntity from "./GuidEntity"
|
||||
import TypeInitialization from "./TypeInitialization"
|
||||
|
||||
export default class VariableReferenceEntity extends IEntity {
|
||||
|
||||
static attributes = {
|
||||
MemberScope: new TypeInitialization(String, false),
|
||||
MemberName: String,
|
||||
MemberGuid: GuidEntity,
|
||||
bSelfContext: false,
|
||||
bSelfContext: new TypeInitialization(Boolean, false, false)
|
||||
}
|
||||
|
||||
constructor(values = {}) {
|
||||
super(values)
|
||||
/** @type {String} */ this.MemberName
|
||||
/** @type {GuidEntity} */ this.GuidEntity
|
||||
/** @type {Boolean} */ this.bSelfContext
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user