mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-15 09:44:49 +08:00
Fixing mirrored ExportPath
This commit is contained in:
55
dist/ueblueprint.js
vendored
55
dist/ueblueprint.js
vendored
@@ -6642,36 +6642,39 @@ class ObjectEntity extends IEntity {
|
||||
});
|
||||
|
||||
// Mirror name part of the object in ExportPath
|
||||
const originalName = this.Name?.toString();
|
||||
const exportPath = this.ExportPath?.valueOf();
|
||||
if (exportPath?.path.endsWith(this.Name?.toString())) {
|
||||
if (originalName && exportPath?.path.endsWith(originalName)) {
|
||||
const mirroredEntity = /** @type {typeof ObjectEntity} */(this.constructor).attributes.ExportPath;
|
||||
const prefix = exportPath.path.substring(0, exportPath.path.length - this.Name.toString().length);
|
||||
this.ExportPath = new mirroredEntity(
|
||||
() => new (mirroredEntity.type)(exportPath.type, prefix + this.Name.toString(), exportPath.full)
|
||||
() => new (mirroredEntity.type)(
|
||||
exportPath.type,
|
||||
exportPath.path.replace(originalName, (this.Name ?? "")?.toString()),
|
||||
exportPath.full
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Mirror name part of the nested object in ExportPath
|
||||
if (this.Name) {
|
||||
for (const k of Object.keys(this)) {
|
||||
if (!k.startsWith(Configuration.subObjectAttributeNamePrefix)) {
|
||||
if (originalName) {
|
||||
const values = Object.values(this);
|
||||
for (let i = 0; i < values.length; ++i) {
|
||||
const value = values[i];
|
||||
if (value instanceof ObjectEntity) {
|
||||
values.push(...Object.values(value));
|
||||
if (!value.ExportPath?.valueOf(this).path.includes(originalName)) {
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
/** @type {ObjectEntity} */
|
||||
const subObject = this[k];
|
||||
if (!subObject.ExportPath?.valueOf(this).path.includes(this.Name.toString())) {
|
||||
continue
|
||||
}
|
||||
const originalExportPath = subObject.ExportPath.valueOf(this);
|
||||
const position = originalExportPath.path.indexOf(this.Name.toString());
|
||||
const prefix = originalExportPath.path.substring(0, position);
|
||||
const suffix = originalExportPath.path.substring(position + this.Name.toString().length);
|
||||
const mirroredEntity = /** @type {typeof ObjectEntity} */(subObject.constructor).attributes.ExportPath;
|
||||
subObject.ExportPath = new mirroredEntity(
|
||||
const mirroredEntity = /** @type {typeof ObjectEntity} */(value.constructor).attributes.ExportPath;
|
||||
const exportPath = value.ExportPath?.valueOf();
|
||||
value.ExportPath = new mirroredEntity(
|
||||
(self = this) => new (mirroredEntity.type)(
|
||||
originalExportPath.type,
|
||||
prefix + (self.Name ?? "").toString() + suffix,
|
||||
originalExportPath.full
|
||||
exportPath.type,
|
||||
exportPath.path.replace(originalName, (this.Name ?? "")?.toString()),
|
||||
exportPath.full
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -10172,8 +10175,8 @@ class NodeElement extends ISelectableDraggableElement {
|
||||
"Name",
|
||||
/** @param {InstanceType<typeof ObjectEntity.attributes.Name>} newName */
|
||||
newName => {
|
||||
this.#redirectLinksBeforeRename(newName.value);
|
||||
this.nodeTitle = newName.value;
|
||||
this.#redirectLinksBeforeRename(newName?.toString());
|
||||
this.nodeTitle = newName?.toString();
|
||||
this.nodeDisplayName = nodeTitle(entity);
|
||||
}
|
||||
);
|
||||
@@ -11634,9 +11637,11 @@ class Blueprint extends IElement {
|
||||
this.entity.updateNameIndex(name);
|
||||
if (element.getType() == Configuration.paths.niagaraClipboardContent) {
|
||||
this.entity = this.entity.mergeWith(element.entity);
|
||||
const additionalSerialization = atob(element.entity.ExportedNodes.toString());
|
||||
this.template.getPasteInputObject().pasted(additionalSerialization)
|
||||
.forEach(node => node.entity.exported = true);
|
||||
const additionalSerialization = atob(element.entity.ExportedNodes?.toString() ?? "");
|
||||
if (additionalSerialization) {
|
||||
this.template.getPasteInputObject().pasted(additionalSerialization)
|
||||
.forEach(node => node.entity.exported = true);
|
||||
}
|
||||
continue
|
||||
}
|
||||
const homonym = this.entity.getHomonymObjectEntity(element.entity);
|
||||
|
||||
2
dist/ueblueprint.min.js
vendored
2
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -413,9 +413,11 @@ export default class Blueprint extends IElement {
|
||||
this.entity.updateNameIndex(name)
|
||||
if (element.getType() == Configuration.paths.niagaraClipboardContent) {
|
||||
this.entity = this.entity.mergeWith(element.entity)
|
||||
const additionalSerialization = atob(element.entity.ExportedNodes.toString())
|
||||
this.template.getPasteInputObject().pasted(additionalSerialization)
|
||||
.forEach(node => node.entity.exported = true)
|
||||
const additionalSerialization = atob(element.entity.ExportedNodes?.toString() ?? "")
|
||||
if (additionalSerialization) {
|
||||
this.template.getPasteInputObject().pasted(additionalSerialization)
|
||||
.forEach(node => node.entity.exported = true)
|
||||
}
|
||||
continue
|
||||
}
|
||||
const homonym = this.entity.getHomonymObjectEntity(element.entity)
|
||||
|
||||
@@ -135,8 +135,8 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
"Name",
|
||||
/** @param {InstanceType<typeof ObjectEntity.attributes.Name>} newName */
|
||||
newName => {
|
||||
this.#redirectLinksBeforeRename(newName.value)
|
||||
this.nodeTitle = newName.value
|
||||
this.#redirectLinksBeforeRename(newName?.toString())
|
||||
this.nodeTitle = newName?.toString()
|
||||
this.nodeDisplayName = nodeTitle(entity)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -372,36 +372,39 @@ export default class ObjectEntity extends IEntity {
|
||||
})
|
||||
|
||||
// Mirror name part of the object in ExportPath
|
||||
const originalName = this.Name?.toString()
|
||||
const exportPath = this.ExportPath?.valueOf()
|
||||
if (exportPath?.path.endsWith(this.Name?.toString())) {
|
||||
if (originalName && exportPath?.path.endsWith(originalName)) {
|
||||
const mirroredEntity = /** @type {typeof ObjectEntity} */(this.constructor).attributes.ExportPath
|
||||
const prefix = exportPath.path.substring(0, exportPath.path.length - this.Name.toString().length)
|
||||
this.ExportPath = new mirroredEntity(
|
||||
() => new (mirroredEntity.type)(exportPath.type, prefix + this.Name.toString(), exportPath.full)
|
||||
() => new (mirroredEntity.type)(
|
||||
exportPath.type,
|
||||
exportPath.path.replace(originalName, (this.Name ?? "")?.toString()),
|
||||
exportPath.full
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// Mirror name part of the nested object in ExportPath
|
||||
if (this.Name) {
|
||||
for (const k of Object.keys(this)) {
|
||||
if (!k.startsWith(Configuration.subObjectAttributeNamePrefix)) {
|
||||
if (originalName) {
|
||||
const values = Object.values(this)
|
||||
for (let i = 0; i < values.length; ++i) {
|
||||
const value = values[i]
|
||||
if (value instanceof ObjectEntity) {
|
||||
values.push(...Object.values(value))
|
||||
if (!value.ExportPath?.valueOf(this).path.includes(originalName)) {
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
/** @type {ObjectEntity} */
|
||||
const subObject = this[k]
|
||||
if (!subObject.ExportPath?.valueOf(this).path.includes(this.Name.toString())) {
|
||||
continue
|
||||
}
|
||||
const originalExportPath = subObject.ExportPath.valueOf(this)
|
||||
const position = originalExportPath.path.indexOf(this.Name.toString())
|
||||
const prefix = originalExportPath.path.substring(0, position)
|
||||
const suffix = originalExportPath.path.substring(position + this.Name.toString().length)
|
||||
const mirroredEntity = /** @type {typeof ObjectEntity} */(subObject.constructor).attributes.ExportPath
|
||||
subObject.ExportPath = new mirroredEntity(
|
||||
const mirroredEntity = /** @type {typeof ObjectEntity} */(value.constructor).attributes.ExportPath
|
||||
const exportPath = value.ExportPath?.valueOf()
|
||||
value.ExportPath = new mirroredEntity(
|
||||
(self = this) => new (mirroredEntity.type)(
|
||||
originalExportPath.type,
|
||||
prefix + (self.Name ?? "").toString() + suffix,
|
||||
originalExportPath.full
|
||||
exportPath.type,
|
||||
exportPath.path.replace(originalName, (this.Name ?? "")?.toString()),
|
||||
exportPath.full
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
16
tests/fixtures/BlueprintFixture.js
vendored
16
tests/fixtures/BlueprintFixture.js
vendored
@@ -106,14 +106,14 @@ export default class BlueprintFixture {
|
||||
|
||||
async setup() {
|
||||
const url = `http://127.0.0.1:${this.#port}/empty.html`
|
||||
try {
|
||||
await this.page.goto(url)
|
||||
} catch (e) {
|
||||
if (e.message.includes("ERR_CONNECTION_REFUSED")) {
|
||||
await this.createServer()
|
||||
await this.page.goto(url)
|
||||
} else {
|
||||
throw e
|
||||
for (let i = 0; i < 1E4; ++i) {
|
||||
try {
|
||||
await this.page.goto(url, { waitUntil: "domcontentloaded" })
|
||||
break
|
||||
} catch (e) {
|
||||
if (e.message.includes("ERR_CONNECTION_REFUSED")) {
|
||||
await this.createServer()
|
||||
}
|
||||
}
|
||||
}
|
||||
this.#blueprintLocator = this.page.locator("ueb-blueprint")
|
||||
|
||||
6
tests/fixtures/test.js
vendored
6
tests/fixtures/test.js
vendored
@@ -42,7 +42,7 @@ export const test = /**
|
||||
}
|
||||
)
|
||||
|
||||
test.setTimeout(3000)
|
||||
test.setTimeout(10000)
|
||||
|
||||
export const expect = base.expect
|
||||
export * from "@playwright/test"
|
||||
@@ -194,8 +194,8 @@ export function testNode(testData) {
|
||||
async ({ blueprintPage }) => {
|
||||
const variadic = blueprintPage.node.getByText("Add pin")
|
||||
await expect(variadic).toBeVisible()
|
||||
await variadic.hover({ timeout: 1000 })
|
||||
await variadic.click({ timeout: 1000 })
|
||||
await variadic.hover({ timeout: 10000 })
|
||||
await variadic.click({ timeout: 10000 })
|
||||
expect(await blueprintPage.node.locator("ueb-pin").all()).toHaveLength(testData.pins + 1)
|
||||
await variadic.blur()
|
||||
}
|
||||
|
||||
204
tests/mirroredExportPath.spec.js
Normal file
204
tests/mirroredExportPath.spec.js
Normal file
@@ -0,0 +1,204 @@
|
||||
import { expect, test } from "./fixtures/test.js"
|
||||
|
||||
const firstRowOnly = v => v.replaceAll(/^\s+|\n.+/gs, "")
|
||||
|
||||
test("Renaming", async ({ blueprintPage }) => {
|
||||
let source = String.raw`
|
||||
Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_40" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.MaterialGraphNode_40"'
|
||||
End Object
|
||||
`
|
||||
await blueprintPage.paste(source)
|
||||
expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual(
|
||||
`Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_40" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.MaterialGraphNode_40"'`
|
||||
)
|
||||
await blueprintPage.node.evaluate(n => n = "new name")
|
||||
await blueprintPage.node.evaluate(n => n.entity.Name.value = "new name")
|
||||
expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual(
|
||||
`Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="new name" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.new name"'`
|
||||
)
|
||||
await blueprintPage.node.evaluate(n => n.entity.Name = new (n.entity.constructor.attributes.Name)("new name 2"))
|
||||
expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual(
|
||||
`Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="new name 2" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.new name 2"'`
|
||||
)
|
||||
await blueprintPage.node.evaluate(n => n.entity.Name = new (n.entity.constructor.attributes.Name)())
|
||||
expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual(
|
||||
`Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0."'`
|
||||
)
|
||||
await blueprintPage.node.evaluate(n => delete n.entity.Name)
|
||||
expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual(
|
||||
`Begin Object Class=/Script/UnrealEd.MaterialGraphNode ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0."'`
|
||||
)
|
||||
})
|
||||
|
||||
test("Inner renaming", async ({ blueprintPage }) => {
|
||||
let source = String.raw`
|
||||
Begin Object Class=/Script/PCGEditor.PCGEditorGraphNode Name="PCGEditorGraphNode_2" ExportPath=/Script/PCGEditor.PCGEditorGraphNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2"'
|
||||
Begin Object Class=/Script/PCG.PCGNode Name="ExecuteBlueprint_7" ExportPath=/Script/PCG.PCGNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7"'
|
||||
Begin Object Class=/Script/PCG.PCGBlueprintSettings Name="PCGBlueprintSettings_0" ExportPath=/Script/PCG.PCGBlueprintSettings'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7.PCGBlueprintSettings_0"'
|
||||
End Object
|
||||
Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_0" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7.PCGPin_0"'
|
||||
End Object
|
||||
Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_1" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7.PCGPin_1"'
|
||||
End Object
|
||||
Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_2" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7.PCGPin_2"'
|
||||
End Object
|
||||
Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_3" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7.PCGPin_3"'
|
||||
End Object
|
||||
End Object
|
||||
Begin Object Name="ExecuteBlueprint_7" ExportPath=/Script/PCG.PCGNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7"'
|
||||
Begin Object Name="PCGBlueprintSettings_0" ExportPath=/Script/PCG.PCGBlueprintSettings'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7.PCGBlueprintSettings_0"'
|
||||
"Seed"=-1282097489
|
||||
"bExposeToLibrary"=False
|
||||
"CachedOverridableParams"(0)=(Label="Seed",PropertiesNames=("Seed"),PropertyClass=/Script/CoreUObject.Class'"/Script/PCG.PCGBlueprintSettings"')
|
||||
End Object
|
||||
End Object
|
||||
End Object
|
||||
`
|
||||
|
||||
await blueprintPage.paste(source)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n => n.entity.serialize()))).toEqual(
|
||||
`Begin Object Class=/Script/PCGEditor.PCGEditorGraphNode Name="PCGEditorGraphNode_2" ExportPath=/Script/PCGEditor.PCGEditorGraphNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGNode Name="ExecuteBlueprint_7" ExportPath=/Script/PCG.PCGNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGBlueprintSettings_PCGBlueprintSettings_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGBlueprintSettings Name="PCGBlueprintSettings_0" ExportPath=/Script/PCG.PCGBlueprintSettings'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7.PCGBlueprintSettings_0"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGPin_PCGPin_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_0" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7.PCGPin_0"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGPin_PCGPin_2'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_2" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7.PCGPin_2"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_ExecuteBlueprint_7'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Name="ExecuteBlueprint_7" ExportPath=/Script/PCG.PCGNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_ExecuteBlueprint_7']['#SubObject_PCGBlueprintSettings_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Name="PCGBlueprintSettings_0" ExportPath=/Script/PCG.PCGBlueprintSettings'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2.ExecuteBlueprint_7.PCGBlueprintSettings_0"'`
|
||||
)
|
||||
|
||||
// Rename outer object PCGEditorGraphNode_2 -> Name1
|
||||
await blueprintPage.node.evaluate(n => n.entity.Name.value = "Name1")
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n => n.entity.serialize()))).toEqual(
|
||||
`Begin Object Class=/Script/PCGEditor.PCGEditorGraphNode Name="Name1" ExportPath=/Script/PCGEditor.PCGEditorGraphNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.Name1"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGNode Name="ExecuteBlueprint_7" ExportPath=/Script/PCG.PCGNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.Name1.ExecuteBlueprint_7"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGBlueprintSettings_PCGBlueprintSettings_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGBlueprintSettings Name="PCGBlueprintSettings_0" ExportPath=/Script/PCG.PCGBlueprintSettings'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.Name1.ExecuteBlueprint_7.PCGBlueprintSettings_0"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGPin_PCGPin_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_0" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.Name1.ExecuteBlueprint_7.PCGPin_0"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGPin_PCGPin_2'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_2" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.Name1.ExecuteBlueprint_7.PCGPin_2"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_ExecuteBlueprint_7'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Name="ExecuteBlueprint_7" ExportPath=/Script/PCG.PCGNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.Name1.ExecuteBlueprint_7"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_ExecuteBlueprint_7']['#SubObject_PCGBlueprintSettings_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Name="PCGBlueprintSettings_0" ExportPath=/Script/PCG.PCGBlueprintSettings'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.Name1.ExecuteBlueprint_7.PCGBlueprintSettings_0"'`
|
||||
)
|
||||
|
||||
// Rename outer object another name -> new StringEntity("another name")
|
||||
await blueprintPage.node.evaluate(n => n.entity.Name = new (n.entity.constructor.attributes.Name)("another name"))
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n => n.entity.serialize()))).toEqual(
|
||||
`Begin Object Class=/Script/PCGEditor.PCGEditorGraphNode Name="another name" ExportPath=/Script/PCGEditor.PCGEditorGraphNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.another name"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGNode Name="ExecuteBlueprint_7" ExportPath=/Script/PCG.PCGNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.another name.ExecuteBlueprint_7"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGBlueprintSettings_PCGBlueprintSettings_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGBlueprintSettings Name="PCGBlueprintSettings_0" ExportPath=/Script/PCG.PCGBlueprintSettings'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.another name.ExecuteBlueprint_7.PCGBlueprintSettings_0"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGPin_PCGPin_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_0" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.another name.ExecuteBlueprint_7.PCGPin_0"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGPin_PCGPin_2'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_2" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.another name.ExecuteBlueprint_7.PCGPin_2"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_ExecuteBlueprint_7'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Name="ExecuteBlueprint_7" ExportPath=/Script/PCG.PCGNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.another name.ExecuteBlueprint_7"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_ExecuteBlueprint_7']['#SubObject_PCGBlueprintSettings_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Name="PCGBlueprintSettings_0" ExportPath=/Script/PCG.PCGBlueprintSettings'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.another name.ExecuteBlueprint_7.PCGBlueprintSettings_0"'`
|
||||
)
|
||||
|
||||
// Rename outer object another name -> null
|
||||
await blueprintPage.node.evaluate(n => n.entity.Name = null)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n => n.entity.serialize()))).toEqual(
|
||||
`Begin Object Class=/Script/PCGEditor.PCGEditorGraphNode ExportPath=/Script/PCGEditor.PCGEditorGraphNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1."'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGNode Name="ExecuteBlueprint_7" ExportPath=/Script/PCG.PCGNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1..ExecuteBlueprint_7"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGBlueprintSettings_PCGBlueprintSettings_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGBlueprintSettings Name="PCGBlueprintSettings_0" ExportPath=/Script/PCG.PCGBlueprintSettings'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1..ExecuteBlueprint_7.PCGBlueprintSettings_0"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGPin_PCGPin_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_0" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1..ExecuteBlueprint_7.PCGPin_0"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_/Script/PCG.PCGNode_ExecuteBlueprint_7']['#SubObject_/Script/PCG.PCGPin_PCGPin_2'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Class=/Script/PCG.PCGPin Name="PCGPin_2" ExportPath=/Script/PCG.PCGPin'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1..ExecuteBlueprint_7.PCGPin_2"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_ExecuteBlueprint_7'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Name="ExecuteBlueprint_7" ExportPath=/Script/PCG.PCGNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1..ExecuteBlueprint_7"'`
|
||||
)
|
||||
expect(firstRowOnly(await blueprintPage.node.evaluate(n =>
|
||||
n.entity['#SubObject_ExecuteBlueprint_7']['#SubObject_PCGBlueprintSettings_0'].serialize()
|
||||
))).toEqual(
|
||||
`Begin Object Name="PCGBlueprintSettings_0" ExportPath=/Script/PCG.PCGBlueprintSettings'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1..ExecuteBlueprint_7.PCGBlueprintSettings_0"'`
|
||||
)
|
||||
})
|
||||
|
||||
test("Adopted renaming", async ({ blueprintPage }) => {
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user