mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-14 07:47:29 +08:00
Fix niagara script variables merging
This commit is contained in:
19
dist/ueblueprint.js
vendored
19
dist/ueblueprint.js
vendored
@@ -3866,9 +3866,9 @@ class MirroredEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {InstanceType<T>} */
|
/** @returns {InstanceType<T>} */
|
||||||
valueOf() {
|
valueOf(arg) {
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
return this.getter().valueOf()
|
return this.getter(arg).valueOf()
|
||||||
}
|
}
|
||||||
|
|
||||||
toString() {
|
toString() {
|
||||||
@@ -6654,18 +6654,18 @@ class ObjectEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
/** @type {ObjectEntity} */
|
/** @type {ObjectEntity} */
|
||||||
const subObject = this[k];
|
const subObject = this[k];
|
||||||
if (!subObject.ExportPath?.valueOf().path.includes(this.Name.toString())) {
|
if (!subObject.ExportPath?.valueOf(this).path.includes(this.Name.toString())) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
const originalExportPath = subObject.ExportPath.valueOf();
|
const originalExportPath = subObject.ExportPath.valueOf(this);
|
||||||
const position = originalExportPath.path.indexOf(this.Name.toString());
|
const position = originalExportPath.path.indexOf(this.Name.toString());
|
||||||
const prefix = originalExportPath.path.substring(0, position);
|
const prefix = originalExportPath.path.substring(0, position);
|
||||||
const suffix = originalExportPath.path.substring(position + this.Name.toString().length);
|
const suffix = originalExportPath.path.substring(position + this.Name.toString().length);
|
||||||
const mirroredEntity = /** @type {typeof ObjectEntity} */(subObject.constructor).attributes.ExportPath;
|
const mirroredEntity = /** @type {typeof ObjectEntity} */(subObject.constructor).attributes.ExportPath;
|
||||||
subObject.ExportPath = new mirroredEntity(
|
subObject.ExportPath = new mirroredEntity(
|
||||||
() => new (mirroredEntity.type)(
|
(self = this) => new (mirroredEntity.type)(
|
||||||
originalExportPath.type,
|
originalExportPath.type,
|
||||||
prefix + (this.Name ?? "").toString() + suffix,
|
prefix + (self.Name ?? "").toString() + suffix,
|
||||||
originalExportPath.full
|
originalExportPath.full
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -10288,6 +10288,13 @@ class BlueprintEntity extends ObjectEntity {
|
|||||||
ScriptVariables: super.attributes.ScriptVariables.asUniqueClass(true).withDefault(),
|
ScriptVariables: super.attributes.ScriptVariables.asUniqueClass(true).withDefault(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constructor(...args) {
|
||||||
|
super(...args);
|
||||||
|
if (!this.Name) {
|
||||||
|
this.Name = new (/** @type {typeof ObjectEntity} */(this.constructor).attributes.Name)("Blueprint");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** @param {ObjectEntity} entity */
|
/** @param {ObjectEntity} entity */
|
||||||
getHomonymObjectEntity(entity) {
|
getHomonymObjectEntity(entity) {
|
||||||
const name = entity.getObjectName();
|
const name = entity.getObjectName();
|
||||||
|
|||||||
2
dist/ueblueprint.min.js
vendored
2
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -19,6 +19,13 @@ export default class BlueprintEntity extends ObjectEntity {
|
|||||||
ScriptVariables: super.attributes.ScriptVariables.asUniqueClass(true).withDefault(),
|
ScriptVariables: super.attributes.ScriptVariables.asUniqueClass(true).withDefault(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constructor(...args) {
|
||||||
|
super(...args)
|
||||||
|
if (!this.Name) {
|
||||||
|
this.Name = new (/** @type {typeof ObjectEntity} */(this.constructor).attributes.Name)("Blueprint")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** @param {ObjectEntity} entity */
|
/** @param {ObjectEntity} entity */
|
||||||
getHomonymObjectEntity(entity) {
|
getHomonymObjectEntity(entity) {
|
||||||
const name = entity.getObjectName()
|
const name = entity.getObjectName()
|
||||||
|
|||||||
@@ -67,9 +67,9 @@ export default class MirroredEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {InstanceType<T>} */
|
/** @returns {InstanceType<T>} */
|
||||||
valueOf() {
|
valueOf(arg) {
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
return this.getter().valueOf()
|
return this.getter(arg).valueOf()
|
||||||
}
|
}
|
||||||
|
|
||||||
toString() {
|
toString() {
|
||||||
|
|||||||
@@ -389,18 +389,18 @@ export default class ObjectEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
/** @type {ObjectEntity} */
|
/** @type {ObjectEntity} */
|
||||||
const subObject = this[k]
|
const subObject = this[k]
|
||||||
if (!subObject.ExportPath?.valueOf().path.includes(this.Name.toString())) {
|
if (!subObject.ExportPath?.valueOf(this).path.includes(this.Name.toString())) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
const originalExportPath = subObject.ExportPath.valueOf()
|
const originalExportPath = subObject.ExportPath.valueOf(this)
|
||||||
const position = originalExportPath.path.indexOf(this.Name.toString())
|
const position = originalExportPath.path.indexOf(this.Name.toString())
|
||||||
const prefix = originalExportPath.path.substring(0, position)
|
const prefix = originalExportPath.path.substring(0, position)
|
||||||
const suffix = originalExportPath.path.substring(position + this.Name.toString().length)
|
const suffix = originalExportPath.path.substring(position + this.Name.toString().length)
|
||||||
const mirroredEntity = /** @type {typeof ObjectEntity} */(subObject.constructor).attributes.ExportPath
|
const mirroredEntity = /** @type {typeof ObjectEntity} */(subObject.constructor).attributes.ExportPath
|
||||||
subObject.ExportPath = new mirroredEntity(
|
subObject.ExportPath = new mirroredEntity(
|
||||||
() => new (mirroredEntity.type)(
|
(self = this) => new (mirroredEntity.type)(
|
||||||
originalExportPath.type,
|
originalExportPath.type,
|
||||||
prefix + (this.Name ?? "").toString() + suffix,
|
prefix + (self.Name ?? "").toString() + suffix,
|
||||||
originalExportPath.full
|
originalExportPath.full
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user