From fb1b447a1079a278f092d2c3349cc8f5e1aeee38 Mon Sep 17 00:00:00 2001 From: Leonard Francis Coogan Date: Mon, 13 Jul 2026 17:16:17 -0400 Subject: [PATCH] initial commit --- .DS_Store | Bin 0 -> 8196 bytes .editorconfig | 4 + .gitattributes | 2 + .gitignore | 3 + 000.tscn | 61 + addons/.DS_Store | Bin 0 -> 6148 bytes addons/GodotInk/GodotInk.props | 38 + addons/GodotInk/GodotInk.svg | 1 + addons/GodotInk/GodotInk.svg.import | 43 + addons/GodotInk/LICENSE | 21 + addons/GodotInk/README.md | 34 + addons/GodotInk/Src/InkChoice.Interop.cs | 40 + addons/GodotInk/Src/InkChoice.Interop.cs.uid | 1 + addons/GodotInk/Src/InkChoice.cs | 31 + addons/GodotInk/Src/InkChoice.cs.uid | 1 + addons/GodotInk/Src/InkDock.cs | 254 ++++ addons/GodotInk/Src/InkDock.cs.uid | 1 + addons/GodotInk/Src/InkDock.tscn | 99 ++ addons/GodotInk/Src/InkList.cs | 54 + addons/GodotInk/Src/InkList.cs.uid | 1 + addons/GodotInk/Src/InkStory.Interop.cs | 84 + addons/GodotInk/Src/InkStory.Interop.cs.uid | 1 + addons/GodotInk/Src/InkStory.cs | 698 +++++++++ addons/GodotInk/Src/InkStory.cs.uid | 1 + addons/GodotInk/Src/InkStoryImporter.cs | 172 +++ addons/GodotInk/Src/InkStoryImporter.cs.uid | 1 + addons/GodotInk/Src/InvalidInkException.cs | 14 + .../GodotInk/Src/InvalidInkException.cs.uid | 1 + addons/GodotInk/Src/MarshalUtils.cs | 105 ++ addons/GodotInk/Src/MarshalUtils.cs.uid | 1 + addons/GodotInk/Src/StubInkStory.cs | 22 + addons/GodotInk/Src/StubInkStory.cs.uid | 1 + addons/GodotInk/plugin.cfg | 7 + addons/GodotInk/plugin.gd | 62 + addons/GodotInk/plugin.gd.uid | 1 + addons/godot-git-plugin/.DS_Store | Bin 0 -> 6148 bytes addons/godot-git-plugin/LICENSE | 21 + addons/godot-git-plugin/THIRDPARTY.md | 1346 +++++++++++++++++ .../godot-git-plugin/git_plugin.gdextension | 10 + .../git_plugin.gdextension.uid | 1 + .../libgit_plugin.linux.editor.x86_64.so | Bin 0 -> 8190048 bytes ...libgit_plugin.macos.editor.universal.dylib | Bin 0 -> 11034784 bytes .../libgit_plugin.windows.editor.x86_64.dll | Bin 0 -> 6178816 bytes character_body_3d.gd | 33 + character_body_3d.gd.uid | 1 + control.gd | 15 + control.gd.uid | 1 + control.tscn | 41 + icon.svg | 1 + icon.svg.import | 43 + new_shader.gdshader | 36 + new_shader.gdshader.uid | 1 + node_3d.gdshader | 36 + node_3d.gdshader.uid | 1 + project.godot | 76 + 55 files changed, 3523 insertions(+) create mode 100644 .DS_Store create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 000.tscn create mode 100644 addons/.DS_Store create mode 100644 addons/GodotInk/GodotInk.props create mode 100644 addons/GodotInk/GodotInk.svg create mode 100644 addons/GodotInk/GodotInk.svg.import create mode 100644 addons/GodotInk/LICENSE create mode 100644 addons/GodotInk/README.md create mode 100644 addons/GodotInk/Src/InkChoice.Interop.cs create mode 100644 addons/GodotInk/Src/InkChoice.Interop.cs.uid create mode 100644 addons/GodotInk/Src/InkChoice.cs create mode 100644 addons/GodotInk/Src/InkChoice.cs.uid create mode 100644 addons/GodotInk/Src/InkDock.cs create mode 100644 addons/GodotInk/Src/InkDock.cs.uid create mode 100644 addons/GodotInk/Src/InkDock.tscn create mode 100644 addons/GodotInk/Src/InkList.cs create mode 100644 addons/GodotInk/Src/InkList.cs.uid create mode 100644 addons/GodotInk/Src/InkStory.Interop.cs create mode 100644 addons/GodotInk/Src/InkStory.Interop.cs.uid create mode 100644 addons/GodotInk/Src/InkStory.cs create mode 100644 addons/GodotInk/Src/InkStory.cs.uid create mode 100644 addons/GodotInk/Src/InkStoryImporter.cs create mode 100644 addons/GodotInk/Src/InkStoryImporter.cs.uid create mode 100644 addons/GodotInk/Src/InvalidInkException.cs create mode 100644 addons/GodotInk/Src/InvalidInkException.cs.uid create mode 100644 addons/GodotInk/Src/MarshalUtils.cs create mode 100644 addons/GodotInk/Src/MarshalUtils.cs.uid create mode 100644 addons/GodotInk/Src/StubInkStory.cs create mode 100644 addons/GodotInk/Src/StubInkStory.cs.uid create mode 100644 addons/GodotInk/plugin.cfg create mode 100644 addons/GodotInk/plugin.gd create mode 100644 addons/GodotInk/plugin.gd.uid create mode 100644 addons/godot-git-plugin/.DS_Store create mode 100644 addons/godot-git-plugin/LICENSE create mode 100644 addons/godot-git-plugin/THIRDPARTY.md create mode 100644 addons/godot-git-plugin/git_plugin.gdextension create mode 100644 addons/godot-git-plugin/git_plugin.gdextension.uid create mode 100755 addons/godot-git-plugin/linux/libgit_plugin.linux.editor.x86_64.so create mode 100755 addons/godot-git-plugin/macos/libgit_plugin.macos.editor.universal.dylib create mode 100644 addons/godot-git-plugin/windows/libgit_plugin.windows.editor.x86_64.dll create mode 100644 character_body_3d.gd create mode 100644 character_body_3d.gd.uid create mode 100644 control.gd create mode 100644 control.gd.uid create mode 100644 control.tscn create mode 100644 icon.svg create mode 100644 icon.svg.import create mode 100644 new_shader.gdshader create mode 100644 new_shader.gdshader.uid create mode 100644 node_3d.gdshader create mode 100644 node_3d.gdshader.uid create mode 100644 project.godot diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..525e26becdd004b9b4fc31d23ef05530d9db61ef GIT binary patch literal 8196 zcmeHM&2AGh5FWRoY$z>}2qG7xmAF)CJ!{AIKW>ADy1!`4cQVgNhG430=hQXOetxm!u zAHrN&m<&aztHZvp#7Q(Xy4Eq^7+7S0Zx@eh>QlAz_aK%5<}km}2UdToq6}##Y3s7*dE4IG){z{yvQ9Qio1Nin{`Nx3 zI5_Qhf|pTm+%A=$$Rz7TNpGkWqOb>%H?N{3l;frxC1I*`TYADP7K`mtWiqKhxWDJ$ zJ=mY_`ICnSHT3KErqiN#pS7RSn_K@$Yna3`VUAd* zjPs8p@H0g1g3lg$Z3@6uNFULw1FO`hFvr_h=zg&{u3Xd(tc@tj+Y`5P_O8Gl$18(B zlHz4P2wt1*!|pPj71#Tb)4jT&Yn=_9?-#YV>}z^hi}tjNv!oO1FX74Fi`Vk<@Gqic z8eo+}%I38dE4KD^Fw&zj;*zSUg(_YuKK97G72e}w*NWB6i&^)=IF(yQOFE zmet;#zv}r$2i0wm8@JQQx6*VY!(`rGiGK<3N>;1JC|2 bMBj%f>og3`G-3qB9Rw&ET;mw{rwsf8X!a|h literal 0 HcmV?d00001 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/000.tscn b/000.tscn new file mode 100644 index 0000000..080540e --- /dev/null +++ b/000.tscn @@ -0,0 +1,61 @@ +[gd_scene format=3 uid="uid://hac4l25a1g7v"] + +[ext_resource type="Shader" uid="uid://cgfte1tvivngj" path="res://new_shader.gdshader" id="1_gbilv"] +[ext_resource type="Script" uid="uid://bfvl27u51p0lf" path="res://character_body_3d.gd" id="2_atw5s"] + +[sub_resource type="BoxMesh" id="BoxMesh_4127l"] + +[sub_resource type="CameraTexture" id="CameraTexture_ey7nh"] + +[sub_resource type="Gradient" id="Gradient_atw5s"] + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_atw5s"] +gradient = SubResource("Gradient_atw5s") + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_atw5s"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_i0stl"] +render_priority = 0 +shader = ExtResource("1_gbilv") +shader_parameter/width = 0.1 +shader_parameter/height = 0.1 +shader_parameter/gap_x = 0.02 +shader_parameter/gap_y = 0.04 +shader_parameter/sink = -0.5 +shader_parameter/brick = SubResource("CameraTexture_ey7nh") +shader_parameter/wall = SubResource("NoiseTexture2D_atw5s") +shader_parameter/gap = SubResource("GradientTexture2D_atw5s") +shader_parameter/ratio = 0.5 + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_yp6wb"] +radius = 0.12158203 +height = 0.43318358 + +[sub_resource type="Environment" id="Environment_yp6wb"] +background_mode = 1 +background_color = Color(1, 0.5254629, 0.55886984, 1) +ambient_light_color = Color(0.71889627, 0.67300373, 0.93241364, 1) + +[node name="Node3D" type="Node3D" unique_id=367464733] + +[node name="CSGMesh3D" type="CSGMesh3D" parent="." unique_id=2026853425] +transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0) +use_collision = true +flip_faces = true +mesh = SubResource("BoxMesh_4127l") +material = SubResource("ShaderMaterial_i0stl") + +[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=432683985] + +[node name="CharacterBody3D" type="CharacterBody3D" parent="." unique_id=287273578] +script = ExtResource("2_atw5s") + +[node name="Camera3D" type="Camera3D" parent="CharacterBody3D" unique_id=871682469] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.53903836) +current = true + +[node name="CollisionShape3D" type="CollisionShape3D" parent="CharacterBody3D" unique_id=1029909573] +shape = SubResource("CapsuleShape3D_yp6wb") + +[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1564628371] +environment = SubResource("Environment_yp6wb") diff --git a/addons/.DS_Store b/addons/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4ec08de01970b3f35963149bb6f1e8ed63f09335 GIT binary patch literal 6148 zcmeHK&1xGl5FR;hBNGC9Xd%aiUK8S~(!GhCQc` z(@UPDuhY(ql#tX7z8M^5VDyco83}z_G&=yG+LN>a5CDKiC9Kr2`H#>%>4H@JNEK1> z8U^e@A2J{mSqBE_?gG3s3n}XT`x`PzC+lfiX92>g{UDLHrurr&r-n`xo51NhnZa90}tfSpJoX>0e<*WU7 zXPrU*-PmhB2`K!IS++gi!cR1op7TdMGPyN<^rdw)oZRtx3I+!M@c0XTKHlRIyCTAX zFdz)9gaQB7>8+LQCYuNY!oWH)K<`6{N*H-89rDwG4VM6j^c%^7Hq{ao6MBq1mJV?S zMY&K!7pi=Tp?GO*#g0p zkJtYXgQO=62m?=w0aZPYkK1@8pIa9WN4Yjc{fbILex<{^5HvUyqc5f69aI(^56M7` UJeCe|1Vw%Xm + + v1.1.1 + + $([System.IO.Path]::Combine($(GodotProjectDir),'.godot')) + $([System.IO.Path]::Combine($(GodotDotDirectory),'mono')) + $([System.IO.Path]::Combine($(GodotDotDirectory),'ink')) + $([System.IO.Path]::Combine($(GodotMonoDirectory),'ink-$(InkVersion)')) + + inklecate_windows.zip + $([System.IO.Path]::Combine($(GodotDotDirectory),$(InkZip))) + https://github.com/inkle/ink/releases/download/$(InkVersion)/$(InkZip) + ink_compiler.dll + $([System.IO.Path]::Combine($(InkVersionDirectory),$(InkCompiler))) + ink-engine-runtime.dll + $([System.IO.Path]::Combine($(InkVersionDirectory),$(InkRuntime))) + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/GodotInk/GodotInk.svg b/addons/GodotInk/GodotInk.svg new file mode 100644 index 0000000..099c837 --- /dev/null +++ b/addons/GodotInk/GodotInk.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/GodotInk/GodotInk.svg.import b/addons/GodotInk/GodotInk.svg.import new file mode 100644 index 0000000..25aaa5f --- /dev/null +++ b/addons/GodotInk/GodotInk.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://op2d8aagi35f" +path="res://.godot/imported/GodotInk.svg-0c8ec83d82b5d336ec3fed92ffcbc8bc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/GodotInk/GodotInk.svg" +dest_files=["res://.godot/imported/GodotInk.svg-0c8ec83d82b5d336ec3fed92ffcbc8bc.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/addons/GodotInk/LICENSE b/addons/GodotInk/LICENSE new file mode 100644 index 0000000..dc40bae --- /dev/null +++ b/addons/GodotInk/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 - 2024 Paul Joannon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/addons/GodotInk/README.md b/addons/GodotInk/README.md new file mode 100644 index 0000000..884df89 --- /dev/null +++ b/addons/GodotInk/README.md @@ -0,0 +1,34 @@ +# GodotInk + +An [ink](https://github.com/inkle/ink) integration for [Godot Engine 4](https://github.com/godotengine/godot). + +If you use and like this project, please consider buying me a coffee. +[![ko-fi](https://img.shields.io/badge/support_me_on_ko--fi-ff5e5b?style=for-the-badge&logo=kofi&logoColor=f5f5f5)](https://ko-fi.com/E1E53SKZF) + +## Usage + +You'll find a quick-start guide, and the general documentation on the project's +[wiki](https://github.com/paulloz/godot-ink/wiki). + +### Installation + +The following instructions assume that you have a working Godot and .NET installation. If not, please refer to the +official [engine documentation](https://docs.godotengine.org/). + +1. [Download](https://github.com/paulloz/godot-ink/releases/latest) and extract the code at the root of your project. + You should see a new `addons/GodotInk/` folder in your project's directory. + +1. Add the following line in your `.csproj` file (before the closing `` tag). + ```xml + + ``` + If you don't have a `.csproj` file, click the **Create C# Solution** button in the editor's + **Project/Tools** menu. + +1. Build your project once. + +1. Enable **GodotInk** in your project settings. + +## License + +*GodotInk* is released under MIT license (see the [LICENSE](/LICENSE) file for more information). diff --git a/addons/GodotInk/Src/InkChoice.Interop.cs b/addons/GodotInk/Src/InkChoice.Interop.cs new file mode 100644 index 0000000..5c61372 --- /dev/null +++ b/addons/GodotInk/Src/InkChoice.Interop.cs @@ -0,0 +1,40 @@ +#nullable enable + +using System.ComponentModel; + +namespace GodotInk; + +public partial class InkChoice +{ +#pragma warning disable IDE0022 + /// + /// This method is here for GDScript compatibility. Use instead. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string GetText() => Text; + + /// + /// This method is here for GDScript compatibility. Use instead. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string GetPathStringOnChoice() => PathStringOnChoice; + + /// + /// This method is here for GDScript compatibility. Use instead. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string GetSourcePath() => SourcePath; + + /// + /// This method is here for GDScript compatibility. Use instead. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int GetIndex() => Index; + + /// + /// This method is here for GDScript compatibility. Use instead. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Godot.Collections.Array GetTags() => new(Tags); +#pragma warning restore IDE0022 +} diff --git a/addons/GodotInk/Src/InkChoice.Interop.cs.uid b/addons/GodotInk/Src/InkChoice.Interop.cs.uid new file mode 100644 index 0000000..0d391fd --- /dev/null +++ b/addons/GodotInk/Src/InkChoice.Interop.cs.uid @@ -0,0 +1 @@ +uid://dcwohy1x33mp8 diff --git a/addons/GodotInk/Src/InkChoice.cs b/addons/GodotInk/Src/InkChoice.cs new file mode 100644 index 0000000..7a368e7 --- /dev/null +++ b/addons/GodotInk/Src/InkChoice.cs @@ -0,0 +1,31 @@ +#nullable enable + +using Godot; +using System.Collections.Generic; + +namespace GodotInk; + +[Tool] +#if GODOT4_1_OR_GREATER +[GlobalClass] +#endif +public partial class InkChoice : RefCounted +{ + public string Text => inner.text; + public string PathStringOnChoice => inner.pathStringOnChoice; + public string SourcePath => inner.sourcePath; + public int Index => inner.index; + public IReadOnlyList Tags => inner.tags ?? (IReadOnlyList)System.Array.Empty(); + + private readonly Ink.Runtime.Choice inner; + + private InkChoice() + { + inner = new Ink.Runtime.Choice(); + } + + public InkChoice(Ink.Runtime.Choice inner) + { + this.inner = inner; + } +} diff --git a/addons/GodotInk/Src/InkChoice.cs.uid b/addons/GodotInk/Src/InkChoice.cs.uid new file mode 100644 index 0000000..d85536b --- /dev/null +++ b/addons/GodotInk/Src/InkChoice.cs.uid @@ -0,0 +1 @@ +uid://jrgs3csjev4o diff --git a/addons/GodotInk/Src/InkDock.cs b/addons/GodotInk/Src/InkDock.cs new file mode 100644 index 0000000..fdca185 --- /dev/null +++ b/addons/GodotInk/Src/InkDock.cs @@ -0,0 +1,254 @@ +#if TOOLS +#nullable enable + +using Godot; +using System; +using System.Linq; + +namespace GodotInk; + +[Tool] +public partial class InkDock : VBoxContainer +{ + private static readonly StringName CHOICE_INDEX_META = "Index"; + + private Button loadButton = null!; + private Button startButton = null!; + private Button stopButton = null!; + private Button clearButton = null!; + + private Label storyNameLabel = null!; + private VBoxContainer storyText = null!; + private VBoxContainer storyChoices = null!; + private ScrollContainer scroll = null!; + + private EditorFileDialog fileDialog = null!; + + private string storyPath = ""; + private InkStory? story; + private bool storyStarted; + + private string backupSave = ""; + + public override void _Ready() + { + base._Ready(); + + CustomMinimumSize = new Vector2(0.0f, 228.0f); + + // Initialize file dialog. + fileDialog = new() + { + FileMode = EditorFileDialog.FileModeEnum.OpenFile, + Access = EditorFileDialog.AccessEnum.Resources, + }; + fileDialog.AddFilter("*.ink", "Ink Stories"); + fileDialog.FileSelected += LoadStory; + + AddChild(fileDialog); + + // Initialize top. + loadButton = GetNode