Working on dialog editor, on dialogs, on phone
This commit is contained in:
1 parent
0e27521bea
commit
8f7797789d
63 files changed
+9502
-1459
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { memo } from 'react';
|
||||
import { Handle, Position, NodeProps } from '@xyflow/react';
|
||||
import { CutsceneStartNode as CutsceneStartNodeData } from '../../types/dialogue';
|
||||
import { useValidation } from '../../hooks/useValidation';
|
||||
import styles from './nodes.module.css';
|
||||
|
||||
export const CutsceneStartNode = memo(({ data, selected }: NodeProps & { data: CutsceneStartNodeData }) => {
|
||||
const { hasError, hasWarning } = useValidation();
|
||||
const error = hasError(data.id);
|
||||
const warning = !error && hasWarning(data.id);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={[
|
||||
styles.node,
|
||||
styles.cutsceneNode,
|
||||
selected ? styles.selected : '',
|
||||
error ? styles.hasError : '',
|
||||
warning ? styles.hasWarning : '',
|
||||
].join(' ')}
|
||||
>
|
||||
<Handle type="target" position={Position.Top} id="target" className={styles.handle} />
|
||||
<div className={styles.nodeHeader}>
|
||||
<span className={styles.speakerName}>Cutscene</span>
|
||||
<span className={styles.nodeType}>Scene</span>
|
||||
</div>
|
||||
<div className={styles.nodeId}>{data.id}</div>
|
||||
<div className={styles.nodeBody}>
|
||||
<span className={styles.textSnippet}>{data.cutsceneId || '(no cutscene ID)'}</span>
|
||||
</div>
|
||||
<Handle type="source" position={Position.Bottom} id="source" className={styles.handle} />
|
||||
</div>
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user