From 6e15e03ea45abc81f0569efd0388bbb9fda0ca38 Mon Sep 17 00:00:00 2001 From: dogboydog Date: Fri, 24 Nov 2023 01:02:50 -0500 Subject: [PATCH] change import process for .yarnproject files to not need a separate .tres file in the project. the .yarnproject will appear as the C# YarnProject resource in the inspector. --- Samples/MarkupPalette/Palette-dialogue.yarn | 1 + .../Palette-dialogue.yarn.import | 2 +- .../MarkupPalette/Palette.yarnproject.import | 2 +- Samples/MarkupPalette/PaletteProj.tres | 25 --- Samples/MarkupPalette/PaletteSample.tscn | 2 +- .../PauseDialogue.yarn.import | 2 +- Samples/PausingTypewriter/PauseProj.tres | 25 --- .../PauseProj.yarnproject.import | 2 +- Samples/PausingTypewriter/PauseSample.tscn | 5 +- .../RoundedViews/Rounded.yarnproject.import | 2 +- .../RoundedViews/RoundedDialogue.yarn.import | 2 +- Samples/RoundedViews/RoundedProj.tres | 25 --- Samples/RoundedViews/RoundedSample.tscn | 8 +- Samples/Space/Dialogue/Intro.yarn.import | 2 +- Samples/Space/Dialogue/Sally.yarn.import | 2 +- Samples/Space/Dialogue/Ship.yarn.import | 2 +- Samples/Space/Dialogue/SpaceYarnProject.tres | 25 --- .../SpaceYarnProject.yarnproject.import | 2 +- Samples/Space/Dialogue/Variables.yarn.import | 2 +- Samples/Space/SpaceSample.tscn | 2 +- .../Dialogue/VNExampleDialogue.yarn | 2 +- .../Dialogue/VNExampleDialogue.yarn.import | 2 +- .../VisualNovel/Dialogue/VN_YarnProject.tres | 34 ---- .../VN_YarnProject.yarnproject.import | 14 -- ...ct.yarnproject => VisualNovel.yarnproject} | 36 ++-- .../Dialogue/VisualNovel.yarnproject.import | 14 ++ .../Localization/VisualNovel_es.translation | Bin 1585 -> 1585 bytes .../Localization/VisualNovel_ja.csv | 6 +- .../Localization/VisualNovel_ja.translation | Bin 1911 -> 1905 bytes Samples/VisualNovel/VisualNovelSample.tscn | 2 +- .../Editor/YarnEditorUtility.cs | 15 +- .../YarnSpinner-Godot/Editor/YarnImporter.cs | 34 ++-- .../Editor/YarnProjectEditorUtility.cs | 161 ++++-------------- .../Editor/YarnProjectImporter.cs | 43 +++-- .../Editor/YarnProjectInspectorPlugin.cs | 1 - .../Runtime/Views/LineView.cs | 2 +- .../YarnSpinner-Godot/Runtime/YarnProject.cs | 20 ++- addons/YarnSpinner-Godot/YarnSpinnerPlugin.cs | 11 +- 38 files changed, 167 insertions(+), 370 deletions(-) delete mode 100644 Samples/MarkupPalette/PaletteProj.tres delete mode 100644 Samples/PausingTypewriter/PauseProj.tres delete mode 100644 Samples/RoundedViews/RoundedProj.tres delete mode 100644 Samples/Space/Dialogue/SpaceYarnProject.tres delete mode 100644 Samples/VisualNovel/Dialogue/VN_YarnProject.tres delete mode 100644 Samples/VisualNovel/Dialogue/VN_YarnProject.yarnproject.import rename Samples/VisualNovel/Dialogue/{VN_YarnProject.yarnproject => VisualNovel.yarnproject} (95%) create mode 100644 Samples/VisualNovel/Dialogue/VisualNovel.yarnproject.import diff --git a/Samples/MarkupPalette/Palette-dialogue.yarn b/Samples/MarkupPalette/Palette-dialogue.yarn index 4edc1f3..dba0f6d 100644 --- a/Samples/MarkupPalette/Palette-dialogue.yarn +++ b/Samples/MarkupPalette/Palette-dialogue.yarn @@ -4,6 +4,7 @@ Alice: this is a [calm]quick[/calm] demonstration of using the [hype]new[/hype] 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 diff --git a/Samples/MarkupPalette/Palette-dialogue.yarn.import b/Samples/MarkupPalette/Palette-dialogue.yarn.import index 259a7d4..2d24d4f 100644 --- a/Samples/MarkupPalette/Palette-dialogue.yarn.import +++ b/Samples/MarkupPalette/Palette-dialogue.yarn.import @@ -1,7 +1,7 @@ [remap] importer="yarnscript" -type="Script" +type="Resource" uid="uid://dwascvkaa7nmf" path="res://.godot/imported/Palette-dialogue.yarn-caa39b62f3fe47a6c11e168523b4ecdb.tres" diff --git a/Samples/MarkupPalette/Palette.yarnproject.import b/Samples/MarkupPalette/Palette.yarnproject.import index f46ba26..6eadaa4 100644 --- a/Samples/MarkupPalette/Palette.yarnproject.import +++ b/Samples/MarkupPalette/Palette.yarnproject.import @@ -2,7 +2,7 @@ importer="yarnproject" type="Resource" -uid="uid://7y2xm4f22ep5" +uid="uid://374uxyocig3s" path="res://.godot/imported/Palette.yarnproject-2c1612daef56a2c0f2be9d1a92c0c8b9.tres" [deps] diff --git a/Samples/MarkupPalette/PaletteProj.tres b/Samples/MarkupPalette/PaletteProj.tres deleted file mode 100644 index e705b9f..0000000 --- a/Samples/MarkupPalette/PaletteProj.tres +++ /dev/null @@ -1,25 +0,0 @@ -[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 = [] diff --git a/Samples/MarkupPalette/PaletteSample.tscn b/Samples/MarkupPalette/PaletteSample.tscn index dfd0020..3fcb207 100644 --- a/Samples/MarkupPalette/PaletteSample.tscn +++ b/Samples/MarkupPalette/PaletteSample.tscn @@ -1,7 +1,7 @@ [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://7y2xm4f22ep5" path="res://Samples/MarkupPalette/Palette.yarnproject" 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"] diff --git a/Samples/PausingTypewriter/PauseDialogue.yarn.import b/Samples/PausingTypewriter/PauseDialogue.yarn.import index 89763d8..bc25f22 100644 --- a/Samples/PausingTypewriter/PauseDialogue.yarn.import +++ b/Samples/PausingTypewriter/PauseDialogue.yarn.import @@ -1,7 +1,7 @@ [remap] importer="yarnscript" -type="Script" +type="Resource" uid="uid://dgw4ojltf2hn6" path="res://.godot/imported/PauseDialogue.yarn-926959666337d027238a2c8dd345367d.tres" diff --git a/Samples/PausingTypewriter/PauseProj.tres b/Samples/PausingTypewriter/PauseProj.tres deleted file mode 100644 index 542ed9b..0000000 --- a/Samples/PausingTypewriter/PauseProj.tres +++ /dev/null @@ -1,25 +0,0 @@ -[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 = [] diff --git a/Samples/PausingTypewriter/PauseProj.yarnproject.import b/Samples/PausingTypewriter/PauseProj.yarnproject.import index 3fef4e1..7dd2fbf 100644 --- a/Samples/PausingTypewriter/PauseProj.yarnproject.import +++ b/Samples/PausingTypewriter/PauseProj.yarnproject.import @@ -2,7 +2,7 @@ importer="yarnproject" type="Resource" -uid="uid://cgk3obf527mhm" +uid="uid://btil08na83k0p" path="res://.godot/imported/PauseProj.yarnproject-744c25107925e6d1f7a2789f0626afa3.tres" [deps] diff --git a/Samples/PausingTypewriter/PauseSample.tscn b/Samples/PausingTypewriter/PauseSample.tscn index a238f69..8887e07 100644 --- a/Samples/PausingTypewriter/PauseSample.tscn +++ b/Samples/PausingTypewriter/PauseSample.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=7 format=3 uid="uid://ckp616grs7xrs"] [ext_resource type="PackedScene" uid="uid://bv42g323prh5f" path="res://addons/YarnSpinner-Godot/Scenes/DefaultDialogueSystem.tscn" id="1_m0dlq"] -[ext_resource type="Resource" uid="uid://d2ucrvm44r0vh" path="res://Samples/PausingTypewriter/PauseProj.tres" id="2_j3415"] +[ext_resource type="Resource" uid="uid://cgk3obf527mhm" path="res://Samples/PausingTypewriter/PauseProj.yarnproject" id="2_j3415"] [ext_resource type="Texture2D" uid="uid://crtrls05kcbu5" path="res://Samples/PausingTypewriter/sprites/talking.png" id="2_njmvd"] [ext_resource type="Script" path="res://Samples/PausingTypewriter/PauseResponder.cs" id="3_uqanb"] [ext_resource type="Texture2D" uid="uid://dk84dy4vqquds" path="res://Samples/PausingTypewriter/sprites/thinking.png" id="4_1i87u"] @@ -39,7 +39,7 @@ offset_bottom = 1542.0 scale = Vector2(0.3, 0.3) texture = ExtResource("2_njmvd") -[node name="PauseResponder" type="Control" parent="." node_paths=PackedStringArray("face", "lineView", "dialogueRunner")] +[node name="PauseResponder" type="Control" parent="." node_paths=PackedStringArray("face", "lineView")] anchors_preset = 0 offset_right = 40.0 offset_bottom = 40.0 @@ -48,7 +48,6 @@ face = NodePath("../Face") thinkingFace = ExtResource("4_1i87u") talkingFace = ExtResource("2_njmvd") lineView = NodePath("../YarnSpinnerCanvasLayer/LineView") -dialogueRunner = NodePath("../YarnSpinnerCanvasLayer/DialogueRunner") [node name="ReturnOnComplete" type="Node2D" parent="." node_paths=PackedStringArray("dialogueRunner")] script = ExtResource("6_otpsy") diff --git a/Samples/RoundedViews/Rounded.yarnproject.import b/Samples/RoundedViews/Rounded.yarnproject.import index 79ad01d..fd693a5 100644 --- a/Samples/RoundedViews/Rounded.yarnproject.import +++ b/Samples/RoundedViews/Rounded.yarnproject.import @@ -2,7 +2,7 @@ importer="yarnproject" type="Resource" -uid="uid://byyyntobab06n" +uid="uid://crbfo1tue0g06" path="res://.godot/imported/Rounded.yarnproject-f4f7cd79583437b6fbb15d97bcf58422.tres" [deps] diff --git a/Samples/RoundedViews/RoundedDialogue.yarn.import b/Samples/RoundedViews/RoundedDialogue.yarn.import index 86123c3..d6f99ee 100644 --- a/Samples/RoundedViews/RoundedDialogue.yarn.import +++ b/Samples/RoundedViews/RoundedDialogue.yarn.import @@ -1,7 +1,7 @@ [remap] importer="yarnscript" -type="Script" +type="Resource" uid="uid://7ukn607q8q87" path="res://.godot/imported/RoundedDialogue.yarn-782e62627649fc50f7a31dbc32e16966.tres" diff --git a/Samples/RoundedViews/RoundedProj.tres b/Samples/RoundedViews/RoundedProj.tres deleted file mode 100644 index 914ecf3..0000000 --- a/Samples/RoundedViews/RoundedProj.tres +++ /dev/null @@ -1,25 +0,0 @@ -[gd_resource type="Resource" load_steps=4 format=3 uid="uid://m1rob6arkjty"] - -[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/Localization.cs" id="1_piqit"] -[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/YarnProject.cs" id="2_85n4s"] - -[sub_resource type="Resource" id="Resource_487j8"] -resource_name = "Default (en)" -script = ExtResource("1_piqit") -LocaleCode = "en" -_stringTableJSON = "{\"line:3056c3fa\":{\"Language\":\"en\",\"ID\":\"line:3056c3fa\",\"Text\":\"Alice: This is a quick sample showing off the alternative prefabs.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"3\",\"Lock\":\"62fb2d5f\",\"Comment\":\"\"},\"line:a666c48d\":{\"Language\":\"en\",\"ID\":\"line:a666c48d\",\"Text\":\"Bob: Alternative prefabs?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"4\",\"Lock\":\"51c7bcb1\",\"Comment\":\"\"},\"line:1c37cd14\":{\"Language\":\"en\",\"ID\":\"line:1c37cd14\",\"Text\":\"Alice: Yes, notice how everything is more rounded?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"5\",\"Lock\":\"6b13bba9\",\"Comment\":\"\"},\"line:8a07ca63\":{\"Language\":\"en\",\"ID\":\"line:8a07ca63\",\"Text\":\"Bob: ah so how is this done?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"6\",\"Lock\":\"924d5e4a\",\"Comment\":\"\"},\"line:2992aefd\":{\"Language\":\"en\",\"ID\":\"line:2992aefd\",\"Text\":\"Alice: we use a 9-sliced image for the various pieces.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"7\",\"Lock\":\"afbf2e02\",\"Comment\":\"\"},\"line:bfa2a98a\":{\"Language\":\"en\",\"ID\":\"line:bfa2a98a\",\"Text\":\"Bob: is there any code changes?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"8\",\"Lock\":\"d0612cf8\",\"Comment\":\"\"},\"line:05f3a013\":{\"Language\":\"en\",\"ID\":\"line:05f3a013\",\"Text\":\"Alice: nope\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"9\",\"Lock\":\"142a6ecd\",\"Comment\":\"\"},\"line:93c3a764\":{\"Language\":\"en\",\"ID\":\"line:93c3a764\",\"Text\":\"Alice: any other questions?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"10\",\"Lock\":\"10f82338\",\"Comment\":\"Line metadata: lastline\"},\"line:02de18f4\":{\"Language\":\"en\",\"ID\":\"line:02de18f4\",\"Text\":\"Does it work with Options?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"12\",\"Lock\":\"d90d8bcc\",\"Comment\":\"\"},\"line:94ee1f83\":{\"Language\":\"en\",\"ID\":\"line:94ee1f83\",\"Text\":\"How about options?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"13\",\"Lock\":\"027aec9e\",\"Comment\":\"\"},\"line:9a1de3cb\":{\"Language\":\"en\",\"ID\":\"line:9a1de3cb\",\"Text\":\"I hope it works with options\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"14\",\"Lock\":\"2c28e565\",\"Comment\":\"\"},\"line:0c2de4bc\":{\"Language\":\"en\",\"ID\":\"line:0c2de4bc\",\"Text\":\"Alice: oh it works with options\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"16\",\"Lock\":\"e025dc10\",\"Comment\":\"\"},\"line:b67ced25\":{\"Language\":\"en\",\"ID\":\"line:b67ced25\",\"Text\":\"Alice: anyways, toodles\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"17\",\"Lock\":\"873cb9b9\",\"Comment\":\"\"},\"line:204cea52\":{\"Language\":\"en\",\"ID\":\"line:204cea52\",\"Text\":\"Bob: bye\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"18\",\"Lock\":\"a72fc904\",\"Comment\":\"\"}}" -stringsFile = "" - -[resource] -resource_name = "Rounded" -script = ExtResource("2_85n4s") -LastImportHadImplicitStringIDs = false -LastImportHadAnyStrings = false -IsSuccessfullyParsed = false -CompiledYarnProgramBase64 = "Er0FCgVTdGFydBKzBQoFU3RhcnQSGggCEg8KDWxpbmU6MzA1NmMzZmESBR0AAAAAEhoIAhIPCg1saW5lOmE2NjZjNDhkEgUdAAAAABIaCAISDwoNbGluZToxYzM3Y2QxNBIFHQAAAAASGggCEg8KDWxpbmU6OGEwN2NhNjMSBR0AAAAAEhoIAhIPCg1saW5lOjI5OTJhZWZkEgUdAAAAABIaCAISDwoNbGluZTpiZmEyYTk4YRIFHQAAAAASGggCEg8KDWxpbmU6MDVmM2EwMTMSBR0AAAAAEhoIAhIPCg1saW5lOjkzYzNhNzY0EgUdAAAAABI6CAQSDwoNbGluZTowMmRlMThmNBIaChhMMnNob3J0Y3V0b3B0aW9uX1N0YXJ0XzESBR0AAAAAEgIQABI6CAQSDwoNbGluZTo5NGVlMWY4MxIaChhMM3Nob3J0Y3V0b3B0aW9uX1N0YXJ0XzISBR0AAAAAEgIQABI6CAQSDwoNbGluZTo5YTFkZTNjYhIaChhMNHNob3J0Y3V0b3B0aW9uX1N0YXJ0XzMSBR0AAAAAEgIQABICCAUSAggBEg8SDQoLTDFncm91cF9lbmQSDxINCgtMMWdyb3VwX2VuZBIPEg0KC0wxZ3JvdXBfZW5kEgIICxIaCAISDwoNbGluZTowYzJkZTRiYxIFHQAAAAASGggCEg8KDWxpbmU6YjY3Y2VkMjUSBR0AAAAAEhoIAhIPCg1saW5lOjIwNGNlYTUyEgUdAAAAABICCA8aBAoCTDAaHAoYTDJzaG9ydGN1dG9wdGlvbl9TdGFydF8xEA0aHAoYTDNzaG9ydGN1dG9wdGlvbl9TdGFydF8yEA4aHAoYTDRzaG9ydGN1dG9wdGlvbl9TdGFydF8zEA8aDwoLTDFncm91cF9lbmQQEDIOCgV0aXRsZRIFU3RhcnQ=" -baseLocalization = SubResource("Resource_487j8") -JSONProjectPath = "res://Samples/RoundedViews/Rounded.yarnproject" -_lineMetadataJSON = "{\"lineMetadata\":{\"line:93c3a764\":{\"ID\":\"line:93c3a764\",\"File\":\"res://Samples/RoundedViews/RoundedDialogue.yarn\",\"Node\":\"Start\",\"LineNumber\":\"10\",\"Metadata\":[\"lastline\"]}},\"stringsFile\":null}" -_listOfFunctionsJSON = "[]" -_serializedDeclarationsJSON = "[]" -ProjectErrors = [] diff --git a/Samples/RoundedViews/RoundedSample.tscn b/Samples/RoundedViews/RoundedSample.tscn index 4b9c048..cd54bd0 100644 --- a/Samples/RoundedViews/RoundedSample.tscn +++ b/Samples/RoundedViews/RoundedSample.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://d1q6uujk0isnq"] [ext_resource type="PackedScene" uid="uid://dqe5yshlcmnpg" path="res://addons/YarnSpinner-Godot/Scenes/RoundedDialogueSystem.tscn" id="1_e1fcx"] -[ext_resource type="Resource" uid="uid://m1rob6arkjty" path="res://Samples/RoundedViews/RoundedProj.tres" id="2_s6ssf"] +[ext_resource type="Resource" uid="uid://l42klvikwhmy" path="res://Samples/RoundedViews/Rounded.yarnproject" id="2_s6ssf"] [node name="RoundedSample" type="Node2D"] @@ -12,10 +12,4 @@ yarnProject = ExtResource("2_s6ssf") startNode = "Start" startAutomatically = true -[node name="CharacterNameText" parent="RoundedYarnSpinnerCanvasLayer/LineView/ViewControl/CharacterNameBubble" index="0"] -offset_left = -175.5 -offset_top = -32.0 -offset_right = 267.5 -offset_bottom = 128.0 - [editable path="RoundedYarnSpinnerCanvasLayer"] diff --git a/Samples/Space/Dialogue/Intro.yarn.import b/Samples/Space/Dialogue/Intro.yarn.import index e5054dc..f15e458 100644 --- a/Samples/Space/Dialogue/Intro.yarn.import +++ b/Samples/Space/Dialogue/Intro.yarn.import @@ -1,7 +1,7 @@ [remap] importer="yarnscript" -type="Script" +type="Resource" uid="uid://qw1xc85r3bfn" path="res://.godot/imported/Intro.yarn-9c2f905d4f6175cbcd272ef866d2285f.tres" diff --git a/Samples/Space/Dialogue/Sally.yarn.import b/Samples/Space/Dialogue/Sally.yarn.import index e4de9e3..362a777 100644 --- a/Samples/Space/Dialogue/Sally.yarn.import +++ b/Samples/Space/Dialogue/Sally.yarn.import @@ -1,7 +1,7 @@ [remap] importer="yarnscript" -type="Script" +type="Resource" uid="uid://baypc2v305035" path="res://.godot/imported/Sally.yarn-461d08e5b02f98c92224badc7e45d4ba.tres" diff --git a/Samples/Space/Dialogue/Ship.yarn.import b/Samples/Space/Dialogue/Ship.yarn.import index 5c1b675..f026e2e 100644 --- a/Samples/Space/Dialogue/Ship.yarn.import +++ b/Samples/Space/Dialogue/Ship.yarn.import @@ -1,7 +1,7 @@ [remap] importer="yarnscript" -type="Script" +type="Resource" uid="uid://8h4k0uhcbonu" path="res://.godot/imported/Ship.yarn-ad47f038d197a9000e088f841751e3da.tres" diff --git a/Samples/Space/Dialogue/SpaceYarnProject.tres b/Samples/Space/Dialogue/SpaceYarnProject.tres deleted file mode 100644 index ea63f78..0000000 --- a/Samples/Space/Dialogue/SpaceYarnProject.tres +++ /dev/null @@ -1,25 +0,0 @@ -[gd_resource type="Resource" load_steps=4 format=3 uid="uid://baf1cu6kwapdh"] - -[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/YarnProject.cs" id="1"] -[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/Localization.cs" id="2"] - -[sub_resource type="Resource" id="Resource_atrn2"] -resource_name = "Default (en)" -script = ExtResource("2") -LocaleCode = "en" -_stringTableJSON = "{\"line:03f451b\":{\"Language\":\"en\",\"ID\":\"line:03f451b\",\"Text\":\"Welcome to the {0} Sample! Try talking to Sally and the Ship.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Intro.yarn\",\"Node\":\"SpaceIntro\",\"LineNumber\":\"6\",\"Lock\":\"43e3ae38\",\"Comment\":\"\"},\"line:794945\":{\"Language\":\"en\",\"ID\":\"line:794945\",\"Text\":\"Player: Hey, Sally.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally\",\"LineNumber\":\"7\",\"Lock\":\"2bc75173\",\"Comment\":\"\"},\"line:2dc39b\":{\"Language\":\"en\",\"ID\":\"line:2dc39b\",\"Text\":\"Sally: \\u003Cwave freq=20 amp=14\\u003EUah!\\u003C/wave\\u003E\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally\",\"LineNumber\":\"10\",\"Lock\":\"cb48fbdb\",\"Comment\":\"\"},\"line:34de2f\":{\"Language\":\"en\",\"ID\":\"line:34de2f\",\"Text\":\"Sally: \\u003Cshake rate=20.0 level=5 connected=1\\u003EYou snuck up on me!\\u003C/shake\\u003E\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally\",\"LineNumber\":\"11\",\"Lock\":\"ea5f1db2\",\"Comment\":\"\"},\"line:dcc2bc\":{\"Language\":\"en\",\"ID\":\"line:dcc2bc\",\"Text\":\"Sally: Don\\u0027t do that.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally\",\"LineNumber\":\"12\",\"Lock\":\"ac04c57a\",\"Comment\":\"\"},\"line:a8e70c\":{\"Language\":\"en\",\"ID\":\"line:a8e70c\",\"Text\":\"Player: Hey.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally\",\"LineNumber\":\"14\",\"Lock\":\"52e9bd6e\",\"Comment\":\"\"},\"line:0af7f86\":{\"Language\":\"en\",\"ID\":\"line:0af7f86\",\"Text\":\"Sally: Hi.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally\",\"LineNumber\":\"15\",\"Lock\":\"41aa2f03\",\"Comment\":\"\"},\"line:5d7a7c\":{\"Language\":\"en\",\"ID\":\"line:5d7a7c\",\"Text\":\"Anything exciting happen on your watch?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally\",\"LineNumber\":\"18\",\"Lock\":\"5a28d06b\",\"Comment\":\"\"},\"line:0a7e39\":{\"Language\":\"en\",\"ID\":\"line:0a7e39\",\"Text\":\"Sorry about the console.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally\",\"LineNumber\":\"20\",\"Lock\":\"6c4c5826\",\"Comment\":\"\"},\"line:0facf7\":{\"Language\":\"en\",\"ID\":\"line:0facf7\",\"Text\":\"See you later.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally\",\"LineNumber\":\"22\",\"Lock\":\"e241648d\",\"Comment\":\"\"},\"line:8c3f98\":{\"Language\":\"en\",\"ID\":\"line:8c3f98\",\"Text\":\"Sally: Not really.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally_Watch\",\"LineNumber\":\"31\",\"Lock\":\"c6bcc3d6\",\"Comment\":\"\"},\"line:24c418\":{\"Language\":\"en\",\"ID\":\"line:24c418\",\"Text\":\"Sally: Same old nebula, doing the same old thing.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally_Watch\",\"LineNumber\":\"32\",\"Lock\":\"d3a88d93\",\"Comment\":\"\"},\"line:df4eaf\":{\"Language\":\"en\",\"ID\":\"line:df4eaf\",\"Text\":\"Sally: Oh, Ship wanted to see you. Go say hi to it.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally_Watch\",\"LineNumber\":\"33\",\"Lock\":\"5f2cc23a\",\"Comment\":\"\"},\"line:1fea6c\":{\"Language\":\"en\",\"ID\":\"line:1fea6c\",\"Text\":\"Player: Already done!\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally_Watch\",\"LineNumber\":\"36\",\"Lock\":\"599299b9\",\"Comment\":\"\"},\"line:5df323\":{\"Language\":\"en\",\"ID\":\"line:5df323\",\"Text\":\"Sally: Go say hi again.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally_Watch\",\"LineNumber\":\"37\",\"Lock\":\"fed05ceb\",\"Comment\":\"\"},\"line:60c282\":{\"Language\":\"en\",\"ID\":\"line:60c282\",\"Text\":\"Sally: Bye.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally_Exit\",\"LineNumber\":\"46\",\"Lock\":\"29ecd7c6\",\"Comment\":\"\"},\"line:d7df49\":{\"Language\":\"en\",\"ID\":\"line:d7df49\",\"Text\":\"Sally: Yeah. Don\\u0027t do it again.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Sally.yarn\",\"Node\":\"Sally_Sorry\",\"LineNumber\":\"54\",\"Lock\":\"0ce38920\",\"Comment\":\"\"},\"line:5837f2\":{\"Language\":\"en\",\"ID\":\"line:5837f2\",\"Text\":\"Ship: Hey, friend.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"7\",\"Lock\":\"b709c42e\",\"Comment\":\"Line metadata: firstline\"},\"line:ship09\":{\"Language\":\"en\",\"ID\":\"line:ship09\",\"Text\":\"Player: Hi, Ship.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"8\",\"Lock\":\"0f857079\",\"Comment\":\"\"},\"line:ship10\":{\"Language\":\"en\",\"ID\":\"line:ship10\",\"Text\":\"Player: How\\u0027s space?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"9\",\"Lock\":\"a741d6b2\",\"Comment\":\"\"},\"line:ship11\":{\"Language\":\"en\",\"ID\":\"line:ship11\",\"Text\":\"Ship: Oh, man.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"10\",\"Lock\":\"778a5a83\",\"Comment\":\"\"},\"line:ship12\":{\"Language\":\"en\",\"ID\":\"line:ship12\",\"Text\":\"Ship: It\\u0027s HUGE!\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"12\",\"Lock\":\"88f3fb99\",\"Comment\":\"\"},\"line:ship13\":{\"Language\":\"en\",\"ID\":\"line:ship13\",\"Text\":\"Ship: Hey!!\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"16\",\"Lock\":\"5a889e0a\",\"Comment\":\"\"},\"line:ship01\":{\"Language\":\"en\",\"ID\":\"line:ship01\",\"Text\":\"Player: Sally said you wanted to see me?\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"21\",\"Lock\":\"be6b00c6\",\"Comment\":\"\"},\"line:ship03\":{\"Language\":\"en\",\"ID\":\"line:ship03\",\"Text\":\"Ship: She totally did!!\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"23\",\"Lock\":\"171196c4\",\"Comment\":\"\"},\"line:ship04\":{\"Language\":\"en\",\"ID\":\"line:ship04\",\"Text\":\"Ship: She wanted me to tell you...\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"25\",\"Lock\":\"e1980146\",\"Comment\":\"\"},\"line:ship05\":{\"Language\":\"en\",\"ID\":\"line:ship05\",\"Text\":\"Ship: If you ever go off-watch without resetting the console again...\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"26\",\"Lock\":\"b6808e22\",\"Comment\":\"\"},\"line:ship06\":{\"Language\":\"en\",\"ID\":\"line:ship06\",\"Text\":\"Ship: She\\u0027ll flay you alive!\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"28\",\"Lock\":\"c1c63254\",\"Comment\":\"\"},\"line:ship07\":{\"Language\":\"en\",\"ID\":\"line:ship07\",\"Text\":\"Player: Uh.\",\"Original\":null,\"File\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"31\",\"Lock\":\"727bb97b\",\"Comment\":\"\"}}" -stringsFile = "" - -[resource] -resource_name = "SpaceYarnProject" -script = ExtResource("1") -LastImportHadImplicitStringIDs = false -LastImportHadAnyStrings = false -IsSuccessfullyParsed = false -CompiledYarnProgramBase64 = "Em8KClNwYWNlSW50cm8SYQoKU3BhY2VJbnRybxIRCA0SDQoLJHNhbXBsZU5hbWUSGQgCEg4KDGxpbmU6MDNmNDUxYhIFHQAAgD8SAggPGgQKAkwwMhMKBXRpdGxlEgpTcGFjZUludHJvMgYKBHRhZ3MSxwsKBVNhbGx5Er0LCgVTYWxseRILCAYSBwoFU2FsbHkSCQgHEgUdAACAPxINCAwSCQoHdmlzaXRlZBIGCAgSAhAAEgkIBxIFHQAAAEASEggMEg4KDEJvb2wuRXF1YWxUbxISCAoSDgoMTDJza2lwY2xhdXNlEhgIAhINCgtsaW5lOjc5NDk0NRIFHQAAAAASGAgCEg0KC2xpbmU6MmRjMzliEgUdAAAAABIYCAISDQoLbGluZTozNGRlMmYSBR0AAAAAEhgIAhINCgtsaW5lOmRjYzJiYxIFHQAAAAASCxIJCgdMMWVuZGlmEgIICxIYCAISDQoLbGluZTphOGU3MGMSBR0AAAAAEhkIAhIOCgxsaW5lOjBhZjdmODYSBR0AAAAAEgsSCQoHTDFlbmRpZhIRCAYSDQoLU2FsbHlfV2F0Y2gSCQgHEgUdAACAPxINCAwSCQoHdmlzaXRlZBIJCAcSBR0AAIA/Eg4IDBIKCghCb29sLk5vdBI4CAQSDQoLbGluZTo1ZDdhN2MSGgoYTDVzaG9ydGN1dG9wdGlvbl9TYWxseV8xEgUdAAAAABICEAESFAgNEhAKDiRzYWxseV93YXJuaW5nEhEIBhINCgtTYWxseV9Tb3JyeRIJCAcSBR0AAIA/Eg0IDBIJCgd2aXNpdGVkEgkIBxIFHQAAgD8SDggMEgoKCEJvb2wuTm90EgkIBxIFHQAAAEASDggMEgoKCEJvb2wuQW5kEjgIBBINCgtsaW5lOjBhN2UzORIaChhMNnNob3J0Y3V0b3B0aW9uX1NhbGx5XzISBR0AAAAAEgIQARI4CAQSDQoLbGluZTowZmFjZjcSGgoYTDdzaG9ydGN1dG9wdGlvbl9TYWxseV8zEgUdAAAAABICEAASAggFEgIIARIjCA0SHwodJFlhcm4uSW50ZXJuYWwuVmlzaXRpbmcuU2FsbHkSCQgHEgUdAACAPxIJCAcSBR0AAABAEhAIDBIMCgpOdW1iZXIuQWRkEiMIDhIfCh0kWWFybi5JbnRlcm5hbC5WaXNpdGluZy5TYWxseRICCAsSEQgGEg0KC1NhbGx5X1dhdGNoEgIIEBIPEg0KC0w0Z3JvdXBfZW5kEiMIDRIfCh0kWWFybi5JbnRlcm5hbC5WaXNpdGluZy5TYWxseRIJCAcSBR0AAIA/EgkIBxIFHQAAAEASEAgMEgwKCk51bWJlci5BZGQSIwgOEh8KHSRZYXJuLkludGVybmFsLlZpc2l0aW5nLlNhbGx5EgIICxIRCAYSDQoLU2FsbHlfU29ycnkSAggQEg8SDQoLTDRncm91cF9lbmQSIwgNEh8KHSRZYXJuLkludGVybmFsLlZpc2l0aW5nLlNhbGx5EgkIBxIFHQAAgD8SCQgHEgUdAAAAQBIQCAwSDAoKTnVtYmVyLkFkZBIjCA4SHwodJFlhcm4uSW50ZXJuYWwuVmlzaXRpbmcuU2FsbHkSAggLEhAIBhIMCgpTYWxseV9FeGl0EgIIEBIPEg0KC0w0Z3JvdXBfZW5kEgIICxIjCA0SHwodJFlhcm4uSW50ZXJuYWwuVmlzaXRpbmcuU2FsbHkSCQgHEgUdAACAPxIJCAcSBR0AAABAEhAIDBIMCgpOdW1iZXIuQWRkEiMIDhIfCh0kWWFybi5JbnRlcm5hbC5WaXNpdGluZy5TYWxseRICCAsSAggPGgQKAkwwGhAKDEwyc2tpcGNsYXVzZRAMGgsKB0wxZW5kaWYQEBocChhMNXNob3J0Y3V0b3B0aW9uX1NhbGx5XzEQIhocChhMNnNob3J0Y3V0b3B0aW9uX1NhbGx5XzIQKxocChhMN3Nob3J0Y3V0b3B0aW9uX1NhbGx5XzMQNBoPCgtMNGdyb3VwX2VuZBA9Mg4KBXRpdGxlEgVTYWxseTIGCgR0YWdzMgwKB2NvbG9ySUQSATAyEwoIcG9zaXRpb24SBzUyNCwxMTESowQKC1NhbGx5X1dhdGNoEpMECgtTYWxseV9XYXRjaBIYCAISDQoLbGluZTo4YzNmOTgSBR0AAAAAEhgIAhINCgtsaW5lOjI0YzQxOBIFHQAAAAASGAgCEg0KC2xpbmU6ZGY0ZWFmEgUdAAAAABIGCAgSAhABEhYIDhISChAkc2hvdWxkX3NlZV9zaGlwEgIICxIKCAYSBgoEU2hpcBIJCAcSBR0AAIA/Eg0IDBIJCgd2aXNpdGVkEgYICBICEAESCQgHEgUdAAAAQBISCAwSDgoMQm9vbC5FcXVhbFRvEhMIChIPCg1MMTBza2lwY2xhdXNlEhgIAhINCgtsaW5lOjFmZWE2YxIFHQAAAAASGAgCEg0KC2xpbmU6NWRmMzIzEgUdAAAAABILEgkKB0w5ZW5kaWYSAggLEikIDRIlCiMkWWFybi5JbnRlcm5hbC5WaXNpdGluZy5TYWxseV9XYXRjaBIJCAcSBR0AAIA/EgkIBxIFHQAAAEASEAgMEgwKCk51bWJlci5BZGQSKQgOEiUKIyRZYXJuLkludGVybmFsLlZpc2l0aW5nLlNhbGx5X1dhdGNoEgIICxICCA8aBAoCTDgaEQoNTDEwc2tpcGNsYXVzZRAQGgsKB0w5ZW5kaWYQETIUCgV0aXRsZRILU2FsbHlfV2F0Y2gyBgoEdGFnczIMCgdjb2xvcklEEgEwMhMKCHBvc2l0aW9uEgc1MTIsNDMwEn8KClNhbGx5X0V4aXQScQoKU2FsbHlfRXhpdBIYCAISDQoLbGluZTo2MGMyODISBR0AAAAAEgIIDxoFCgNMMTEyEwoFdGl0bGUSClNhbGx5X0V4aXQyBgoEdGFnczIMCgdjb2xvcklEEgE2MhMKCHBvc2l0aW9uEgcyMTEsNDE3EoUCCgtTYWxseV9Tb3JyeRL1AQoLU2FsbHlfU29ycnkSGAgCEg0KC2xpbmU6ZDdkZjQ5EgUdAAAAABIpCA0SJQojJFlhcm4uSW50ZXJuYWwuVmlzaXRpbmcuU2FsbHlfU29ycnkSCQgHEgUdAACAPxIJCAcSBR0AAABAEhAIDBIMCgpOdW1iZXIuQWRkEikIDhIlCiMkWWFybi5JbnRlcm5hbC5WaXNpdGluZy5TYWxseV9Tb3JyeRICCAsSAggPGgUKA0wxMjIUCgV0aXRsZRILU2FsbHlfU29ycnkyBgoEdGFnczIMCgdjb2xvcklEEgEwMhMKCHBvc2l0aW9uEgc4MjcsNDM5Eu8JCgRTaGlwEuYJCgRTaGlwEgoIBhIGCgRTaGlwEgkIBxIFHQAAgD8SDQgMEgkKB3Zpc2l0ZWQSBggIEgIQABIJCAcSBR0AAABAEhIIDBIOCgxCb29sLkVxdWFsVG8SEggKEg4KDEwyc2tpcGNsYXVzZRIYCAISDQoLbGluZTo1ODM3ZjISBR0AAAAAEhgIAhINCgtsaW5lOnNoaXAwORIFHQAAAAASGAgCEg0KC2xpbmU6c2hpcDEwEgUdAAAAABIYCAISDQoLbGluZTpzaGlwMTESBR0AAAAAEiUIAxIaChhzZXRzcHJpdGUgU2hpcEZhY2UgaGFwcHkSBR0AAAAAEhgIAhINCgtsaW5lOnNoaXAxMhIFHQAAAAASJwgDEhwKGnNldHNwcml0ZSBTaGlwRmFjZSBuZXV0cmFsEgUdAAAAABILEgkKB0wxZW5kaWYSAggLEiUIAxIaChhzZXRzcHJpdGUgU2hpcEZhY2UgaGFwcHkSBR0AAAAAEhgIAhINCgtsaW5lOnNoaXAxMxIFHQAAAAASJwgDEhwKGnNldHNwcml0ZSBTaGlwRmFjZSBuZXV0cmFsEgUdAAAAABILEgkKB0wxZW5kaWYSFggNEhIKECRzaG91bGRfc2VlX3NoaXASBggIEgIQARIJCAcSBR0AAABAEhIIDBIOCgxCb29sLkVxdWFsVG8SFAgNEhAKDiRzYWxseV93YXJuaW5nEgYICBICEAASCQgHEgUdAAAAQBISCAwSDgoMQm9vbC5FcXVhbFRvEgkIBxIFHQAAAEASDggMEgoKCEJvb2wuQW5kEhIIChIOCgxMNXNraXBjbGF1c2USGAgCEg0KC2xpbmU6c2hpcDAxEgUdAAAAABIlCAMSGgoYc2V0c3ByaXRlIFNoaXBGYWNlIGhhcHB5EgUdAAAAABIYCAISDQoLbGluZTpzaGlwMDMSBR0AAAAAEicIAxIcChpzZXRzcHJpdGUgU2hpcEZhY2UgbmV1dHJhbBIFHQAAAAASGAgCEg0KC2xpbmU6c2hpcDA0EgUdAAAAABIYCAISDQoLbGluZTpzaGlwMDUSBR0AAAAAEiUIAxIaChhzZXRzcHJpdGUgU2hpcEZhY2UgaGFwcHkSBR0AAAAAEhgIAhINCgtsaW5lOnNoaXAwNhIFHQAAAAASBggIEgIQARIUCA4SEAoOJHNhbGx5X3dhcm5pbmcSAggLEhMIAxIICgZ3YWl0IDESBR0AAAAAEhgIAhINCgtsaW5lOnNoaXAwNxIFHQAAAAASJwgDEhwKGnNldHNwcml0ZSBTaGlwRmFjZSBuZXV0cmFsEgUdAAAAABILEgkKB0w0ZW5kaWYSAggLEiIIDRIeChwkWWFybi5JbnRlcm5hbC5WaXNpdGluZy5TaGlwEgkIBxIFHQAAgD8SCQgHEgUdAAAAQBIQCAwSDAoKTnVtYmVyLkFkZBIiCA4SHgocJFlhcm4uSW50ZXJuYWwuVmlzaXRpbmcuU2hpcBICCAsSAggPGgQKAkwwGhAKDEwyc2tpcGNsYXVzZRAPGgsKB0wxZW5kaWYQFBoQCgxMNXNraXBjbGF1c2UQLhoLCgdMNGVuZGlmEC8yDQoFdGl0bGUSBFNoaXAyBgoEdGFnczIMCgdjb2xvcklEEgEwMhMKCHBvc2l0aW9uEgc3MjEsMTMwEjAKB1Byb2dyYW0SJQoHUHJvZ3JhbRICCA8aBAoCTDAyEAoFdGl0bGUSB1Byb2dyYW0aFgoLJHNhbXBsZU5hbWUSBwoFU3BhY2UaFgoQJHNob3VsZF9zZWVfc2hpcBICEAAaFAoOJHNhbGx5X3dhcm5pbmcSAhAAGiYKHSRZYXJuLkludGVybmFsLlZpc2l0aW5nLlNhbGx5EgUdAAAAABosCiMkWWFybi5JbnRlcm5hbC5WaXNpdGluZy5TYWxseV9XYXRjaBIFHQAAAAAaLAojJFlhcm4uSW50ZXJuYWwuVmlzaXRpbmcuU2FsbHlfU29ycnkSBR0AAAAAGiUKHCRZYXJuLkludGVybmFsLlZpc2l0aW5nLlNoaXASBR0AAAAA" -baseLocalization = SubResource("Resource_atrn2") -JSONProjectPath = "res://Samples/Space/Dialogue/SpaceYarnProject.yarnproject" -_lineMetadataJSON = "{\"lineMetadata\":{\"line:5837f2\":{\"ID\":\"line:5837f2\",\"File\":\"res://Samples/Space/Dialogue/Ship.yarn\",\"Node\":\"Ship\",\"LineNumber\":\"7\",\"Metadata\":[\"firstline\"]}},\"stringsFile\":null}" -_listOfFunctionsJSON = "[]" -_serializedDeclarationsJSON = "[{\"name\":\"$sampleName\",\"typeName\":\"String\",\"defaultValueBool\":false,\"defaultValueNumber\":0,\"defaultValueString\":\"Space\",\"description\":null,\"isImplicit\":false,\"sourceYarnAssetPath\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Intro.yarn\"},{\"name\":\"$should_see_ship\",\"typeName\":\"Bool\",\"defaultValueBool\":false,\"defaultValueNumber\":0,\"defaultValueString\":null,\"description\":\"Ship.yarn, node Ship, line 14\",\"isImplicit\":false,\"sourceYarnAssetPath\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Variables.yarn\"},{\"name\":\"$sally_warning\",\"typeName\":\"Bool\",\"defaultValueBool\":false,\"defaultValueNumber\":0,\"defaultValueString\":null,\"description\":\"Ship.yarn, node Ship, line 14\",\"isImplicit\":false,\"sourceYarnAssetPath\":\"C:/Users/chris/YarnSpinner-Godot/Samples/Space/Dialogue/Variables.yarn\"}]" -ProjectErrors = [] diff --git a/Samples/Space/Dialogue/SpaceYarnProject.yarnproject.import b/Samples/Space/Dialogue/SpaceYarnProject.yarnproject.import index a4d2a25..7d1e136 100644 --- a/Samples/Space/Dialogue/SpaceYarnProject.yarnproject.import +++ b/Samples/Space/Dialogue/SpaceYarnProject.yarnproject.import @@ -2,7 +2,7 @@ importer="yarnproject" type="Resource" -uid="uid://d4iyb31gfyecb" +uid="uid://cs4nr6ua3wimj" path="res://.godot/imported/SpaceYarnProject.yarnproject-a079bc9c48189d15977095e2f10f5a6b.tres" [deps] diff --git a/Samples/Space/Dialogue/Variables.yarn.import b/Samples/Space/Dialogue/Variables.yarn.import index 43c4e21..7f649a3 100644 --- a/Samples/Space/Dialogue/Variables.yarn.import +++ b/Samples/Space/Dialogue/Variables.yarn.import @@ -1,7 +1,7 @@ [remap] importer="yarnscript" -type="Script" +type="Resource" uid="uid://c3s1po5kclvp5" path="res://.godot/imported/Variables.yarn-8bdec9ac6a5d9be5b97daec7248a92be.tres" diff --git a/Samples/Space/SpaceSample.tscn b/Samples/Space/SpaceSample.tscn index 5a0ff41..58f69cb 100644 --- a/Samples/Space/SpaceSample.tscn +++ b/Samples/Space/SpaceSample.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=18 format=3 uid="uid://ddbq27wcm6emj"] -[ext_resource type="Resource" uid="uid://baf1cu6kwapdh" path="res://Samples/Space/Dialogue/SpaceYarnProject.tres" id="1"] +[ext_resource type="Resource" uid="uid://cs4nr6ua3wimj" path="res://Samples/Space/Dialogue/SpaceYarnProject.yarnproject" id="1"] [ext_resource type="Texture2D" uid="uid://delt5hkois0xf" path="res://Samples/Space/Sprites/Ship-Face-Happy.png" id="2_3dm8d"] [ext_resource type="Script" path="res://Samples/Space/Scripts/SpaceSample.cs" id="3"] [ext_resource type="Texture2D" uid="uid://dsxwawdra77cw" path="res://Samples/Space/Sprites/Ship-Face-Neutral.png" id="3_b3htj"] diff --git a/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn b/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn index 8b84df0..3b633dc 100644 --- a/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn +++ b/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn @@ -56,7 +56,7 @@ Eve: I can finally write my epic romance about - #line:0c39b43 <> <> Eve: Wait... where's my laptop? It's not here. #line:04432b5 -<> Eve: Adam! Have you seen my laptop??? #line:0a21105 <> diff --git a/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn.import b/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn.import index 9efd93b..1fc1d3d 100644 --- a/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn.import +++ b/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn.import @@ -1,7 +1,7 @@ [remap] importer="yarnscript" -type="Script" +type="Resource" uid="uid://ctj60pr4owfc3" path="res://.godot/imported/VNExampleDialogue.yarn-41f0962017de26826290721466099c71.tres" diff --git a/Samples/VisualNovel/Dialogue/VN_YarnProject.tres b/Samples/VisualNovel/Dialogue/VN_YarnProject.tres deleted file mode 100644 index 7b3d266..0000000 --- a/Samples/VisualNovel/Dialogue/VN_YarnProject.tres +++ /dev/null @@ -1,34 +0,0 @@ -[gd_resource type="Resource" load_steps=6 format=3 uid="uid://c245gwv8qwsod"] - -[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/YarnProject.cs" id="1"] -[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/YarnProjectError.cs" id="1_1ier4"] -[ext_resource type="Script" path="res://addons/YarnSpinner-Godot/Runtime/Localization.cs" id="5"] - -[sub_resource type="Resource" id="Resource_i1lfe"] -script = ExtResource("1_1ier4") -FileName = "C:/Users/chris/YarnSpinner-Godot/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn" -Message = "Unexpected \" -\" while reading a command statement" -Context = "< diff --git a/Samples/VisualNovel/Localization/VisualNovel_ja.csv b/Samples/VisualNovel/Localization/VisualNovel_ja.csv index 4a88802..944bc8a 100644 --- a/Samples/VisualNovel/Localization/VisualNovel_ja.csv +++ b/Samples/VisualNovel/Localization/VisualNovel_ja.csv @@ -5,12 +5,12 @@ ja,line:07f4eac,アダム:やあ、イブ!ちょっと質問が。。。,Adam: ja,line:0721506,イブ: なんてこった...,Eve: Oh no...,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,27,62b75da4, ja,line:0b52843,イブはアダムに腹を立てます,Eve gets upset with Adam,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,33,8ace03d4, ja,line:09f21f4,イブ: なんだよ!,Eve: WHAT DO YOU WANT???,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,35,0e3efc57, -ja,line:0b7be61,アダム: YarnSpinner の使用が気に入ったかどうかを知りたかっただけです。,Adam: I just wanted to see if you liked using YarnSpinner.,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,36,fba93c4b, +ja,line:0b7be61,アダム: YarnSpinner の使用が気に入ったかどうかを知りたかっただけです。,Adam: I just wanted to see if you liked using YarnSpinner.,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,36,fba93c4b, ja,line:01942dd,イブ: いいですよ。ありがとう。では、もうほっといてください。,Eve: ... It's fine. Thanks. Now leave me alone.,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,37,d9e33ebb, ja,line:0c481f8,アダムがイブに質問する,Adam asks Eve a question,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,38,8dc9fa94, -ja,line:05eb26a,アダム: YarnSpinner が使いやすいと思っていますか?,Adam: Do you think YarnSpinner is easy to use?,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,39,bb786882, +ja,line:05eb26a,アダム: YarnSpinner が使いやすいと思っていますか?,Adam: Do you think YarnSpinner is easy to use?,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,39,bb786882, ja,line:0e8ce79,イブ: 迷惑をかけられているときには、そう思わない。,Eve: Not when you're bothering me.,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,40,37abe891, -ja,line:0cb4316,アダム: あっ!忙しいですよね、気付きませんでした。ごめんなさい。,"Adam: Oh, I didn't realize you were busy. Sorry.",res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,41,0ed8f46b, +ja,line:0cb4316,アダム: あっ!忙しいですよね、気付きませんでした。ごめんなさい。,"Adam: Oh, I didn't realize you were busy. Sorry.",res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,41,0ed8f46b, ja,line:0794753,イブ: ついに、私のノベルゲーム書く時間です。,"Eve: Ok, now to finally write that visual novel.",res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,48,3a4e6cf6, ja,line:0c39b43,イブ: ついに壮大なロマンスを。。。,Eve: I can finally write my epic romance about -,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,51,75318ced, ja,line:04432b5,イブ: ちょっと、パスコンはどこ!?なさそうだ。,Eve: Wait... where's my laptop? It's not here.,res://Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn,Start,56,3a394f4f, diff --git a/Samples/VisualNovel/Localization/VisualNovel_ja.translation b/Samples/VisualNovel/Localization/VisualNovel_ja.translation index fe46198f07be96ed557efa59c184fb2c41c2681d..16aba0d865801702c1b95f2a6ae6ea51832dc3cf 100644 GIT binary patch delta 62 zcmey)_mOYHT~_nFJafa1j~tm8lPAZpNHQvHc3_rfWORjaCRebm=TBf@V0hfL=y7wy Ores:// path of the YarnProject resource to create public static void CreateYarnProject(string projectPath) { - var newYarnProject = new YarnProject(); var jsonProject = new Yarn.Compiler.Project(); - var absPath = ProjectSettings.GlobalizePath(projectPath); - newYarnProject.ResourceName = Path.GetFileNameWithoutExtension(absPath); - newYarnProject.ResourcePath = projectPath; - var saveErr = ResourceSaver.Save( newYarnProject, projectPath); - if (saveErr != Error.Ok) - { - GD.Print($"Failed to save yarn project to {projectPath}"); - } - else - { - GD.Print($"Saved new yarn project to {projectPath}"); - YarnProjectEditorUtility.AddProjectToList(newYarnProject); - } + jsonProject.SaveToFile(absPath); } /// /// Menu Item "Tools > YarnSpinner > Create Markup Palette" diff --git a/addons/YarnSpinner-Godot/Editor/YarnImporter.cs b/addons/YarnSpinner-Godot/Editor/YarnImporter.cs index acee6eb..d17c983 100644 --- a/addons/YarnSpinner-Godot/Editor/YarnImporter.cs +++ b/addons/YarnSpinner-Godot/Editor/YarnImporter.cs @@ -6,15 +6,16 @@ namespace YarnSpinnerGodot.Editor { - /// /// A for Yarn scripts (.yarn files) /// public partial class YarnImporter : EditorImportPlugin { - + public EditorInterface editorInterface; + public override string[] _GetRecognizedExtensions() => - new[]{ + new[] + { "yarn" }; @@ -29,10 +30,12 @@ public override string _GetVisibleName() } public override string _GetSaveExtension() => "tres"; + public override string _GetResourceType() { - return "Script"; + return "Resource"; } + public override int _GetPresetCount() { return 0; @@ -42,6 +45,7 @@ public override float _GetPriority() { return 1.0f; } + public override int _GetImportOrder() { return 0; @@ -65,15 +69,18 @@ public override Error _Import( { ImportYarn(assetPath); } + var importedMarkerResource = new Resource(); - importedMarkerResource.ResourceName = System.IO.Path.GetFileNameWithoutExtension(ProjectSettings.GlobalizePath(assetPath)); + importedMarkerResource.ResourceName = + System.IO.Path.GetFileNameWithoutExtension(ProjectSettings.GlobalizePath(assetPath)); - var saveErr = ResourceSaver.Save( importedMarkerResource, $"{savePath}.{_GetSaveExtension()}"); + var saveErr = ResourceSaver.Save(importedMarkerResource, $"{savePath}.{_GetSaveExtension()}"); if (saveErr != Error.Ok) { GD.PrintErr($"Error saving yarn file import: {saveErr.ToString()}"); } - return (int)Error.Ok; + + return (int) Error.Ok; } /// @@ -127,17 +134,18 @@ public static string GetHashString(string inputString, int limitCharacters = -1) private void ImportYarn(string assetPath) { GD.Print($"Importing Yarn script {assetPath}"); - var project = YarnProjectEditorUtility.GetDestinationProject(assetPath); - if (project == null) + var projectPath = YarnProjectEditorUtility.GetDestinationProjectPath(assetPath); + if (projectPath == null) { GD.Print($"The yarn file {assetPath} is not currently associated with a Yarn Project." + - " Create a Yarn Project by selecting YarnProject from the create new resource menu and make sure this" + - " script is in the same directory as the YarnProject or" + - " in a directory underneath that directory."); + " Create a Yarn Project by selecting YarnProject from the create new resource menu and make sure this" + + " script matches one of the patterns defined for yarn source files."); } else { - YarnProjectEditorUtility.UpdateYarnProject(project); + // trigger update of the yarn project + // var godotProject = ResourceLoader.Load(projectPath); + // YarnProjectEditorUtility.UpdateYarnProject(godotProject); } } } diff --git a/addons/YarnSpinner-Godot/Editor/YarnProjectEditorUtility.cs b/addons/YarnSpinner-Godot/Editor/YarnProjectEditorUtility.cs index c1ba774..ab53672 100644 --- a/addons/YarnSpinner-Godot/Editor/YarnProjectEditorUtility.cs +++ b/addons/YarnSpinner-Godot/Editor/YarnProjectEditorUtility.cs @@ -1,5 +1,6 @@ #if TOOLS using System; +using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; @@ -12,6 +13,7 @@ using System.Threading.Tasks; using Godot; using Google.Protobuf; +using Microsoft.Extensions.FileSystemGlobbing; using Yarn; using Yarn.Compiler; using File = System.IO.File; @@ -22,8 +24,6 @@ namespace YarnSpinnerGodot.Editor [Tool] public static class YarnProjectEditorUtility { - public const string YARN_PROJECT_PATHS_SETTING_KEY = "YarnSpinnerGodot/YarnProjectPaths"; - /// /// The contents of a .csv.import file to avoid importing it as a Godot localization csv file /// @@ -34,38 +34,43 @@ public static class YarnProjectEditorUtility /// /// /// - public static YarnProject GetDestinationProject(string scriptPath) + public static string GetDestinationProjectPath(string scriptPath) { - var projectRoot = ProjectSettings.GlobalizePath("res://"); - var scriptDir = ProjectSettings.GlobalizePath(scriptPath); - scriptDir = Path.Combine(scriptDir, ".."); - scriptDir = Path.GetFullPath(scriptDir).Replace("\\", "/"); string destinationProjectPath = null; - - var allProjects = (Godot.Collections.Array) ProjectSettings.GetSetting(YARN_PROJECT_PATHS_SETTING_KEY); + var globalScriptPath = Path.GetFullPath(ProjectSettings.GlobalizePath(scriptPath)); + var allProjects = FindAllYarnProjects(); foreach (var project in allProjects) { var projectPath = ProjectSettings.GlobalizePath(project.ToString()) .Replace("\\", "/"); - projectPath = projectPath.Substring(0, projectPath.LastIndexOf("/", StringComparison.Ordinal)); - if (scriptDir.Contains(projectPath) && - (destinationProjectPath == null || - destinationProjectPath.Length < projectPath.Length)) + try { - // use the deepest matching directory - destinationProjectPath = project.ToString(); - } - } + var loadedProject = Yarn.Compiler.Project.LoadFromFile(projectPath); + if (!loadedProject.SourceFiles.Contains(globalScriptPath)) + { + continue; + } - if (destinationProjectPath == null) - { - return null; + destinationProjectPath = ProjectSettings.LocalizePath(projectPath); + break; + } + catch (Exception e) + { + GD.PushError( + $"Error while searching for the project associated with {scriptPath}: {e.Message}\n{e.StackTrace}"); + } } - destinationProjectPath = ProjectSettings.LocalizePath(destinationProjectPath); - return ResourceLoader.Load(destinationProjectPath); + return destinationProjectPath; } + private static IEnumerable FindAllYarnProjects() + { + var projectMatcher = new Matcher(); + projectMatcher.AddInclude($"**/*{YarnProject.YARN_PROJECT_EXTENSION}"); + return projectMatcher.GetResultsInFullPath(ProjectSettings.GlobalizePath("res://")) + .Select(ProjectSettings.LocalizePath); + } private const int PROJECT_UPDATE_TIMEOUT = 200; // ms @@ -245,7 +250,7 @@ private static bool UpdateLocalizationFile(IEnumerable baseLoc // localisation var onlyInBaseIDs = baseIDs.Except(translatedIDs); var onlyInTranslatedIDs = translatedIDs.Except(baseIDs); - + // Remove every entry whose ID is only present in the // translated set. This entry has been removed from the base // localization. @@ -384,10 +389,9 @@ public static void SaveYarnProject(YarnProject project) project.JSONProjectPath = project.DefaultJSONProjectPath; } - project.JSONProject.SaveToFile(ProjectSettings.GlobalizePath(project.JSONProjectPath)); // Prevent plugin failing to load when code is rebuilt ClearJSONCache(); - var saveErr = ResourceSaver.Save(project, project.ResourcePath); + var saveErr = ResourceSaver.Save(project, project.ImportPath); if (saveErr != Error.Ok) { GD.PushError($"Error updating YarnProject {project.ResourceName} to {project.ResourcePath}: {saveErr}"); @@ -515,7 +519,12 @@ public static void CompileAllScripts(YarnProject project) project.ListOfFunctions = newFunctionList.ToArray(); project.CompiledYarnProgramBase64 = compiledBytes == null ? "" : Convert.ToBase64String(compiledBytes); - ResourceSaver.Save(project, project.ResourcePath, ResourceSaver.SaverFlags.ReplaceSubresourcePaths); + var saveErr = ResourceSaver.Save(project, project.ImportPath, + ResourceSaver.SaverFlags.ReplaceSubresourcePaths); + if (saveErr != Error.Ok) + { + GD.PushError($"Failed to save updated {nameof(YarnProject)}: {saveErr}"); + } } private static void LogDiagnostic(Diagnostic diagnostic) @@ -760,64 +769,6 @@ private static IEnumerable RemoveLineIDFromMetadata(string[] metadata) return metadata.Where(x => !x.StartsWith("line:")); } - /// - /// Update the corresponding Godot when - /// the associated .yarnproject file is imported. - /// Will create a YarnProject resource that corresponds to this - /// JSON project file if none exists. - /// - /// res:// path to the .yarnproject file - public static YarnProject UpdateCompilerProject(string assetPath) - { - var godotProject = LocateGodotYarnProject(assetPath); - if (godotProject == null) - { - var automaticGodotPath = new Regex(@"\.yarnproject$") - .Replace(assetPath, ".tres"); - godotProject = new YarnProject - { - ResourcePath = automaticGodotPath, - }; - godotProject.JSONProjectPath = assetPath; - } - - UpdateYarnProject(godotProject); - return godotProject; - } - - /// - /// Work backwards from a .yarnproject file to find the godot - /// YarnProject resource that corresponds to it. - /// - /// res:// path to the .yarnproject file - /// a YarnProject if one is found referring to this path, - /// otherwise null. - public static YarnProject LocateGodotYarnProject(string assetPath) - { - var projectDir = Directory.GetParent(ProjectSettings.GlobalizePath(assetPath)); - if (projectDir == null) - { - GD.PrintErr( - $"Unable to determine the directory that {assetPath} is in to find its associated {nameof(YarnProject)}"); - } - - foreach (var file in - Directory.EnumerateFiles(projectDir.FullName, "*.tres", - SearchOption.TopDirectoryOnly)) - { - // search any .tres files in the same directory as the .yarnproject file, - // and if that resource is a Godot YarnProject, then check its JSONProjectPath. - // if they match, this .yarnproject file corresponds to that Godot YarnProject - var resource = ResourceLoader.Load(ProjectSettings.LocalizePath(file)); - if (resource is YarnProject yarnProject && yarnProject.JSONProjectPath.Equals(assetPath)) - { - return yarnProject; - } - } - - return null; - } - /// /// Update any .yarn scripts in the project to add #line: tags with /// unique IDs. @@ -933,8 +884,7 @@ public static void AddLineTagsToFilesInYarnProject(YarnProject project, EditorIn public static List LoadAllYarnProjects() { var projects = new List(); - CleanUpMovedOrDeletedProjects(); - var allProjects = (Godot.Collections.Array) ProjectSettings.GetSetting(YARN_PROJECT_PATHS_SETTING_KEY); + var allProjects = FindAllYarnProjects(); foreach (var path in allProjects) { projects.Add(ResourceLoader.Load(path.ToString())); @@ -942,45 +892,6 @@ public static List LoadAllYarnProjects() return projects; } - - private static void CleanUpMovedOrDeletedProjects() - { - var projects = (Godot.Collections.Array) ProjectSettings.GetSetting(YARN_PROJECT_PATHS_SETTING_KEY); - var removeProjects = new List(); - foreach (var path in projects) - { - if (!File.Exists(ProjectSettings.GlobalizePath((string) path))) - { - removeProjects.Add((string) path); - } - } - - var newProjects = new Godot.Collections.Array(); - foreach (var project in projects) - { - if (!removeProjects.Contains(project.AsString())) - { - newProjects.Add(project); - } - } - - ProjectSettings.SetSetting(YARN_PROJECT_PATHS_SETTING_KEY, newProjects); - } - - /// - /// Add a yarn project to the list of known yarn projects, if it is not already in the list - /// - public static void AddProjectToList(YarnProject project) - { - CleanUpMovedOrDeletedProjects(); - var projects = (Godot.Collections.Array) ProjectSettings.GetSetting(YARN_PROJECT_PATHS_SETTING_KEY); - if (project.ResourcePath != "" && !projects.Contains(project.ResourcePath)) - { - projects.Add(project.ResourcePath); - } - - ProjectSettings.SetSetting(YARN_PROJECT_PATHS_SETTING_KEY, projects); - } } } #endif \ No newline at end of file diff --git a/addons/YarnSpinner-Godot/Editor/YarnProjectImporter.cs b/addons/YarnSpinner-Godot/Editor/YarnProjectImporter.cs index 1c065d8..422e03d 100644 --- a/addons/YarnSpinner-Godot/Editor/YarnProjectImporter.cs +++ b/addons/YarnSpinner-Godot/Editor/YarnProjectImporter.cs @@ -1,18 +1,19 @@ #if TOOLS +using System; +using System.IO; using Godot; using Godot.Collections; namespace YarnSpinnerGodot.Editor { - /// /// A for YarnSpinner JSON project files (.yarnproject files) /// public partial class YarnProjectImporter : EditorImportPlugin { - public override string[] _GetRecognizedExtensions() => - new[]{ + new[] + { "yarnproject" }; @@ -27,10 +28,12 @@ public override string _GetVisibleName() } public override string _GetSaveExtension() => "tres"; + public override string _GetResourceType() { return "Resource"; } + public override int _GetPresetCount() { return 0; @@ -40,6 +43,7 @@ public override float _GetPriority() { return 1.0f; } + public override int _GetImportOrder() { return 0; @@ -59,19 +63,38 @@ public override Error _Import( { var stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); - GD.Print($"Updating the Godot {nameof(YarnProject)} resource that is linked to {assetPath}"); - var importedMarkerResource = new Resource(); - importedMarkerResource.ResourceName = System.IO.Path.GetFileNameWithoutExtension(ProjectSettings.GlobalizePath(assetPath)); - var godotProject = YarnProjectEditorUtility.UpdateCompilerProject(assetPath); + YarnProject godotProject = null; + var fullSavePath = $"{savePath}.{_GetSaveExtension()}"; + try + { + godotProject = ResourceLoader.Load(assetPath); + } + catch (Exception e) + { + GD.PushError( + $"Error loading existing {nameof(YarnProject)}: {e.Message}\n{e.StackTrace}. Creating new resource."); + } + + godotProject ??= new YarnProject(); + godotProject.JSONProjectPath = assetPath; + godotProject.ImportPath = fullSavePath; + godotProject.ResourceName = Path.GetFileName(assetPath); + var saveErr = ResourceSaver.Save(godotProject, godotProject.ImportPath); + if (saveErr != Error.Ok) + { + GD.PrintErr($"Error saving .yarnproject file import: {saveErr.ToString()}"); + } + + YarnProjectEditorUtility.UpdateYarnProject(godotProject); YarnProjectEditorUtility.UpdateLocalizationCSVs(godotProject); - var saveErr = ResourceSaver.Save( importedMarkerResource, $"{savePath}.{_GetSaveExtension()}"); + saveErr = ResourceSaver.Save(godotProject, godotProject.ImportPath); if (saveErr != Error.Ok) { GD.PrintErr($"Error saving .yarnproject file import: {saveErr.ToString()}"); } - return (int)Error.Ok; - } + return (int) Error.Ok; + } } } #endif \ No newline at end of file diff --git a/addons/YarnSpinner-Godot/Editor/YarnProjectInspectorPlugin.cs b/addons/YarnSpinner-Godot/Editor/YarnProjectInspectorPlugin.cs index 03e65aa..980261a 100644 --- a/addons/YarnSpinner-Godot/Editor/YarnProjectInspectorPlugin.cs +++ b/addons/YarnSpinner-Godot/Editor/YarnProjectInspectorPlugin.cs @@ -171,7 +171,6 @@ public override void _ParseBegin(GodotObject @object) try { _project = (YarnProject) @object; - YarnProjectEditorUtility.AddProjectToList(_project); if (IsInstanceValid(_recompileButton)) { diff --git a/addons/YarnSpinner-Godot/Runtime/Views/LineView.cs b/addons/YarnSpinner-Godot/Runtime/Views/LineView.cs index 98e36d9..8fb3fe6 100644 --- a/addons/YarnSpinner-Godot/Runtime/Views/LineView.cs +++ b/addons/YarnSpinner-Godot/Runtime/Views/LineView.cs @@ -76,7 +76,7 @@ public partial class LineView : Node, DialogueViewBase /// /// This value is only used when is /// . - /// + /// [Export] public float fadeOutTime = 0.05f; public const float FrameWaitTime = 0.16f; diff --git a/addons/YarnSpinner-Godot/Runtime/YarnProject.cs b/addons/YarnSpinner-Godot/Runtime/YarnProject.cs index 18c8944..f106e3f 100644 --- a/addons/YarnSpinner-Godot/Runtime/YarnProject.cs +++ b/addons/YarnSpinner-Godot/Runtime/YarnProject.cs @@ -35,10 +35,16 @@ namespace YarnSpinnerGodot /// "Keep file (no import)" setting under "Import As". /// [Tool] + [GlobalClass] public partial class YarnProject : Resource { public static JsonSerializerOptions JSONOptions = new JsonSerializerOptions {IncludeFields = true}; + /// + /// File extension of JSON yarn project files. + /// + public const string YARN_PROJECT_EXTENSION = ".yarnproject"; + /// /// Indicates whether the last time this file was imported, the /// file contained lines that did not have a line tag (and @@ -64,6 +70,12 @@ public partial class YarnProject : Resource /// [Export] public bool IsSuccessfullyParsed; + /// + /// Path in the .godot folder used to store generated data + /// for this project + /// + [Export] public string ImportPath; + public byte[] CompiledYarnProgram => Convert.FromBase64String(CompiledYarnProgramBase64); [Export] public string CompiledYarnProgramBase64; @@ -79,7 +91,7 @@ public partial class YarnProject : Resource #if TOOLS public string DefaultJSONProjectPath => new Regex(@"\.tres$").Replace(ResourcePath, ".yarnproject"); private Yarn.Compiler.Project _jsonProject; - + /// /// Information available in the editor via the .yarnproject file, /// parsed from JSON into a @@ -93,8 +105,8 @@ public Yarn.Compiler.Project JSONProject if (string.IsNullOrEmpty(JSONProjectPath)) { JSONProjectPath = DefaultJSONProjectPath; - } + if (!File.Exists(ProjectSettings.GlobalizePath(JSONProjectPath))) { _jsonProject = new Yarn.Compiler.Project(); @@ -116,14 +128,14 @@ public void SaveJSONProject() { _jsonProject.SaveToFile(ProjectSettings.GlobalizePath(JSONProjectPath)); } - + /// /// Base language that the .yarn scripts are written in. /// Stored in the .yarnproject file /// public string defaultLanguage => JSONProject.BaseLanguage; #endif - + private LineMetadata _lineMetadata; public LineMetadata LineMetadata diff --git a/addons/YarnSpinner-Godot/YarnSpinnerPlugin.cs b/addons/YarnSpinner-Godot/YarnSpinnerPlugin.cs index 5e2d3a7..dd2abf8 100644 --- a/addons/YarnSpinner-Godot/YarnSpinnerPlugin.cs +++ b/addons/YarnSpinner-Godot/YarnSpinnerPlugin.cs @@ -1,6 +1,7 @@ #if TOOLS using System; using System.Collections.Generic; +using System.Linq; using Godot; using Yarn.Compiler; using YarnSpinnerGodot.Editor; @@ -61,12 +62,7 @@ private struct ToolsMenuItem public override void _EnterTree() { _editorInterface = GetEditorInterface(); - if (!ProjectSettings.HasSetting(YarnProjectEditorUtility.YARN_PROJECT_PATHS_SETTING_KEY)) - { - ProjectSettings.SetSetting(YarnProjectEditorUtility.YARN_PROJECT_PATHS_SETTING_KEY, new Array()); - } - ProjectSettings.SetInitialValue(YarnProjectEditorUtility.YARN_PROJECT_PATHS_SETTING_KEY, new Array()); // load script resources var yarnProjectScript = ResourceLoader.Load("res://addons/YarnSpinner-Godot/Runtime/YarnProject.cs"); @@ -81,6 +77,7 @@ public override void _EnterTree() "res://addons/YarnSpinner-Godot/Editor/Icons/Asset Icons/mini_YarnProject Icon.png"); var scriptImportPlugin = new YarnImporter(); + scriptImportPlugin.editorInterface = GetEditorInterface(); _importPlugins.Add(scriptImportPlugin); var projectImportPlugin = new YarnProjectImporter(); _importPlugins.Add(projectImportPlugin); @@ -115,14 +112,14 @@ public override void _EnterTree() public override void _ExitTree() { - foreach (var plugin in _importPlugins) + foreach (var plugin in _importPlugins.Where(IsInstanceValid)) { RemoveImportPlugin(plugin); } RemoveCustomType(nameof(DialogueRunner)); RemoveCustomType(nameof(YarnProject)); - foreach (var plugin in _inspectorPlugins) + foreach (var plugin in _inspectorPlugins.Where(IsInstanceValid)) { RemoveInspectorPlugin(plugin); }