/** * @file CustomEventNode.js * @UCLASS(BlueprintType, Blueprintable) */ import { NodeBase } from './NodeBase.js'; import { NodeRegistry } from './NodeRegistry.js'; const HAND_SVG = ``; /** * @UCLASS(BlueprintType) * Entry-point event node. Adds pulsate animation and a hand-pointer hint. */ export class CustomEventNode extends NodeBase { /** @UCLASS(BlueprintType) */ static NodeType = "custom_event"; /** * @UFUNCTION(BlueprintPure) */ static BlueprintPure_GetDefaultPins() { return { inputs: [], outputs: [ { id: 'exec_out', name: '', direction: 'output', kind: 'exec' } ] }; } /** * @UFUNCTION(BlueprintNativeEvent) * @param {HTMLElement} article * @param {import('../GraphNode.js').GraphNode} graphNode */ BlueprintNativeEvent_OnRender(article, graphNode) { const outputs = article.querySelector(".node-outputs"); if (!outputs) return; const execPin = outputs.querySelector('[data-pin-id="exec_out"]'); if (!execPin) return; execPin.classList.add("pin--pulsate"); execPin.style.position = "relative"; const handHint = document.createElement("div"); handHint.className = "pin-hint-hand"; handHint.innerHTML = HAND_SVG; handHint.style.color = "#fff"; execPin.appendChild(handHint); // Dismiss hand permanently on first click of the pin (handle or label) const dismiss = () => { article.classList.add("hint-dismissed"); execPin.removeEventListener("click", dismiss); }; execPin.addEventListener("click", dismiss); } } NodeRegistry.UCLASS_Register(CustomEventNode);