Skip to content

Commit

Permalink
v0.1.0 release
Browse files Browse the repository at this point in the history
Well, we need to start from somewhere.
  • Loading branch information
AnidemDex committed Apr 30, 2021
1 parent 5e53673 commit f367164
Show file tree
Hide file tree
Showing 13 changed files with 111 additions and 6 deletions.
Empty file added .images/.gdignore
Empty file.
Binary file added .images/banner_animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .images/godot_inspector_tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .images/godot_instance_dialog_node.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .images/godot_new_event.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .images/godot_new_timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .images/godot_scene_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .images/godot_view_tabs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 60 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,71 @@
# Dialogue Plugin for Godot Engine
[![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)
[![GitHub issues](https://img.shields.io/github/issues/AnidemDex/Godot-DialogPlugin?style=flat-square)](https://github.com/AnidemDex/Godot-DialogPlugin/issues)
[![Godot Engine](https://img.shields.io/badge/Version-0.1.0-red?style=flat-square)]()

![Banner](.images/banner_animation.gif)

An user-friendly dialog system for Godot Engine, with timelines, characters, text boxes, dialog bubbles and many more (planned) features for your games.

A tool that will help you create dialogues and timelines with characters for your games.
> Be creative 💬
# ⚠Warning⚠
## ⚠Warning⚠

> This plugin is not yet ready for use.
> This plugin is **not** ready for use, yet.
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.

# Installation

Download the lastest release and extract the ZIP file. Move the `addons` folders to the root of your project. It's that easy!

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).

# How to use it

That's a good question.

1. First, create a timeline, inside the Dialog Editor tab.

After activating the plugin, go to Dialog Editor tab. It should be next to `AssetLib` tab.
![Godot View Tabs](.images/godot_view_tabs.png)

Then, click on `Timelines` button and `New` button.
![New Timeline](.images/godot_new_timeline.png)

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.

![New event](.images/godot_new_event.png)
3. Create a new `Dialog` node, and `start` it with your recently created timeline.

You had 2 options:
1. Create it from code:
```gdscript
# ...
# inside any node in the scene
# ...
# Create the node first and start it with your timeline
var dialog_node = Dialog.start(<your_timeline>)
# Add that node to the scene
add_child(dialog_node)
```
`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`.

2. or Instantiate it in the scene editor:

![Instance dialog](.images/godot_instance_dialog_node.png)
Then, select the node:
![Dialog Node](.images/godot_scene_tree.png)

And, inside the Inspector tab, select the timeline:
![Inspector](.images/godot_inspector_tab.png)

That's it, it's fair simple.

> For now, there's only 3 events. They'll be more, and you can create your custom events if you want.
# Documentation

Please refer to [DOCS.md](/docs/DOCS.md) (WIP)
45 changes: 45 additions & 0 deletions addons/dialog_plugin/Core/DialogClass.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
class_name Dialog
## Hello, traveler
##
##

## Default TextBox Scene path
const DefaultDialogTextBox:String = "res://addons/dialog_plugin/Nodes/ingame_dialogue_box/ingame_dialogue_node.tscn"

## Default Bubble Scene path
const DefaultDialogBubble:String = "res://addons/dialog_plugin/Nodes/ingame_dialogue_bubble/dialog_bubble.tscn"


const _DialogDB = preload("res://addons/dialog_plugin/Core/DialogDatabase.gd")


static func start(timeline, dialog_scene_path:String="", use_bubble:bool=false) -> DialogBaseNode:
var _dialog_node = null
if dialog_scene_path:
var _dialog_scene:PackedScene = load(dialog_scene_path) as PackedScene
_dialog_node = _dialog_scene.instance()

if not(_dialog_node is DialogBaseNode):
_dialog_node = null

if not _dialog_node:
_dialog_node = get_default_dialog_textbox() if not use_bubble else get_default_dialog_bubble()


if timeline is String:
(_dialog_node as DialogBaseNode).timeline = _DialogDB.Timelines.get_timeline(timeline.get_basename().get_file())
elif timeline is DialogTimelineResource:
(_dialog_node as DialogBaseNode).timeline = timeline
return _dialog_node


static func get_default_dialog_textbox() -> DialogBaseNode:
var _dialog_textbox_scene:PackedScene = load(DefaultDialogTextBox) as PackedScene
var _dialog_textbox_node:DialogBaseNode = _dialog_textbox_scene.instance() as DialogBaseNode
return _dialog_textbox_node


static func get_default_dialog_bubble() -> DialogBaseNode:
var _dialog_bubble_scene:PackedScene = load(DefaultDialogBubble) as PackedScene
var _dialog_bubble_node:DialogBaseNode = _dialog_bubble_scene.instance() as DialogBaseNode
return _dialog_bubble_node
2 changes: 2 additions & 0 deletions addons/dialog_plugin/Core/DialogUtil.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class Error:
const TIMELINE_NOT_FOUND = "TIMELINE_NOT_FOUND"
const TIMELINE_NOT_SELECTED = "TIMELINE_NOT_SELECTED"

const DIALOGNODE_IS_NOT_CHILD_OF_CANVASLAYER = "You didn't add this node to a CanvasLayer or Control node. If this was intentional, you can ignore this warning."

static func not_found_timeline() -> DialogTimelineResource:
var _timeline = DialogTimelineResource.new()
var _text_event = DialogTextEvent.new()
Expand Down
5 changes: 3 additions & 2 deletions addons/dialog_plugin/Editor/toolbar/ToolBar.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[ext_resource path="res://addons/dialog_plugin/assets/Themes/toolbar_hide_button.tres" type="StyleBox" id=5]
[ext_resource path="res://addons/dialog_plugin/Editor/toolbar/CheckBox.gd" type="Script" id=6]

[sub_resource type="Image" id=5]
[sub_resource type="Image" id=1]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "LumAlpha8",
Expand All @@ -19,7 +19,7 @@ data = {
[sub_resource type="ImageTexture" id=2]
flags = 4
flags = 4
image = SubResource( 5 )
image = SubResource( 1 )
size = Vector2( 16, 16 )

[sub_resource type="StyleBoxEmpty" id=3]
Expand Down Expand Up @@ -71,6 +71,7 @@ margin_left = 202.0
margin_right = 298.0
margin_bottom = 38.0
size_flags_horizontal = 10
disabled = true
text = "Configuration"

[node name="InfoLabel" type="Label" parent="PanelContainer"]
Expand Down
2 changes: 1 addition & 1 deletion docs/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ There's a block diagram explaining (kind of) the behaviour of this plugin. You c

There's also a [Trello board](https://trello.com/b/pVz78Ct0) with the planned features to be implemented.

They're probably in spanish.
They're in spanish.

0 comments on commit f367164

Please sign in to comment.