Replace Move 'per second' setting with a dt data input
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
06b1007015
commit
9060da615a
8 files changed
+210
-40
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { CanvasTextMetrics, Graphics, Rectangle, Text } from 'pixi.js';
|
||||
import { edgesInto, type Graph, type GraphNode, inlineInputs, type NodeCategory, type NodeDef, type PortDef, type PortType } from '../../core/graph';
|
||||
import { edgesInto, type Graph, type GraphNode, inlineInputs, inlineValue, type NodeCategory, type NodeDef, type PortDef, type PortType } from '../../core/graph';
|
||||
import type { BehaviorAsset } from '../../core/model/Asset';
|
||||
import { Theme, textStyle, Widget } from '../../ui';
|
||||
import { keyLabel } from '../inspector/fieldFactory';
|
||||
@@ -74,7 +74,7 @@ export class NodeView extends Widget {
|
||||
|
||||
/** Re-reads params and connections; rebuilds the text lines. */
|
||||
sync(node: GraphNode, graph: Graph, asset: BehaviorAsset | null): void {
|
||||
this.paramLines = this.def.params.map((p) => `${p.label}: ${formatParam(p.kind, node.params[p.key], asset)}`);
|
||||
this.paramLines = this.def.params.map((p) => `${p.label}: ${formatParam(p.kind, node.params[p.key] ?? p.default, asset)}`);
|
||||
this.connected = new Set(inlineInputs(this.def).filter((p) => edgesInto(graph, node.id, p.key).length > 0).map((p) => p.key));
|
||||
const rows = this.rowCount();
|
||||
const height = TITLE_HEIGHT + PAD + this.paramLines.length * ROW_HEIGHT + rows * ROW_HEIGHT + PAD;
|
||||
@@ -134,8 +134,8 @@ export class NodeView extends Widget {
|
||||
if (input) {
|
||||
let label = input.label;
|
||||
if (input.type !== 'exec' && input.type !== 'object' && !this.connected.has(input.key)) {
|
||||
const value = this.node.params[input.key];
|
||||
if (value !== undefined && value !== '') label += ` ${formatValue(value)}`;
|
||||
const value = inlineValue(this.node, input);
|
||||
if (value !== null && value !== '') label += ` ${formatValue(value)}`;
|
||||
}
|
||||
add(label || '', input.type === 'exec' ? 'body' : 'muted', PAD + PORT_RADIUS + 4, rowTop, 'left', NODE_WIDTH / 2 + 20);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user