Skip to content

Commit

Permalink
fix: stop replaying save prompts when reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
liana-p committed Aug 4, 2024
1 parent 4314a2c commit a7ba385
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/narrat/src/examples/default/scripts/default.narrat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dev_test:
run test_saves
run test_conditions
run test_js
run test_arrays
Expand Down Expand Up @@ -50,7 +51,7 @@ test_multiline:
talk player idle $text

main:
// jump dev_test
jump dev_test
set_screen video
add_item book 1
jump quest_demo
Expand Down
2 changes: 2 additions & 0 deletions packages/narrat/src/examples/default/scripts/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import macros from './test_macros.narrat';
import scenes from './test_scenes.narrat';
import js from './test_js.narrat';
import conditions from './conditions.narrat';
import saves from './test_saves.narrat';

export default [
game,
Expand All @@ -26,4 +27,5 @@ export default [
scenes,
js,
conditions,
saves,
];
13 changes: 13 additions & 0 deletions packages/narrat/src/examples/default/scripts/test_saves.narrat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
test_saves:
"Let's try a save prompt"
set data.save_test 1
jump test_save_prompt

test_save_prompt:
save_prompt
"Hello world"
jump test_saves_3

test_saves_3:
"now we're done a jump"
jump main
2 changes: 1 addition & 1 deletion packages/narrat/src/stores/vm-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export const useVM = defineStore('vm', {
this.$reset();
this.stack = [];
this.data = {};
this.hasJumped = true;
this.hasJumped = false;
this.setStack({
currentIndex: 0,
branchData: {
Expand Down

0 comments on commit a7ba385

Please sign in to comment.