mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-16 02:10:38 +08:00
WIP
This commit is contained in:
@@ -29,24 +29,8 @@ export default class Copy extends IInput {
|
||||
window.removeEventListener("copy", this.#copyHandler)
|
||||
}
|
||||
|
||||
getSerializedText() {
|
||||
const nodes = this.blueprint.getNodes(true).map(n => n.entity)
|
||||
let exports = false
|
||||
let result = nodes
|
||||
.filter(n => {
|
||||
exports ||= n.exported
|
||||
return !n.exported
|
||||
})
|
||||
.reduce((acc, cur) => acc + cur.serialize(), "")
|
||||
if (exports) {
|
||||
const object = new NiagaraClipboardContent(this.blueprint.entity, nodes)
|
||||
result = object.serialize() + result
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
copied() {
|
||||
const value = this.getSerializedText()
|
||||
const value = this.blueprint.getSerializedText()
|
||||
navigator.clipboard.writeText(value)
|
||||
return value
|
||||
}
|
||||
|
||||
@@ -33,13 +33,6 @@ export default class Cut extends IInput {
|
||||
window.removeEventListener("cut", this.#cutHandler)
|
||||
}
|
||||
|
||||
getSerializedText() {
|
||||
return this.blueprint
|
||||
.getNodes(true)
|
||||
.map(node => node.entity.serialize())
|
||||
.join("")
|
||||
}
|
||||
|
||||
cut() {
|
||||
this.blueprint.template.getCopyInputObject().copied()
|
||||
this.blueprint.removeGraphElement(...this.blueprint.getNodes(true))
|
||||
|
||||
Reference in New Issue
Block a user