Skip to content

Commit f367164

Browse files
committed
v0.1.0 release
Well, we need to start from somewhere.
1 parent 5e53673 commit f367164

13 files changed

+111
-6
lines changed

.images/.gdignore

Whitespace-only changes.

.images/banner_animation.gif

105 KB
Loading

.images/godot_inspector_tab.png

15.2 KB
Loading
9.63 KB
Loading

.images/godot_new_event.png

12.3 KB
Loading

.images/godot_new_timeline.png

6.78 KB
Loading

.images/godot_scene_tree.png

8 KB
Loading

.images/godot_view_tabs.png

3.93 KB
Loading

README.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,71 @@
11
# Dialogue Plugin for Godot Engine
2+
[![Godot Engine](https://img.shields.io/badge/Godot%20Engine-Plugin-blue?style=flat-square&logo=godot-engine&logoColor=white&logoWidth=20)]() [![GitHub license](https://img.shields.io/github/license/AnidemDex/Godot-DialogPlugin?style=flat-square)](https://github.com/AnidemDex/Godot-DialogPlugin/blob/main/LICENSE)
3+
[![GitHub issues](https://img.shields.io/github/issues/AnidemDex/Godot-DialogPlugin?style=flat-square)](https://github.com/AnidemDex/Godot-DialogPlugin/issues)
4+
[![Godot Engine](https://img.shields.io/badge/Version-0.1.0-red?style=flat-square)]()
5+
6+
![Banner](.images/banner_animation.gif)
7+
8+
An user-friendly dialog system for Godot Engine, with timelines, characters, text boxes, dialog bubbles and many more (planned) features for your games.
29

3-
A tool that will help you create dialogues and timelines with characters for your games.
410
> Be creative 💬
511
6-
# ⚠Warning⚠
12+
## ⚠Warning⚠
713

8-
> This plugin is not yet ready for use.
14+
> This plugin is **not** ready for use, yet.
915
1016
You can try it anyway, but be sure to make a copy of your dialog files. The format will not change, but, just in case.
1117

18+
# Installation
19+
20+
Download the lastest release and extract the ZIP file. Move the `addons` folders to the root of your project. It's that easy!
21+
22+
If you want more information about installing plugins in Godot, please refer to [official documentation page](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/installing_plugins.html).
23+
24+
# How to use it
25+
26+
That's a good question.
27+
28+
1. First, create a timeline, inside the Dialog Editor tab.
29+
30+
After activating the plugin, go to Dialog Editor tab. It should be next to `AssetLib` tab.
31+
![Godot View Tabs](.images/godot_view_tabs.png)
32+
33+
Then, click on `Timelines` button and `New` button.
34+
![New Timeline](.images/godot_new_timeline.png)
35+
36+
2. Add some events to that timeline. A timeline without events will not work, and will halt your game if you try to use it.
37+
38+
![New event](.images/godot_new_event.png)
39+
3. Create a new `Dialog` node, and `start` it with your recently created timeline.
40+
41+
You had 2 options:
42+
1. Create it from code:
43+
```gdscript
44+
# ...
45+
# inside any node in the scene
46+
# ...
47+
48+
# Create the node first and start it with your timeline
49+
var dialog_node = Dialog.start(<your_timeline>)
50+
51+
# Add that node to the scene
52+
add_child(dialog_node)
53+
```
54+
`your_timeline` can be the name of your timeline (the name that you used when you created it), the absolute path to that timeline or a `DialogTimelineResource`.
55+
56+
2. or Instantiate it in the scene editor:
57+
58+
![Instance dialog](.images/godot_instance_dialog_node.png)
59+
Then, select the node:
60+
![Dialog Node](.images/godot_scene_tree.png)
61+
62+
And, inside the Inspector tab, select the timeline:
63+
![Inspector](.images/godot_inspector_tab.png)
64+
65+
That's it, it's fair simple.
66+
67+
> For now, there's only 3 events. They'll be more, and you can create your custom events if you want.
68+
1269
# Documentation
1370

1471
Please refer to [DOCS.md](/docs/DOCS.md) (WIP)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
class_name Dialog
2+
## Hello, traveler
3+
##
4+
##
5+
6+
## Default TextBox Scene path
7+
const DefaultDialogTextBox:String = "res://addons/dialog_plugin/Nodes/ingame_dialogue_box/ingame_dialogue_node.tscn"
8+
9+
## Default Bubble Scene path
10+
const DefaultDialogBubble:String = "res://addons/dialog_plugin/Nodes/ingame_dialogue_bubble/dialog_bubble.tscn"
11+
12+
13+
const _DialogDB = preload("res://addons/dialog_plugin/Core/DialogDatabase.gd")
14+
15+
16+
static func start(timeline, dialog_scene_path:String="", use_bubble:bool=false) -> DialogBaseNode:
17+
var _dialog_node = null
18+
if dialog_scene_path:
19+
var _dialog_scene:PackedScene = load(dialog_scene_path) as PackedScene
20+
_dialog_node = _dialog_scene.instance()
21+
22+
if not(_dialog_node is DialogBaseNode):
23+
_dialog_node = null
24+
25+
if not _dialog_node:
26+
_dialog_node = get_default_dialog_textbox() if not use_bubble else get_default_dialog_bubble()
27+
28+
29+
if timeline is String:
30+
(_dialog_node as DialogBaseNode).timeline = _DialogDB.Timelines.get_timeline(timeline.get_basename().get_file())
31+
elif timeline is DialogTimelineResource:
32+
(_dialog_node as DialogBaseNode).timeline = timeline
33+
return _dialog_node
34+
35+
36+
static func get_default_dialog_textbox() -> DialogBaseNode:
37+
var _dialog_textbox_scene:PackedScene = load(DefaultDialogTextBox) as PackedScene
38+
var _dialog_textbox_node:DialogBaseNode = _dialog_textbox_scene.instance() as DialogBaseNode
39+
return _dialog_textbox_node
40+
41+
42+
static func get_default_dialog_bubble() -> DialogBaseNode:
43+
var _dialog_bubble_scene:PackedScene = load(DefaultDialogBubble) as PackedScene
44+
var _dialog_bubble_node:DialogBaseNode = _dialog_bubble_scene.instance() as DialogBaseNode
45+
return _dialog_bubble_node

0 commit comments

Comments
 (0)