fix(planty): make sure config is completely static
This commit is contained in:
@@ -125,12 +125,7 @@ export const tutorialConfig: PlantyConfig = {
|
|||||||
choices: [
|
choices: [
|
||||||
{
|
{
|
||||||
label: '🔍 Explore Node Sourcecode',
|
label: '🔍 Explore Node Sourcecode',
|
||||||
onclick: () => {
|
action: 'open-github-nodes'
|
||||||
window.open(
|
|
||||||
'https://git.max-richter.dev/max/nodarium/src/branch/main/nodes/max/plantarium',
|
|
||||||
'__blank'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
next: 'tour_viewer_nerd'
|
next: 'tour_viewer_nerd'
|
||||||
|
|||||||
@@ -184,6 +184,12 @@
|
|||||||
pm.graph = g;
|
pm.graph = g;
|
||||||
pm.saveGraph(g);
|
pm.saveGraph(g);
|
||||||
graphInterface.state.centerNode(graphInterface.manager.getAllNodes()[0]);
|
graphInterface.state.centerNode(graphInterface.manager.getAllNodes()[0]);
|
||||||
|
},
|
||||||
|
'open-github-nodes': () => {
|
||||||
|
window.open(
|
||||||
|
'https://github.com/jim-fx/nodarium/tree/main/nodes/max/plantarium',
|
||||||
|
'__blank'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
hooks={{
|
hooks={{
|
||||||
|
|||||||
@@ -200,8 +200,12 @@
|
|||||||
onClose={stop}
|
onClose={stop}
|
||||||
onChoose={async (choice) => {
|
onChoose={async (choice) => {
|
||||||
await _runAfter(currentNodeId!, currentNode);
|
await _runAfter(currentNodeId!, currentNode);
|
||||||
if (choice && choice.onclick) {
|
if (choice && choice.action) {
|
||||||
choice.onclick();
|
if (choice.action in actions) {
|
||||||
|
actions[choice.action]();
|
||||||
|
} else {
|
||||||
|
console.warn(`Planty: No action found for ${choice.action}`);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!choice.next) {
|
if (!choice.next) {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export interface DialogNode {
|
|||||||
export interface Choice {
|
export interface Choice {
|
||||||
label: string;
|
label: string;
|
||||||
next?: string | null;
|
next?: string | null;
|
||||||
onclick?: () => void;
|
action?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PlantyConfig {
|
export interface PlantyConfig {
|
||||||
|
|||||||
Reference in New Issue
Block a user