Skip to content

Commit

Permalink
Upgrade to Godot 4
Browse files Browse the repository at this point in the history
update visual novel sample for godot 4
fix space sample for godot 4
  • Loading branch information
dogboydog committed Sep 12, 2023
1 parent e9607f1 commit 2de8796
Show file tree
Hide file tree
Showing 186 changed files with 4,708 additions and 3,823 deletions.
31 changes: 15 additions & 16 deletions Godot_icon.png.import
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/Godot_icon.png-27a903fcc78ca91cd47ce94e4f495549.stex"
type="CompressedTexture2D"
uid="uid://dtwnehelw4jtj"
path="res://.godot/imported/Godot_icon.png-27a903fcc78ca91cd47ce94e4f495549.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Godot_icon.png"
dest_files=[ "res://.import/Godot_icon.png-27a903fcc78ca91cd47ce94e4f495549.stex" ]
dest_files=["res://.godot/imported/Godot_icon.png-27a903fcc78ca91cd47ce94e4f495549.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
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
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# YarnSpinner-Godot
WIP non functional port of [YarnSpinner-Unity](https://github.com/YarnSpinnerTool/YarnSpinner-Unity) integration to the Godot Mono engine v3.5
# YarnDonut 🧶🍩
Alpha port of [YarnSpinner-Unity](https://github.com/YarnSpinnerTool/YarnSpinner-Unity) integration to the Godot Mono engine v3.5

## Documentation

| ![](./addons/YarnSpinnerGodot/Editor/Icons/YarnSpinnerLogo.png) | ![](./Godot_icon.png) |
|-----------------------------------------------------------------|-----------------------|
See the [wiki](https://github.com/dogboydog/YarnDonut/wiki) for documentation.

The YarnSpinner logo was made by [Cecile Richard](https://www.cecile-richard.com/).
Godot logo by Andrea Calabró
## Roadmap

Working:
* Create a Yarn Project, Yarn Script, or Yarn Localization through the Tools > YarnSpinner menu
* Manage your Yarn Project with a custom inspector which provides buttons similar to the YarnSpinner-Unity inspector
* Yarn scripts will re-import on change, triggering a compilation of all yarn scripts in the associated project
* Storing a compiled yarn program, a list of errors, and string tables.
* Storing a compiled yarn program, a list of errors, line metadata, and string tables.
* Dialogue runners, commands, and functions
* Example line view and option view
* Generate CSV files for localizing your dialogue. The CSV files are not in the Godot format, but they have more context fields than Godot CSVS, and YarnDonut handles parsing and generating the CSVs, and converting them into Godot `.translation` files.

TODO:
* Generate Godot localization CSV files from yarn Localization resources
* Support localized resources in Localization
* Yarn project button to generate line tags
* All runtime code and testing - views, runner
* Bug fixes / resilience (bug reports welcome)
* Clean up code comments

### Thanks

Thanks to the YarnSpinner team for answering questions as this plugin was developed, to Taedan for providing an initial example C# import plugin, and to KXI and fmoo for giving feedback.
Binary file added Samples/NotoSerifJP-Regular.otf
Binary file not shown.
33 changes: 33 additions & 0 deletions Samples/NotoSerifJP-Regular.otf.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[remap]

importer="font_data_dynamic"
type="FontFile"
uid="uid://ddqi6bex8iqga"
path="res://.godot/imported/NotoSerifJP-Regular.otf-96fe9c5cca20d15489aa584568c0d7ca.fontdata"

[deps]

source_file="res://Samples/NotoSerifJP-Regular.otf"
dest_files=["res://.godot/imported/NotoSerifJP-Regular.otf-96fe9c5cca20d15489aa584568c0d7ca.fontdata"]

[params]

Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}
9 changes: 9 additions & 0 deletions Samples/NotoSerifJP-Regular.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]

[ext_resource path="res://Samples/NotoSerifJP-Regular.otf" type="DynamicFontData" id=1]

[resource]
size = 28
outline_size = 2
outline_color = Color( 0.0352941, 0.0627451, 0.0509804, 1 )
font_data = ExtResource( 1 )
32 changes: 32 additions & 0 deletions Samples/SampleEntryPoint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Godot;
using System;
using Array = Godot.Collections.Array;

public partial class SampleEntryPoint : CanvasLayer
{
[Export] private NodePath _spaceButtonPath;
private Button _spaceButton;
[Export] private NodePath _visualNovelButtonPath;

private Button _visualNovelButton;

// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
_spaceButton = GetNode<Button>(_spaceButtonPath);
_visualNovelButton = GetNode<Button>(_visualNovelButtonPath);
_spaceButton.Connect("pressed", Callable.From(() => LoadSample(
"res://Samples/Space/SpaceSample.tscn"
)));
_visualNovelButton.Connect("pressed", Callable.From(() => LoadSample(
"res://Samples/VisualNovel/VisualNovelSample.tscn"
)));
}

public void LoadSample(string samplePath)
{
var samplePacked = ResourceLoader.Load<PackedScene>(samplePath);
GetTree().Root.AddChild(samplePacked.Instantiate());
QueueFree();
}
}
72 changes: 72 additions & 0 deletions Samples/SampleEntryPoint.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[gd_scene load_steps=3 format=3 uid="uid://dnyy064638ly1"]

[ext_resource type="Script" path="res://Samples/SampleEntryPoint.cs" id="1"]
[ext_resource type="Theme" uid="uid://b2mp0b1wvnu8s" path="res://Samples/sample_default_theme.tres" id="2"]

[node name="Node2D" type="CanvasLayer"]
script = ExtResource("1")
_spaceButtonPath = NodePath("Space")
_visualNovelButtonPath = NodePath("Visual Novel")

[node name="ColorRect" type="ColorRect" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
color = Color(0.101961, 0.184314, 0.215686, 1)

[node name="Space" type="Button" parent="."]
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -570.0
offset_top = -503.0
offset_right = -370.0
offset_bottom = -393.0
grow_horizontal = 2
grow_vertical = 0
theme = ExtResource("2")
text = "Space"

[node name="features" type="RichTextLabel" parent="Space"]
layout_mode = 0
offset_left = -9.0
offset_top = 140.0
offset_right = 226.0
offset_bottom = 345.0
bbcode_enabled = true
text = "Basic dialogue demo
Talking to NPCs
"
scroll_active = false

[node name="Visual Novel" type="Button" parent="."]
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = 335.0
offset_top = -517.0
offset_right = 535.0
offset_bottom = -407.0
grow_horizontal = 2
grow_vertical = 0
theme = ExtResource("2")
text = "Visual Novel"

[node name="features" type="RichTextLabel" parent="Visual Novel"]
layout_mode = 0
offset_left = -20.0
offset_top = 152.0
offset_right = 262.0
offset_bottom = 380.0
bbcode_enabled = true
text = "Localization
Effect/ Animation Commands
"

[node name="RichTextLabel" type="RichTextLabel" parent="."]
bbcode_enabled = true
text = "YarnDonut Samples"
5 changes: 0 additions & 5 deletions Samples/Space/Dialogue/Sally.yarn
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,4 @@ position: 827,439
---
Sally: Yeah. Don't do it again. #line:d7df49
===
title: Declarations
---
// <<declare $should_see_ship = false "Whether the player knows they should talk to the Ship.">>
// <<declare $sally_warning = false "Whether the player has been given the warning from Sally.">>
===

5 changes: 3 additions & 2 deletions Samples/Space/Dialogue/Sally.yarn.import
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

importer="yarnscript"
type="Resource"
path="res://.import/Sally.yarn-461d08e5b02f98c92224badc7e45d4ba.tres"
uid="uid://baypc2v305035"
path="res://.godot/imported/Sally.yarn-461d08e5b02f98c92224badc7e45d4ba.tres"

[deps]

source_file="res://Samples/Space/Dialogue/Sally.yarn"
dest_files=[ "res://.import/Sally.yarn-461d08e5b02f98c92224badc7e45d4ba.tres" ]
dest_files=["res://.godot/imported/Sally.yarn-461d08e5b02f98c92224badc7e45d4ba.tres"]

[params]

5 changes: 3 additions & 2 deletions Samples/Space/Dialogue/Ship.yarn.import
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

importer="yarnscript"
type="Resource"
path="res://.import/Ship.yarn-ad47f038d197a9000e088f841751e3da.tres"
uid="uid://8h4k0uhcbonu"
path="res://.godot/imported/Ship.yarn-ad47f038d197a9000e088f841751e3da.tres"

[deps]

source_file="res://Samples/Space/Dialogue/Ship.yarn"
dest_files=[ "res://.import/Ship.yarn-ad47f038d197a9000e088f841751e3da.tres" ]
dest_files=["res://.godot/imported/Ship.yarn-ad47f038d197a9000e088f841751e3da.tres"]

[params]

Loading

0 comments on commit 2de8796

Please sign in to comment.