can now add nodes

This commit is contained in:
2026-04-19 05:45:33 +10:00
parent 7e7e6f2c22
commit 34c2aa4316
23 changed files with 864 additions and 1 deletions

View File

@@ -24,6 +24,21 @@ export class RandomNameNode extends NodeBase {
/** @type {Promise<void> | null} */
static #loadPromise = null;
/**
* @UFUNCTION(BlueprintPure)
*/
static BlueprintPure_GetDefaultPins() {
return {
inputs: [
{ id: 'exec_in', name: '', direction: 'input', kind: 'exec' }
],
outputs: [
{ id: 'exec_out', name: '', direction: 'output', kind: 'exec' },
{ id: 'name', name: 'Name', direction: 'output', kind: 'string' }
]
};
}
/**
* Load name parts from JSON
*/
@@ -59,6 +74,28 @@ export class RandomNameNode extends NodeBase {
return `${first}${second}`;
}
/**
* @UFUNCTION(BlueprintCallable)
* @param {import('./NodeExecutionContext.js').NodeExecutionContext} ctx
*/
async BlueprintCallable_Execute(ctx) {
const graphNode = ctx.BlueprintPure_GetNode();
if (!graphNode) return;
// Generate new name
graphNode._generatedName = RandomNameNode.generateName();
// Update DOM if rendered
const nodeEl = document.querySelector(`[data-node-id="${graphNode.id}"]`);
if (nodeEl) {
const nameDisplay = nodeEl.querySelector('.node-name-display');
if (nameDisplay) {
nameDisplay.textContent = graphNode._generatedName;
}
}
}
/**
* @UFUNCTION(BlueprintNativeEvent)
* @param {HTMLElement} article