mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
Know location fix
This commit is contained in:
@@ -14,6 +14,7 @@ import KeyBindingEntity from "../entity/KeyBindingEntity.js"
|
||||
import LinearColorEntity from "../entity/LinearColorEntity.js"
|
||||
import LocalizedTextEntity from "../entity/LocalizedTextEntity.js"
|
||||
import MacroGraphReferenceEntity from "../entity/MacroGraphReferenceEntity.js"
|
||||
import MirroredEntity from "../entity/MirroredEntity.js"
|
||||
import NaturalNumberEntity from "../entity/NaturalNumberEntity.js"
|
||||
import ObjectEntity from "../entity/ObjectEntity.js"
|
||||
import ObjectReferenceEntity from "../entity/ObjectReferenceEntity.js"
|
||||
@@ -172,6 +173,8 @@ export default class Grammar {
|
||||
? this.unknownValue
|
||||
: P.alt(acc, cur)
|
||||
)
|
||||
} else if (type instanceof MirroredEntity) {
|
||||
return this.grammarFor(type.type.attributes[type.key])
|
||||
} else if (attribute?.constructor === Object) {
|
||||
result = this.grammarFor(undefined, type)
|
||||
} else {
|
||||
@@ -331,8 +334,9 @@ export default class Grammar {
|
||||
valueSeparator,
|
||||
).chain(([attributeName, _1]) => {
|
||||
const attributeKey = attributeName.split(Configuration.keysSeparator)
|
||||
const attributeValue = this.getAttribute(entityType, attributeKey)
|
||||
return this
|
||||
.grammarFor(this.getAttribute(entityType, attributeKey))
|
||||
.grammarFor(attributeValue)
|
||||
.map(attributeValue =>
|
||||
values => Utility.objectSet(values, attributeKey, attributeValue, true)
|
||||
)
|
||||
@@ -688,7 +692,6 @@ export default class Grammar {
|
||||
this.customProperty,
|
||||
this.createAttributeGrammar(ObjectEntity),
|
||||
this.inlinedArrayEntry,
|
||||
// Legacy subobject
|
||||
this.subObjectEntity
|
||||
)
|
||||
)
|
||||
|
||||
@@ -13,6 +13,7 @@ import KeyBindingEntity from "../entity/KeyBindingEntity.js"
|
||||
import LinearColorEntity from "../entity/LinearColorEntity.js"
|
||||
import LocalizedTextEntity from "../entity/LocalizedTextEntity.js"
|
||||
import MacroGraphReferenceEntity from "../entity/MacroGraphReferenceEntity.js"
|
||||
import MirroredEntity from "../entity/MirroredEntity.js"
|
||||
import ObjectEntity from "../entity/ObjectEntity.js"
|
||||
import ObjectReferenceEntity from "../entity/ObjectReferenceEntity.js"
|
||||
import ObjectSerializer from "./ObjectSerializer.js"
|
||||
@@ -54,7 +55,6 @@ export default function initializeSerializerFactory() {
|
||||
(array, insideString) =>
|
||||
`(${array
|
||||
.map(v =>
|
||||
// @ts-expect-error
|
||||
SerializerFactory.getSerializer(Utility.getType(v)).write(v, insideString) + ","
|
||||
)
|
||||
.join("")
|
||||
@@ -104,7 +104,6 @@ export default function initializeSerializerFactory() {
|
||||
(v, insideString) => {
|
||||
let result = FormatTextEntity.lookbehind + "("
|
||||
+ v.value.map(v =>
|
||||
// @ts-expect-error
|
||||
SerializerFactory.getSerializer(Utility.getType(v)).write(v, insideString)
|
||||
).join(", ")
|
||||
+ ")"
|
||||
@@ -163,6 +162,11 @@ export default function initializeSerializerFactory() {
|
||||
new Serializer(MacroGraphReferenceEntity, Serializer.bracketsWrapped)
|
||||
)
|
||||
|
||||
SerializerFactory.registerSerializer(
|
||||
MirroredEntity,
|
||||
new Serializer(MirroredEntity)
|
||||
)
|
||||
|
||||
SerializerFactory.registerSerializer(
|
||||
Number,
|
||||
new ToStringSerializer(Number)
|
||||
|
||||
Reference in New Issue
Block a user