Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/inkgd/ink_player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func continue_story() -> String:

var text: String = ""
if self.can_continue:
_story.continue()
_story.continue_story()

text = self.current_text

Expand Down
4 changes: 2 additions & 2 deletions addons/inkgd/runtime/ink_path.gd
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func get_tail():

return InkPath().new_with_components(tail_comps)
else:
return InkPath().self()
return InkPath().new_self()

var length setget , get_length # int
func get_length():
Expand Down Expand Up @@ -141,7 +141,7 @@ func _init_with_components_string(components_string):
self.components_string = components_string

# () -> InkPath
static func self():
static func new_self():
var path = InkPath().new()
path.is_relative = true
return path
Expand Down
10 changes: 5 additions & 5 deletions addons/inkgd/runtime/story.gd
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func switch_to_default_flow() -> void:
self.state.switch_to_default_flow_internal()


func continue() -> String:
func continue_story() -> String:
self.continue_async(0)
return self.current_text

Expand Down Expand Up @@ -514,7 +514,7 @@ func continue_maximally() -> String:
var _str = ""

while (self.can_continue):
_str += self.continue()
_str += self.continue_story()

return _str

Expand Down Expand Up @@ -1199,7 +1199,7 @@ func async_we_cant(activity_str):
if self._async_continue_active:
Utils.throw_exception(
"Can't %s. Story is in the middle of a ContinueAsync(). " % activity_str +
"Make more ContinueAsync() calls or a single Continue() call beforehand."
"Make more ContinueAsync() calls or a single continue_story() call beforehand."
)

