Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directory and path cleanup; see description #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GD Yarn is a [Godot](https://godotengine.org/) plugin that allows you to create

GD Yarn is an implementation of [YarnSpinner](https://yarnspinner.dev) completely written in [GDScript](https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html). The project aims to be as feature complete as possible compared to the c# version but may forgo certain things in lieu of similar alternatives that make it blend better with the Godot ecosystem.

![Exmaple of Running a Dialogue](https://raw.githubusercontent.com/kyperbelt/GDYarn/main/images/yarn_running_dialogue.gif)
![Exmaple of Running a Dialogue](gdyarn/images/yarn_running_dialogue.gif)

<a id="Features"></a>

Expand Down
4 changes: 2 additions & 2 deletions .tracked_yarn_files → addons/gdyarn/.tracked_yarn_files
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
res://addons/gdyarn/examples/example1.yarn
res://addons/gdyarn/examples/inline_expressions.yarn
res://addons/gdyarn/examples/ricky.yarn
res://exampleAssets/Example.yarn
res://exampleAssets/inline_expressions.yarn
res://gdyarn/exampleAssets/Example.yarn
res://gdyarn/exampleAssets/inline_expressions.yarn
10 changes: 5 additions & 5 deletions addons/gdyarn/core/program/program_utils.gd
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const LineInfo = preload("res://addons/gdyarn/core/program/yarn_line.gd")


const STRINGS_EXTENSION := "tsv"
const DEFAULT_STRINGS_FORMAT = "%s%s-strings.%s"
const LOCALISED_STRINGS_FORMAT = "%s%s-%s-strings.%s"
const DEFAULT_STRINGS_FORMAT = "%s-strings.%s"
const LOCALISED_STRINGS_FORMAT = "%s-%s-strings.%s"

func _init():
pass
Expand All @@ -39,7 +39,7 @@ func _init():
static func export_program(program,filePath):
var file := File.new()

var stringsPath = DEFAULT_STRINGS_FORMAT % [filePath.get_base_dir().trim_prefix("res://"),filePath.get_basename(),STRINGS_EXTENSION]
var stringsPath = DEFAULT_STRINGS_FORMAT % [filePath.get_basename(),STRINGS_EXTENSION]
var lineInfos = program.yarnStrings
var result : PoolStringArray = _serialize_lines(lineInfos)
var strings : String = result.join("\n") #
Expand Down Expand Up @@ -166,8 +166,8 @@ static func _serialize_all_operands(operands)->Array:
static func _import_program(filePath)->YarnProgram:
var file := File.new()

var stringsPath = DEFAULT_STRINGS_FORMAT % [filePath.get_base_dir().trim_prefix("res://"),filePath.get_basename(),STRINGS_EXTENSION]
var localizedStringsPath = "%s%s-strings-%s.ots" % [filePath.get_base_dir().trim_prefix("res://"),filePath.get_basename(),TranslationServer.get_locale()]
var stringsPath = DEFAULT_STRINGS_FORMAT % [filePath.get_basename(),STRINGS_EXTENSION]
var localizedStringsPath = "%s-strings-%s.ots" % [filePath.get_basename(),TranslationServer.get_locale()]
var strings : PoolStringArray

if file.file_exists(localizedStringsPath):
Expand Down
2 changes: 1 addition & 1 deletion addons/gdyarn/yarn_importer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ extends EditorImportPlugin

class_name YarnImporter

const YARN_TRACKER_PATH := "res://.tracked_yarn_files"
const YARN_TRACKER_PATH := "res://addons/gdyarn/.tracked_yarn_files"

# Called when the node enters the scene tree for the first time.
func _ready():
Expand Down
13 changes: 0 additions & 13 deletions exampleAssets/Example.yarn.import

This file was deleted.

13 changes: 0 additions & 13 deletions exampleAssets/inline_expressions.yarn.import

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion TokenSpitter.tscn → gdyarn/TokenSpitter.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2]

[ext_resource path="res://TokenSpitter.gd" type="Script" id=1]
[ext_resource path="res://gdyarn/TokenSpitter.gd" type="Script" id=1]


[node name="Node" type="Node"]
script = ExtResource( 1 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
[resource]
script = ExtResource( 1 )
_programName = "compiled_yarn_program"
_directory = "res://"
_yarnPrograms = [ "res://exampleAssets/inline_expressions.yarn" ]
_directory = "res://gdyarn/"
_yarnPrograms = [ "res://gdyarn/exampleAssets/inline_expressions.yarn" ]
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions gdyarn/exampleAssets/Example.yarn.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[remap]

importer="gdyarn.yarnFile"
type="Resource"
path="res://.import/Example.yarn-f4de8db1d86d31804828e7172deec006.tres"

[deps]

source_file="res://gdyarn/exampleAssets/Example.yarn"
dest_files=[ "res://.import/Example.yarn-f4de8db1d86d31804828e7172deec006.tres" ]

[params]

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

importer="texture"
type="StreamTexture"
path="res://.import/arrowBeige_right.png-a26b0e914f75ade1046d34348e2a449e.stex"
path="res://.import/arrowBeige_right.png-e775eba6b5790c57abaea22835fa84fc.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://exampleAssets/arrowBeige_right.png"
dest_files=[ "res://.import/arrowBeige_right.png-a26b0e914f75ade1046d34348e2a449e.stex" ]
source_file="res://gdyarn/exampleAssets/arrowBeige_right.png"
dest_files=[ "res://.import/arrowBeige_right.png-e775eba6b5790c57abaea22835fa84fc.stex" ]

[params]

Expand All @@ -28,6 +28,7 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

importer="texture"
type="StreamTexture"
path="res://.import/buttonLong_brown.png-03ee633a76b63ff23b575202641bd453.stex"
path="res://.import/buttonLong_brown.png-f643333d6d75937360cbf872e16c2432.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://exampleAssets/buttonLong_brown.png"
dest_files=[ "res://.import/buttonLong_brown.png-03ee633a76b63ff23b575202641bd453.stex" ]
source_file="res://gdyarn/exampleAssets/buttonLong_brown.png"
dest_files=[ "res://.import/buttonLong_brown.png-f643333d6d75937360cbf872e16c2432.stex" ]

[params]

Expand All @@ -28,6 +28,7 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

importer="texture"
type="StreamTexture"
path="res://.import/buttonLong_brown_pressed.png-73b3e58f28a2f86777c188531daf11c2.stex"
path="res://.import/buttonLong_brown_pressed.png-d9f0f6058c3e69d03b808a9435ae4d49.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://exampleAssets/buttonLong_brown_pressed.png"
dest_files=[ "res://.import/buttonLong_brown_pressed.png-73b3e58f28a2f86777c188531daf11c2.stex" ]
source_file="res://gdyarn/exampleAssets/buttonLong_brown_pressed.png"
dest_files=[ "res://.import/buttonLong_brown_pressed.png-d9f0f6058c3e69d03b808a9435ae4d49.stex" ]

[params]

Expand All @@ -28,6 +28,7 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions gdyarn/exampleAssets/inline_expressions.yarn.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[remap]

importer="gdyarn.yarnFile"
type="Resource"
path="res://.import/inline_expressions.yarn-09fcb6cc7fb21dbcf6b665c7627e6810.tres"

[deps]

source_file="res://gdyarn/exampleAssets/inline_expressions.yarn"
dest_files=[ "res://.import/inline_expressions.yarn-09fcb6cc7fb21dbcf6b665c7627e6810.tres" ]

[params]

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

importer="texture"
type="StreamTexture"
path="res://.import/panelInset_brown.png-0eac78471b81ec5cd7e8b59d96bcb6fd.stex"
path="res://.import/panelInset_brown.png-913008eb727c29011bd7f95102b66965.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://exampleAssets/panelInset_brown.png"
dest_files=[ "res://.import/panelInset_brown.png-0eac78471b81ec5cd7e8b59d96bcb6fd.stex" ]
source_file="res://gdyarn/exampleAssets/panelInset_brown.png"
dest_files=[ "res://.import/panelInset_brown.png-913008eb727c29011bd7f95102b66965.stex" ]

[params]

Expand All @@ -28,6 +28,7 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

importer="texture"
type="StreamTexture"
path="res://.import/panel_brown.png-737ae1e4bca5b9d18a84a2439902ffb0.stex"
path="res://.import/panel_brown.png-dca7ecc7bff9a3788a0aed92606afeff.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://exampleAssets/panel_brown.png"
dest_files=[ "res://.import/panel_brown.png-737ae1e4bca5b9d18a84a2439902ffb0.stex" ]
source_file="res://gdyarn/exampleAssets/panel_brown.png"
dest_files=[ "res://.import/panel_brown.png-dca7ecc7bff9a3788a0aed92606afeff.stex" ]

[params]

Expand All @@ -28,6 +28,7 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
Expand Down
File renamed without changes
6 changes: 3 additions & 3 deletions icon.png.import → gdyarn/icon.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
path="res://.import/icon.png-ef90ac20d63c2ebd220a57712ecb8e3e.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
source_file="res://gdyarn/icon.png"
dest_files=[ "res://.import/icon.png-ef90ac20d63c2ebd220a57712ecb8e3e.stex" ]

[params]

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
9 changes: 3 additions & 6 deletions test.tscn → gdyarn/test.tscn
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[gd_scene load_steps=6 format=2]

[ext_resource path="res://testdisplay.tscn" type="PackedScene" id=1]
[ext_resource path="res://gdyarn/testdisplay.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/gdyarn/yarn_runner.gd" type="Script" id=2]
[ext_resource path="res://addons/gdyarn/core/variable_storage.gd" type="Script" id=3]
[ext_resource path="res://StorageDisplay.gd" type="Script" id=4]
[ext_resource path="res://compiledProgramResource.tres" type="Resource" id=5]
[ext_resource path="res://gdyarn/StorageDisplay.gd" type="Script" id=4]
[ext_resource path="res://gdyarn/compiledProgramResource.tres" type="Resource" id=5]

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

Expand All @@ -31,6 +31,3 @@ margin_top = 6.0
margin_right = 131.0
margin_bottom = 206.0
script = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}
17 changes: 9 additions & 8 deletions testdisplay.tscn → gdyarn/testdisplay.tscn
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[gd_scene load_steps=17 format=2]

[ext_resource path="res://addons/gdyarn/yarn_gui.gd" type="Script" id=1]
[ext_resource path="res://exampleAssets/Cairo-Regular.ttf" type="DynamicFontData" id=2]
[ext_resource path="res://exampleAssets/arrowBeige_right.png" type="Texture" id=3]
[ext_resource path="res://exampleAssets/buttonLong_brown_pressed.png" type="Texture" id=4]
[ext_resource path="res://exampleAssets/buttonLong_brown.png" type="Texture" id=5]
[ext_resource path="res://exampleAssets/panel_brown.png" type="Texture" id=6]
[ext_resource path="res://exampleAssets/Kenney Pixel.ttf" type="DynamicFontData" id=7]
[ext_resource path="res://TextContainer.gd" type="Script" id=8]
[ext_resource path="res://yarn_button.gd" type="Script" id=9]
[ext_resource path="res://gdyarn/exampleAssets/Cairo-Regular.ttf" type="DynamicFontData" id=2]
[ext_resource path="res://gdyarn/exampleAssets/arrowBeige_right.png" type="Texture" id=3]
[ext_resource path="res://gdyarn/exampleAssets/buttonLong_brown_pressed.png" type="Texture" id=4]
[ext_resource path="res://gdyarn/exampleAssets/buttonLong_brown.png" type="Texture" id=5]
[ext_resource path="res://gdyarn/exampleAssets/panel_brown.png" type="Texture" id=6]
[ext_resource path="res://gdyarn/exampleAssets/Kenney Pixel.ttf" type="DynamicFontData" id=7]
[ext_resource path="res://gdyarn/TextContainer.gd" type="Script" id=8]
[ext_resource path="res://gdyarn/yarn_button.gd" type="Script" id=9]


[sub_resource type="DynamicFont" id=6]
size = 24
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ _global_script_class_icons={
[application]

config/name="GDYarn"
run/main_scene="res://test.tscn"
config/icon="res://icon.png"
run/main_scene="res://gdyarn/test.tscn"
config/icon="res://gdyarn/icon.png"

[autoload]

Expand Down