-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
243 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
title: Start | ||
--- | ||
This is a test of the "hop" and "hopback" features. | ||
<<hop Choice>> | ||
You are back at the start node. | ||
=== | ||
|
||
title: Choice | ||
--- | ||
Please choose a node to hop to: | ||
-> A | ||
<<hop A>> | ||
-> B | ||
<<hop B>> | ||
-> Back | ||
<<hopback>> | ||
You are back at the choice node. | ||
=== | ||
|
||
title: A | ||
--- | ||
Node A. Please choose a node to hop to: | ||
-> A | ||
<<hop A>> | ||
-> B | ||
<<hop B>> | ||
-> Back | ||
<<hopback>> | ||
You are back at node A. | ||
=== | ||
|
||
title: B | ||
--- | ||
Node B. Please choose a node to hop to: | ||
-> A | ||
<<hop A>> | ||
-> B | ||
<<hop B>> | ||
-> Back | ||
<<hopback>> | ||
You are back at node B. | ||
=== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
if (!CHATTERBOX_END_OF_NODE_HOPBACK) | ||
{ | ||
__ChatterboxError("CHATTERBOX_END_OF_NODE_HOPBACK must be set to <true> for this test case"); | ||
} | ||
|
||
ChatterboxLoadFromFile("testcase_hop.yarn"); | ||
box = ChatterboxCreate(); | ||
ChatterboxJump(box, "Start"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
draw_set_font(fntDefault); | ||
|
||
//Iterate over all text and draw it | ||
var _x = 10; | ||
var _y = 10; | ||
|
||
if (ChatterboxIsStopped(box)) | ||
{ | ||
//If we're stopped then show that | ||
draw_text(_x, _y, "(Chatterbox stopped)"); | ||
} | ||
else | ||
{ | ||
//All the spoken text | ||
var _i = 0; | ||
repeat(ChatterboxGetContentCount(box)) | ||
{ | ||
var _string = ChatterboxGetContent(box, _i); | ||
draw_text(_x, _y, _string); | ||
_y += string_height(_string); | ||
++_i; | ||
} | ||
|
||
//Bit of spacing... | ||
_y += 30; | ||
|
||
if (ChatterboxIsWaiting(box)) | ||
{ | ||
//If we're in a "waiting" state then prompt the user for basic input | ||
draw_text(_x, _y, "(Press Space)"); | ||
} | ||
else | ||
{ | ||
//All the options | ||
var _i = 0; | ||
repeat(ChatterboxGetOptionCount(box)) | ||
{ | ||
var _string = ChatterboxGetOption(box, _i); | ||
|
||
if (ChatterboxGetOptionConditionBool(box, _i)) | ||
{ | ||
draw_text(_x, _y, string(_i+1) + ") " + _string); | ||
} | ||
else | ||
{ | ||
draw_set_colour(c_grey); | ||
draw_text(_x, _y, string(_i+1) + ") " + _string); | ||
draw_set_colour(c_white); | ||
} | ||
|
||
_y += string_height(_string); | ||
++_i; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
if (ChatterboxIsStopped(box)) | ||
{ | ||
//Do nothing! | ||
} | ||
else if (ChatterboxIsWaiting(box)) | ||
{ | ||
if (keyboard_check_released(vk_space)) | ||
{ | ||
ChatterboxContinue(box); | ||
} | ||
else if (keyboard_check_released(ord("F"))) | ||
{ | ||
ChatterboxFastForward(box); | ||
} | ||
} | ||
else | ||
{ | ||
var _index = undefined; | ||
if (keyboard_check_released(ord("1"))) _index = 0; | ||
if (keyboard_check_released(ord("2"))) _index = 1; | ||
if (keyboard_check_released(ord("3"))) _index = 2; | ||
if (keyboard_check_released(ord("4"))) _index = 3; | ||
if (_index != undefined) ChatterboxSelect(box, _index); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters