commit fb1b447a1079a278f092d2c3349cc8f5e1aeee38 Author: Leonard Francis Coogan Date: Mon Jul 13 17:16:17 2026 -0400 initial commit diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..525e26b Binary files /dev/null and b/.DS_Store differ 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 0000000..4ec08de Binary files /dev/null and b/addons/.DS_Store differ diff --git a/addons/GodotInk/GodotInk.props b/addons/GodotInk/GodotInk.props new file mode 100644 index 0000000..0ab7053 --- /dev/null +++ b/addons/GodotInk/GodotInk.props @@ -0,0 +1,38 @@ + + + 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