Skip to content

Commit

Permalink
fix references to coroutines in comments
Browse files Browse the repository at this point in the history
add pausing typewriter[[[[[ sample
update godot version in continuous_build_check.yaml
  • Loading branch information
dogboydog committed Nov 23, 2023
1 parent 3493322 commit b17b071
Showing 63 changed files with 1,444 additions and 2,471 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous_build_check.yaml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ on:
- '**/*.md'
- 'docs/**'
env:
GODOT_CLI: ./Godot_v4.1.1-stable_mono_linux_x86_64/Godot_v4.1.1-stable_mono_linux.x86_64
GODOT_CLI: ./Godot_v4.1.3-stable_mono_linux_x86_64/Godot_v4.1.3-stable_mono_linux.x86_64
defaults:
run:
shell: bash
@@ -34,7 +34,7 @@ jobs:
- name: Download Godot
id: downloadGodot
run: |
wget -O godot.zip https://downloads.tuxfamily.org/godotengine/4.1.1/mono/Godot_v4.1.1-stable_mono_linux_x86_64.zip
wget -O godot.zip https://downloads.tuxfamily.org/godotengine/4.1.3/mono/Godot_v4.1.3-stable_mono_linux_x86_64.zip
unzip godot.zip
- name: Build solution
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -75,4 +75,5 @@ Temporary Items

.mono
.godot
.import
.import
build
26 changes: 26 additions & 0 deletions Samples/MarkupPalette/Palette-dialogue.yarn
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
title: Start
---
Alice: this is a [calm]quick[/calm] demonstration of using the [hype]new[/hype] MarkupPalette feature
Bob: [calm]oh[/calm], cool, [hype]colours[/hype]!
Alice: yes indeed, [turbohype]colours[/turbohype].

Bob: so [calm]how does[/calm] one use this [turbohype]fabulous[/turbohype] [hype]new[/hype] feature?
Alice: well [calm]first[/calm] you make a [hype]new[/hype] MarkupPalette resource
Bob: uh huh
Alice: and then [turbohype]configure[/turbohype] the colours how you like
Bob: right [calm]ok[/calm] and then
Alice: and then [hype]just[/hype] give it to your dialogue views
Alice: then you add the [calm]\[markup\][/calm] to your lines
Alice: and th[hype]en yo[/hype]u are done!
Bob: [calm]wowsers[/calm]
Alice: [turbohype]wowsers[/turbohype] indeed

Bob: does it [hype]work[/hype] with options though?

-> of [turbohype]course[/turbohype] it does
-> [calm]yes[/calm] it does
-> [hype]indeed[/hype]

Alice: [hype]neat, right?[/hype]
Bob: [turbohype]VERY[/turbohype] neat
===
14 changes: 14 additions & 0 deletions Samples/MarkupPalette/Palette-dialogue.yarn.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[remap]

importer="yarnscript"
type="Script"
uid="uid://dwascvkaa7nmf"
path="res://.godot/imported/Palette-dialogue.yarn-caa39b62f3fe47a6c11e168523b4ecdb.tres"

[deps]

source_file="res://Samples/MarkupPalette/Palette-dialogue.yarn"
dest_files=["res://.godot/imported/Palette-dialogue.yarn-caa39b62f3fe47a6c11e168523b4ecdb.tres"]

[params]

10 changes: 10 additions & 0 deletions Samples/MarkupPalette/Palette.yarnproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"projectFileVersion": 2,
"sourceFiles": [
"**/*.yarn"
],
"excludeFiles": [],
"localisation": {},
"baseLanguage": "en",
"compilerOptions": {}
}
14 changes: 14 additions & 0 deletions Samples/MarkupPalette/Palette.yarnproject.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[remap]

importer="yarnproject"
type="Resource"
uid="uid://7y2xm4f22ep5"
path="res://.godot/imported/Palette.yarnproject-2c1612daef56a2c0f2be9d1a92c0c8b9.tres"

[deps]

source_file="res://Samples/MarkupPalette/Palette.yarnproject"
dest_files=["res://.godot/imported/Palette.yarnproject-2c1612daef56a2c0f2be9d1a92c0c8b9.tres"]

[params]

25 changes: 25 additions & 0 deletions Samples/MarkupPalette/PaletteProj.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[gd_resource type="Resource" load_steps=4 format=3 uid="uid://65vclh8qnnlk"]

[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/Localization.cs" id="1_iw3n7"]
[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/YarnProject.cs" id="2_a6fyd"]

[sub_resource type="Resource" id="Resource_ffsut"]
resource_name = "Default (en)"
script = ExtResource("1_iw3n7")
LocaleCode = "en"
_stringTableJSON = "{\"line:d66cf000\":{\"Language\":\"en\",\"ID\":\"line:d66cf000\",\"Text\":\"Alice: this is a [calm]quick[/calm] demonstration of using the [hype]new[/hype] MarkupPalette feature\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"3\",\"Lock\":\"ebccb08d\",\"Comment\":\"\"},\"line:405cf777\":{\"Language\":\"en\",\"ID\":\"line:405cf777\",\"Text\":\"Bob: [calm]oh[/calm], cool, [hype]colours[/hype]!\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"4\",\"Lock\":\"901a9fc4\",\"Comment\":\"\"},\"line:fa0dfeee\":{\"Language\":\"en\",\"ID\":\"line:fa0dfeee\",\"Text\":\"Alice: yes indeed, [turbohype]colours[/turbohype].\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"5\",\"Lock\":\"986d6802\",\"Comment\":\"\"},\"line:6c3df999\":{\"Language\":\"en\",\"ID\":\"line:6c3df999\",\"Text\":\"Bob: so [calm]how does[/calm] one use this [turbohype]fabulous[/turbohype] [hype]new[/hype] feature?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"7\",\"Lock\":\"54c57a18\",\"Comment\":\"\"},\"line:cfa89d07\":{\"Language\":\"en\",\"ID\":\"line:cfa89d07\",\"Text\":\"Alice: well [calm]first[/calm] you make a [hype]new[/hype] MarkupPalette resource\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"8\",\"Lock\":\"45eb644f\",\"Comment\":\"\"},\"line:59989a70\":{\"Language\":\"en\",\"ID\":\"line:59989a70\",\"Text\":\"Bob: uh huh\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"9\",\"Lock\":\"c7b6e548\",\"Comment\":\"\"},\"line:e3c993e9\":{\"Language\":\"en\",\"ID\":\"line:e3c993e9\",\"Text\":\"Alice: and then [turbohype]configure[/turbohype] the colours how you like\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"10\",\"Lock\":\"161908de\",\"Comment\":\"\"},\"line:75f9949e\":{\"Language\":\"en\",\"ID\":\"line:75f9949e\",\"Text\":\"Bob: right [calm]ok[/calm] and then\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"11\",\"Lock\":\"591acc85\",\"Comment\":\"\"},\"line:e4e42b0e\":{\"Language\":\"en\",\"ID\":\"line:e4e42b0e\",\"Text\":\"Alice: and then [hype]just[/hype] give it to your dialogue views\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"12\",\"Lock\":\"1542c188\",\"Comment\":\"\"},\"line:72d42c79\":{\"Language\":\"en\",\"ID\":\"line:72d42c79\",\"Text\":\"Alice: then you add the [calm]\\\\[markup\\\\][/calm] to your lines\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"13\",\"Lock\":\"052720a8\",\"Comment\":\"\"},\"line:ed697082\":{\"Language\":\"en\",\"ID\":\"line:ed697082\",\"Text\":\"Alice: and th[hype]en yo[/hype]u are done!\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"14\",\"Lock\":\"860bad35\",\"Comment\":\"\"},\"line:7b5977f5\":{\"Language\":\"en\",\"ID\":\"line:7b5977f5\",\"Text\":\"Bob: [calm]wowsers[/calm]\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"15\",\"Lock\":\"a86e9d9e\",\"Comment\":\"\"},\"line:c1087e6c\":{\"Language\":\"en\",\"ID\":\"line:c1087e6c\",\"Text\":\"Alice: [turbohype]wowsers[/turbohype] indeed\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"16\",\"Lock\":\"c475456e\",\"Comment\":\"\"},\"line:5738791b\":{\"Language\":\"en\",\"ID\":\"line:5738791b\",\"Text\":\"Bob: does it [hype]work[/hype] with options though?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"18\",\"Lock\":\"3f46bef7\",\"Comment\":\"Line metadata: lastline\"},\"line:f4ad1d85\":{\"Language\":\"en\",\"ID\":\"line:f4ad1d85\",\"Text\":\"of [turbohype]course[/turbohype] it does\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"20\",\"Lock\":\"0c49155a\",\"Comment\":\"\"},\"line:629d1af2\":{\"Language\":\"en\",\"ID\":\"line:629d1af2\",\"Text\":\"[calm]yes[/calm] it does\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"21\",\"Lock\":\"96bd927d\",\"Comment\":\"\"},\"line:d8cc136b\":{\"Language\":\"en\",\"ID\":\"line:d8cc136b\",\"Text\":\"[hype]indeed[/hype]\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"22\",\"Lock\":\"c14a5012\",\"Comment\":\"\"},\"line:4efc141c\":{\"Language\":\"en\",\"ID\":\"line:4efc141c\",\"Text\":\"Alice: [hype]neat, right?[/hype]\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"24\",\"Lock\":\"8936fec3\",\"Comment\":\"\"},\"line:dfe1ab8c\":{\"Language\":\"en\",\"ID\":\"line:dfe1ab8c\",\"Text\":\"Bob: [turbohype]VERY[/turbohype] neat\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"25\",\"Lock\":\"30ed5f72\",\"Comment\":\"\"}}"
stringsFile = ""

[resource]
resource_name = "PaletteProj"
script = ExtResource("2_a6fyd")
LastImportHadImplicitStringIDs = false
LastImportHadAnyStrings = false
IsSuccessfullyParsed = false
CompiledYarnProgramBase64 = "EskGCgVTdGFydBK/BgoFU3RhcnQSGggCEg8KDWxpbmU6ZDY2Y2YwMDASBR0AAAAAEhoIAhIPCg1saW5lOjQwNWNmNzc3EgUdAAAAABIaCAISDwoNbGluZTpmYTBkZmVlZRIFHQAAAAASGggCEg8KDWxpbmU6NmMzZGY5OTkSBR0AAAAAEhoIAhIPCg1saW5lOmNmYTg5ZDA3EgUdAAAAABIaCAISDwoNbGluZTo1OTk4OWE3MBIFHQAAAAASGggCEg8KDWxpbmU6ZTNjOTkzZTkSBR0AAAAAEhoIAhIPCg1saW5lOjc1Zjk5NDllEgUdAAAAABIaCAISDwoNbGluZTplNGU0MmIwZRIFHQAAAAASGggCEg8KDWxpbmU6NzJkNDJjNzkSBR0AAAAAEhoIAhIPCg1saW5lOmVkNjk3MDgyEgUdAAAAABIaCAISDwoNbGluZTo3YjU5NzdmNRIFHQAAAAASGggCEg8KDWxpbmU6YzEwODdlNmMSBR0AAAAAEhoIAhIPCg1saW5lOjU3Mzg3OTFiEgUdAAAAABI6CAQSDwoNbGluZTpmNGFkMWQ4NRIaChhMMnNob3J0Y3V0b3B0aW9uX1N0YXJ0XzESBR0AAAAAEgIQABI6CAQSDwoNbGluZTo2MjlkMWFmMhIaChhMM3Nob3J0Y3V0b3B0aW9uX1N0YXJ0XzISBR0AAAAAEgIQABI6CAQSDwoNbGluZTpkOGNjMTM2YhIaChhMNHNob3J0Y3V0b3B0aW9uX1N0YXJ0XzMSBR0AAAAAEgIQABICCAUSAggBEg8SDQoLTDFncm91cF9lbmQSDxINCgtMMWdyb3VwX2VuZBIPEg0KC0wxZ3JvdXBfZW5kEgIICxIaCAISDwoNbGluZTo0ZWZjMTQxYxIFHQAAAAASGggCEg8KDWxpbmU6ZGZlMWFiOGMSBR0AAAAAEgIIDxoECgJMMBocChhMMnNob3J0Y3V0b3B0aW9uX1N0YXJ0XzEQExocChhMM3Nob3J0Y3V0b3B0aW9uX1N0YXJ0XzIQFBocChhMNHNob3J0Y3V0b3B0aW9uX1N0YXJ0XzMQFRoPCgtMMWdyb3VwX2VuZBAWMg4KBXRpdGxlEgVTdGFydA=="
baseLocalization = SubResource("Resource_ffsut")
JSONProjectPath = "res://Samples/MarkupPalette/Palette.yarnproject"
_lineMetadataJSON = "{\"lineMetadata\":{\"line:5738791b\":{\"ID\":\"line:5738791b\",\"File\":\"res://Samples/MarkupPalette/Palette-dialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"18\",\"Metadata\":[\"lastline\"]}},\"stringsFile\":null}"
_listOfFunctionsJSON = "[]"
_serializedDeclarationsJSON = "[]"
ProjectErrors = []
41 changes: 41 additions & 0 deletions Samples/MarkupPalette/PaletteSample.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[gd_scene load_steps=5 format=3 uid="uid://uxc1jm6ayoar"]

[ext_resource type="PackedScene" uid="uid://bv42g323prh5f" path="res://addons/YarnSpinner-Godot/Scenes/DefaultDialogueSystem.tscn" id="1_luv5t"]
[ext_resource type="Resource" uid="uid://65vclh8qnnlk" path="res://Samples/MarkupPalette/PaletteProj.tres" id="2_yfv6n"]
[ext_resource type="Resource" uid="uid://c631us202ijmk" path="res://Samples/MarkupPalette/example_markup_palette.tres" id="3_1wwmk"]
[ext_resource type="Script" path="res://Samples/ReturnOnComplete.cs" id="4_q6j15"]

[node name="PaletteSample" type="Node2D"]

[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = 0

[node name="BackgroundColor" type="ColorRect" parent="CanvasLayer"]
z_index = -7
z_as_relative = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0.0509804, 0.0235294, 0.0509804, 1)

[node name="YarnSpinnerCanvasLayer" parent="." instance=ExtResource("1_luv5t")]

[node name="DialogueRunner" parent="YarnSpinnerCanvasLayer" index="0"]
yarnProject = ExtResource("2_yfv6n")
startNode = "Start"
startAutomatically = true

[node name="LineView" parent="YarnSpinnerCanvasLayer" index="2"]
palette = ExtResource("3_1wwmk")

[node name="OptionsListView" parent="YarnSpinnerCanvasLayer" index="3"]
palette = ExtResource("3_1wwmk")

[node name="ReturnOnComplete" type="Node2D" parent="." node_paths=PackedStringArray("dialogueRunner")]
script = ExtResource("4_q6j15")
dialogueRunner = NodePath("../YarnSpinnerCanvasLayer/DialogueRunner")

[editable path="YarnSpinnerCanvasLayer"]
11 changes: 11 additions & 0 deletions Samples/MarkupPalette/example_markup_palette.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="MarkupPalette" load_steps=2 format=3 uid="uid://c631us202ijmk"]

[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/Views/MarkupPalette.cs" id="1_6b5jh"]

[resource]
script = ExtResource("1_6b5jh")
ColourMarkers = {
"calm": Color(0.136169, 0.566038, 0.184834, 1),
"hype": Color(0.754717, 0.162608, 0.0747597, 1),
"turbohype": Color(0.735849, 0.0173549, 0.722466, 1)
}
22 changes: 22 additions & 0 deletions Samples/MarkupPalette/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Markup Palettes

This sample demonstrates how to use the built in Markup Palettes to theme text.
Markup Palettes provide a means of lightly theming your lines without requiring any code.
The code for Markup Palettes inside of Line view present a good starting point for more advanced customisation for your game.

This sample highlights:

- Using markup palettes to colour text
- Using markup in dialogue

To get started play the scene and the dialogue will start itself.
Click on the continue button to advance the lines.

## SamplePalette

This is the palette for the sample, it maps a markup attribute to a colour.
This palette has three markups, calm, hype, turbohype and each of these has a colour associated with them.

## Palette-dialogue.yarn

This is the yarn file for the sample and uses the three different markup attributes defined in the palette file.
8 changes: 8 additions & 0 deletions Samples/PausingTypewriter/PauseDialogue.yarn
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: Start
---
This is a line without a pause
This is a line [pause /]with a propertyless pause
This is a line [pause = 1100 /]with a one point one second pause
This is a line [pause = 500 /]with two pauses[pause = 500 /] each half a second
This is a line [pause = 500 /]with two pauses[pause = 2000 /] the second is two seconds long
===
14 changes: 14 additions & 0 deletions Samples/PausingTypewriter/PauseDialogue.yarn.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[remap]

importer="yarnscript"
type="Script"
uid="uid://dgw4ojltf2hn6"
path="res://.godot/imported/PauseDialogue.yarn-926959666337d027238a2c8dd345367d.tres"

[deps]

source_file="res://Samples/PausingTypewriter/PauseDialogue.yarn"
dest_files=["res://.godot/imported/PauseDialogue.yarn-926959666337d027238a2c8dd345367d.tres"]

[params]

25 changes: 25 additions & 0 deletions Samples/PausingTypewriter/PauseProj.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[gd_resource type="Resource" load_steps=4 format=3 uid="uid://d2ucrvm44r0vh"]

[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/Localization.cs" id="1_eciie"]
[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/YarnProject.cs" id="2_7sdmw"]

[sub_resource type="Resource" id="Resource_0bn7r"]
resource_name = "Default (en)"
script = ExtResource("1_eciie")
LocaleCode = "en"
_stringTableJSON = "{\"line:1aca462f\":{\"Language\":\"en\",\"ID\":\"line:1aca462f\",\"Text\":\"This is a line without a pause\",\"Original\":null,\"File\":\"res://Samples/PausingTypewriter/PauseDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"3\",\"Lock\":\"a2aee325\",\"Comment\":\"\"},\"line:8cfa4158\":{\"Language\":\"en\",\"ID\":\"line:8cfa4158\",\"Text\":\"This is a line [pause /]with a propertyless pause\",\"Original\":null,\"File\":\"res://Samples/PausingTypewriter/PauseDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"4\",\"Lock\":\"913cad40\",\"Comment\":\"\"},\"line:36ab48c1\":{\"Language\":\"en\",\"ID\":\"line:36ab48c1\",\"Text\":\"This is a line [pause = 1100 /]with a one point one second pause\",\"Original\":null,\"File\":\"res://Samples/PausingTypewriter/PauseDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"5\",\"Lock\":\"2e1f74ec\",\"Comment\":\"\"},\"line:a09b4fb6\":{\"Language\":\"en\",\"ID\":\"line:a09b4fb6\",\"Text\":\"This is a line [pause = 500 /]with two pauses[pause = 500 /] each half a second\",\"Original\":null,\"File\":\"res://Samples/PausingTypewriter/PauseDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"6\",\"Lock\":\"a27d9ec1\",\"Comment\":\"\"},\"line:030e2b28\":{\"Language\":\"en\",\"ID\":\"line:030e2b28\",\"Text\":\"This is a line [pause = 500 /]with two pauses[pause = 2000 /] the second is two seconds long\",\"Original\":null,\"File\":\"res://Samples/PausingTypewriter/PauseDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"7\",\"Lock\":\"b5b84613\",\"Comment\":\"\"}}"
stringsFile = ""

[resource]
resource_name = "PauseProj"
script = ExtResource("2_7sdmw")
LastImportHadImplicitStringIDs = false
LastImportHadAnyStrings = false
IsSuccessfullyParsed = false
CompiledYarnProgramBase64 = "ErcBCgVTdGFydBKtAQoFU3RhcnQSGggCEg8KDWxpbmU6MWFjYTQ2MmYSBR0AAAAAEhoIAhIPCg1saW5lOjhjZmE0MTU4EgUdAAAAABIaCAISDwoNbGluZTozNmFiNDhjMRIFHQAAAAASGggCEg8KDWxpbmU6YTA5YjRmYjYSBR0AAAAAEhoIAhIPCg1saW5lOjAzMGUyYjI4EgUdAAAAABICCA8aBAoCTDAyDgoFdGl0bGUSBVN0YXJ0"
baseLocalization = SubResource("Resource_0bn7r")
JSONProjectPath = "res://Samples/PausingTypewriter/PauseProj.yarnproject"
_lineMetadataJSON = "{\"lineMetadata\":{},\"stringsFile\":null}"
_listOfFunctionsJSON = "[]"
_serializedDeclarationsJSON = "[]"
ProjectErrors = []
10 changes: 10 additions & 0 deletions Samples/PausingTypewriter/PauseProj.yarnproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"projectFileVersion": 2,
"sourceFiles": [
"**/*.yarn"
],
"excludeFiles": [],
"localisation": {},
"baseLanguage": "en",
"compilerOptions": {}
}
14 changes: 14 additions & 0 deletions Samples/PausingTypewriter/PauseProj.yarnproject.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[remap]

importer="yarnproject"
type="Resource"
uid="uid://cgk3obf527mhm"
path="res://.godot/imported/PauseProj.yarnproject-744c25107925e6d1f7a2789f0626afa3.tres"

[deps]

source_file="res://Samples/PausingTypewriter/PauseProj.yarnproject"
dest_files=["res://.godot/imported/PauseProj.yarnproject-744c25107925e6d1f7a2789f0626afa3.tres"]

[params]

26 changes: 26 additions & 0 deletions Samples/PausingTypewriter/PauseResponder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Godot;
using YarnSpinnerGodot;

public partial class PauseResponder : Control
{
[Export] public TextureRect face;
[Export] public Texture2D thinkingFace;
[Export] public Texture2D talkingFace;
[Export] public LineView lineView;

public override void _Ready()
{
lineView.onPauseStarted += OnPauseStarted;
lineView.onPauseEnded += OnPauseEnded;
}

public void OnPauseStarted()
{
face.Texture = thinkingFace;
}

public void OnPauseEnded()
{
face.Texture = talkingFace;
}
}
Loading

0 comments on commit b17b071

Please sign in to comment.