From 8c4e0c2ed26000b1c9809cd6985b7165a2d7d6a9 Mon Sep 17 00:00:00 2001 From: jtuu Date: Fri, 15 Nov 2019 11:31:00 +0200 Subject: [PATCH] Hooked up the stepping buttons to their respective methods in QuestRunner. --- src/quest_editor/gui/QuestEditorToolBar.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/quest_editor/gui/QuestEditorToolBar.ts b/src/quest_editor/gui/QuestEditorToolBar.ts index c17f1da9..63824163 100644 --- a/src/quest_editor/gui/QuestEditorToolBar.ts +++ b/src/quest_editor/gui/QuestEditorToolBar.ts @@ -107,6 +107,8 @@ export class QuestEditorToolBar extends ToolBar { const quest_loaded = quest_editor_store.current_quest.map(q => q != undefined); + const step_controls_enabled = quest_editor_store.quest_runner.paused.map(paused => paused && quest_editor_store.quest_runner.running.val && quest_loaded.val); + this.disposables( new_quest_button.chosen.observe(({ value: episode }) => quest_editor_store.new_quest(episode), @@ -135,6 +137,24 @@ export class QuestEditorToolBar extends ToolBar { run_button.click.observe(quest_editor_store.run_current_quest), + resume_button.click.observe(() => quest_editor_store.quest_runner?.resume()), + + step_over_button.click.observe(() => quest_editor_store.quest_runner?.step_over()), + + step_in_button.click.observe(() => quest_editor_store.quest_runner?.step_in()), + + step_out_button.click.observe(() => quest_editor_store.quest_runner?.step_out()), + + run_button.enabled.bind_to(quest_loaded), + + resume_button.enabled.bind_to(step_controls_enabled), + + step_over_button.enabled.bind_to(step_controls_enabled), + + step_in_button.enabled.bind_to(step_controls_enabled), + + step_out_button.enabled.bind_to(step_controls_enabled), + gui_store.on_global_keydown(GuiTool.QuestEditor, "Ctrl-O", () => open_file_button.click(), ),