return _async_continue_active
Expand Down Expand Up @@ -1268,7 +1268,7 @@ func evaluate_function(

var string_output = ""
while self.can_continue:
string_output += self.continue()
string_output += self.continue_story()

var text_output = string_output

Expand All @@ -1295,7 +1295,7 @@ func evaluate_expression(expr_container: InkContainer) -> InkObject:

var eval_stack_height = self.state.evaluation_stack.size()

self.continue()
self.continue_story()

_temporary_evaluation_container = null

Expand Down
6 changes: 3 additions & 3 deletions test/integration/runtime/test_bindings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ func test_external_binding():
story.bind_external_function("multiply", self, "_external_binding_multiply")
story.bind_external_function("times", self, "_external_binding_times")

assert_eq(story.continue(), "15\n")
assert_eq(story.continue_story(), "15\n")

assert_eq(story.continue(), "knock knock knock\n")
assert_eq(story.continue_story(), "knock knock knock\n")

assert_eq(_test_external_binding_message, "MESSAGE: hello world")

Expand Down Expand Up @@ -65,7 +65,7 @@ func test_variable_observer():
assert_eq(story.current_choices.size(), 1)

story.choose_choice_index(0)
story.continue()
story.continue_story()

assert_eq(self._test_variable_observer_current_var_value, 25)
assert_eq(self._test_variable_observer_observer_call_count, 2)
Expand Down
20 changes: 10 additions & 10 deletions test/integration/runtime/test_booleans.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,43 @@ extends "res://test/integration/runtime/test_base.gd"

func test_false_plus_false():
var story = Story.new(load_file("false_plus_false"))
assert_eq(story.continue(), "0\n")
assert_eq(story.continue_story(), "0\n")

func test_list_hasnt():
var story = Story.new(load_file("list_hasnt"))
assert_eq(story.continue(), "true\n")
assert_eq(story.continue_story(), "true\n")

func test_not_one():
var story = Story.new(load_file("not_one"))
assert_eq(story.continue(), "false\n")
assert_eq(story.continue_story(), "false\n")

func test_not_true():
var story = Story.new(load_file("not_true"))
assert_eq(story.continue(), "false\n")
assert_eq(story.continue_story(), "false\n")

func test_three_greater_than_one():
var story = Story.new(load_file("three_greater_than_one"))
assert_eq(story.continue(), "true\n")
assert_eq(story.continue_story(), "true\n")

func test_true_equals_one():
var story = Story.new(load_file("true_equals_one"))
assert_eq(story.continue(), "true\n")
assert_eq(story.continue_story(), "true\n")

func test_true_plus_one():
var story = Story.new(load_file("true_plus_one"))
assert_eq(story.continue(), "2\n")
assert_eq(story.continue_story(), "2\n")

func test_true_plus_true():
var story = Story.new(load_file("true_plus_true"))
assert_eq(story.continue(), "2\n")
assert_eq(story.continue_story(), "2\n")

func test_true():
var story = Story.new(load_file("true"))
assert_eq(story.continue(), "true\n")
assert_eq(story.continue_story(), "true\n")

func test_two_plus_true():
var story = Story.new(load_file("two_plus_true"))
assert_eq(story.continue(), "3\n")
assert_eq(story.continue_story(), "3\n")

# ############################################################################ #

Expand Down
8 changes: 4 additions & 4 deletions test/integration/runtime/test_builtins.gd
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ func test_turns():

var i = 0
while i < 10:
assert_eq(story.continue(), str(i, "\n"))
assert_eq(story.continue_story(), str(i, "\n"))
story.choose_choice_index(0)

i += 1

func test_visit_count_bug_due_to_nested_containers():
var story = Story.new(load_file("visit_count_bug_due_to_nested_containers"))

assert_eq(story.continue(), "1\n")
assert_eq(story.continue_story(), "1\n")

story.choose_choice_index(0)
assert_eq(story.continue_maximally(), "choice\n1\n")
Expand All @@ -98,7 +98,7 @@ func test_visit_counts_when_choosing():
assert_eq(story.state.visit_count_at_path_string("TestKnot"), 1)
assert_eq(story.state.visit_count_at_path_string("TestKnot2"), 0)

story.continue()
story.continue_story()

assert_eq(story.state.visit_count_at_path_string("TestKnot"), 1)
assert_eq(story.state.visit_count_at_path_string("TestKnot2"), 0)
Expand All @@ -108,7 +108,7 @@ func test_visit_counts_when_choosing():
assert_eq(story.state.visit_count_at_path_string("TestKnot"), 1)
assert_eq(story.state.visit_count_at_path_string("TestKnot2"), 0)

story.continue()
story.continue_story()

assert_eq(story.state.visit_count_at_path_string("TestKnot"), 1)
assert_eq(story.state.visit_count_at_path_string("TestKnot2"), 1)
Expand Down
4 changes: 2 additions & 2 deletions test/integration/runtime/test_callstack.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ extends "res://test/integration/runtime/test_base.gd"

func test_callstack_evaluation():
var story = Story.new(load_file("callstack_evaluation"))
assert_eq(story.continue(), "8\n")
assert_eq(story.continue_story(), "8\n")

func test_clean_callstack_reset_on_path_choice():
var story = Story.new(load_file("clean_callstack_reset_on_path_choice"))

assert_eq("The first line.\n", story.continue())
assert_eq("The first line.\n", story.continue_story())

story.choose_path_string("SomewhereElse")

Expand Down
32 changes: 16 additions & 16 deletions test/integration/runtime/test_choices.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,32 @@ extends "res://test/integration/runtime/test_base.gd"

func test_choice_count():
var story = Story.new(load_file("choice_count"))
assert_eq(story.continue(), "2\n")
assert_eq(story.continue_story(), "2\n")

func test_choice_diverts_to_done():
var story = Story.new(load_file("choice_diverts_to_done"))
story.continue()
story.continue_story()

assert_eq(story.current_choices.size(), 1)
story.choose_choice_index(0)

assert_eq(story.continue(), "choice")
assert_eq(story.continue_story(), "choice")
assert_false(story.has_error) # Removed in ink 1.0.0 but kept here for now.

func test_choice_with_brackets_only():
var story = Story.new(load_file("choice_with_brackets_only"))
story.continue()
story.continue_story()

assert_eq(story.current_choices.size(), 1)
assert_eq(story.current_choices[0].text, "Option")
story.choose_choice_index(0)

assert_eq(story.continue(), "Text\n")
assert_eq(story.continue_story(), "Text\n")

func test_choice_thread_forking():
var story = Story.new(load_file("choice_thread_forking"))

story.continue()
story.continue_story()
var saved_state = story.state.to_json()

story = Story.new(load_file("choice_thread_forking"))
Expand All @@ -61,11 +61,11 @@ func test_conditional_choices():
func test_default_choice():
var story = Story.new(load_file("default_choices"))

assert_eq(story.continue(), "")
assert_eq(story.continue_story(), "")
assert_eq(story.current_choices.size(), 2)

story.choose_choice_index(0)
assert_eq(story.continue(), "After choice\n")
assert_eq(story.continue_story(), "After choice\n")

assert_eq(story.current_choices.size(), 1)

Expand All @@ -74,21 +74,21 @@ func test_default_choice():

func test_default_simple_gather():
var story = Story.new(load_file("default_simple_gather"))
assert_eq(story.continue(), "x\n")
assert_eq(story.continue_story(), "x\n")

func test_fallback_choice_on_thread():
var story = Story.new(load_file("fallback_choice_on_thread"))

assert_eq(story.continue(), "Should be 1 not 0: 1.\n")
assert_eq(story.continue_story(), "Should be 1 not 0: 1.\n")

func test_gather_choice_same_line():
var story = Story.new(load_file("gather_choice_same_line"))

story.continue()
story.continue_story()
assert_eq(story.current_choices[0].text, "hello")

story.choose_choice_index(0)
story.continue()
story.continue_story()

assert_eq(story.current_choices[0].text, "world")

Expand All @@ -111,10 +111,10 @@ func test_logic_in_choices():
func test_non_text_in_choice_inner_content():
var story = Story.new(load_file("non_text_in_choice_inner_content"))

story.continue()
story.continue_story()
story.choose_choice_index(0)

assert_eq(story.continue(), "option text. Conditional bit. Next.\n")
assert_eq(story.continue_story(), "option text. Conditional bit. Next.\n")

func test_once_only_choices_can_link_back_to_self():
var story = Story.new(load_file("once_only_choices_can_link_back_to_self"))
Expand Down Expand Up @@ -168,8 +168,8 @@ func test_should_not_gather_due_to_choice():
func test_state_rollback_over_default_choice():
var story = Story.new(load_file("state_rollback_over_default_choice"))

assert_eq(story.continue(), "Text.\n");
assert_eq(story.continue(), "5\n");
assert_eq(story.continue_story(), "Text.\n");
assert_eq(story.continue_story(), "5\n");

func test_sticky_choices_stay_sticky():
var story = Story.new(load_file("sticky_choices_stay_sticky"))
Expand Down
6 changes: 3 additions & 3 deletions test/integration/runtime/test_conditions.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extends "res://test/integration/runtime/test_base.gd"

func test_all_switch_branches_fail_is_clean():
var story = Story.new(load_file("all_switch_branches_fail_is_clean"))
story.continue()
story.continue_story()

assert_eq(story.state.evaluation_stack.size(), 0)

Expand All @@ -26,11 +26,11 @@ func test_else_branches():

func test_empty_multiline_conditional_branch():
var story = Story.new(load_file("empty_multiline_conditional_branch"))
assert_eq(story.continue(), "")
assert_eq(story.continue_story(), "")

func test_trivial_condition():
var story = Story.new(load_file("trivial_condition"))
story.continue()
story.continue_story()

assert_false(story.has_error) # Removed in ink 1.0.0 but kept here for now.

Expand Down
8 changes: 4 additions & 4 deletions test/integration/runtime/test_diverts.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extends "res://test/integration/runtime/test_base.gd"
func test_basic_tunnel():
var story = Story.new(load_file("basic_tunnel"))

assert_eq(story.continue(), "Hello world\n")
assert_eq(story.continue_story(), "Hello world\n")

func test_compare_divert_targets():
var story = Story.new(load_file("compare_divert_targets"))
Expand Down Expand Up @@ -48,18 +48,18 @@ func test_done_stops_thread():
func test_path_to_self():
var story = Story.new(load_file("path_to_self"))

story.continue()
story.continue_story()
story.choose_choice_index(0)

story.continue()
story.continue_story()
story.choose_choice_index(0)

assert_true(story.can_continue)

func test_same_line_divert_is_inline():
var story = Story.new(load_file("same_line_divert_is_inline"))

assert_eq(story.continue(), "We hurried home to Savile Row as fast as we could.\n")
assert_eq(story.continue_story(), "We hurried home to Savile Row as fast as we could.\n")

func test_tunnel_onwards_after_tunnel():
var story = Story.new(load_file("tunnel_onwards_after_tunnel"))
Expand Down
Loading