Skip to content

Commit

Permalink
Fixed docs and added DialogueBubble example
Browse files Browse the repository at this point in the history
  • Loading branch information
nagidev committed May 12, 2024
1 parent 07c68a1 commit b7a3ea7
Show file tree
Hide file tree
Showing 22 changed files with 716 additions and 78 deletions.
1 change: 1 addition & 0 deletions addons/dialogue_nodes/Editor.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ grow_horizontal = 2
grow_vertical = 2

[node name="DialogueBox" type="Panel" parent="."]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
Expand Down
5 changes: 3 additions & 2 deletions addons/dialogue_nodes/icons/CharacterList.svg.import
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type="CompressedTexture2D"
uid="uid://b5wgoe1rpbf31"
path="res://.godot/imported/CharacterList.svg-83222511b7ebf193c7042c4f541d1914.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}

Expand Down Expand Up @@ -33,5 +34,5 @@ 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
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true
42 changes: 42 additions & 0 deletions addons/dialogue_nodes/icons/DialogueBox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions addons/dialogue_nodes/icons/DialogueBox.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c6dtwwunb63rm"
path="res://.godot/imported/DialogueBox.svg-90fca4f90a37756503d256c204e7ef83.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}

[deps]

source_file="res://addons/dialogue_nodes/icons/DialogueBox.svg"
dest_files=["res://.godot/imported/DialogueBox.svg-90fca4f90a37756503d256c204e7ef83.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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=true
editor/convert_colors_with_editor_theme=true
42 changes: 42 additions & 0 deletions addons/dialogue_nodes/icons/DialogueBubble.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions addons/dialogue_nodes/icons/DialogueBubble.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://fqpf7kdjqa6m"
path="res://.godot/imported/DialogueBubble.svg-459bd1b1f9c5c0fab5c392594cf078e0.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}

[deps]

source_file="res://addons/dialogue_nodes/icons/DialogueBubble.svg"
dest_files=["res://.godot/imported/DialogueBubble.svg-459bd1b1f9c5c0fab5c392594cf078e0.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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=true
editor/convert_colors_with_editor_theme=true
42 changes: 42 additions & 0 deletions addons/dialogue_nodes/icons/DialogueParser.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions addons/dialogue_nodes/icons/DialogueParser.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dr0i7ng6lymhm"
path="res://.godot/imported/DialogueParser.svg-d0149a02a1ec195e3bd77e339994df1d.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}

[deps]

source_file="res://addons/dialogue_nodes/icons/DialogueParser.svg"
dest_files=["res://.godot/imported/DialogueParser.svg-d0149a02a1ec195e3bd77e339994df1d.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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=true
editor/convert_colors_with_editor_theme=true
5 changes: 3 additions & 2 deletions addons/dialogue_nodes/objects/Character.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@icon("res://addons/dialogue_nodes/icons/Character.svg")
@icon('res://addons/dialogue_nodes/icons/Character.svg')
## The data for a speaker in a dialogue.
class_name Character extends Resource
class_name Character
extends Resource

@export var name : String = ''
@export var image : Texture2D
Expand Down
5 changes: 3 additions & 2 deletions addons/dialogue_nodes/objects/CharacterList.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@icon("res://addons/dialogue_nodes/icons/CharacterList.svg")
@icon('res://addons/dialogue_nodes/icons/CharacterList.svg')
## An array containing multiple [param Character]s.
class_name CharacterList extends Resource
class_name CharacterList
extends Resource

@export var characters : Array[Character]
3 changes: 2 additions & 1 deletion addons/dialogue_nodes/objects/DialogueBox.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@tool
## A node for displaying branching dialogues, primarily created using the Dialogue Nodes editor.
class_name DialogueBox extends Panel
class_name DialogueBox
extends Panel


## Triggered when a dialogue has started. Passes [param id] of the dialogue tree as defined in the StartNode.
Expand Down
3 changes: 2 additions & 1 deletion addons/dialogue_nodes/objects/DialogueBubble.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
## A node for displaying branching dialogues, primarily created using the Dialogue Nodes editor.[br]
## NOTE: This node is not good at handling long paragraphs of text. It is recommended to use [DialogueBox] instead, or create your custom implementation using [DialogueParser].
## @experimental
class_name DialogueBubble extends RichTextLabel
class_name DialogueBubble
extends RichTextLabel


## Triggered when a dialogue has started. Passes [param id] of the dialogue tree as defined in the StartNode.
Expand Down
5 changes: 3 additions & 2 deletions addons/dialogue_nodes/objects/DialogueData.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Data for processing dialogue through a [param DialogueParser].
@icon("res://addons/dialogue_nodes/icons/Dialogue.svg")
class_name DialogueData extends Resource
@icon('res://addons/dialogue_nodes/icons/Dialogue.svg')
class_name DialogueData
extends Resource

## Contains the start IDs as keys and their respective node name as values.
## Example: { "START": "0_1" }
Expand Down
6 changes: 4 additions & 2 deletions addons/dialogue_nodes/objects/DialogueParser.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@tool
## A parser for reading and processing [param DialogueData] files
class_name DialogueParser extends Node
@icon('res://addons/dialogue_nodes/icons/DialogueParser.svg')
class_name DialogueParser
extends Node
# TODO : Fix [wait] bbcode

## Triggered when a dialogue has started. Passes [param id] of the dialogue tree as defined in the StartNode.
Expand Down Expand Up @@ -285,7 +287,7 @@ func _update_wait_tags(node : RichTextLabel, value : String):
# find the actual position of the last character sans bbcode
value = value.replace('\n', ' ').replace('[br]', '\n')
node.text = value
print('# parsed text: ', node.get_parsed_text()) #

var text_length := node.get_parsed_text().length() - value.count('\n')

# update [wait] with last attribute for showing options
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogue_nodes/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="Dialogue Nodes"
description="A plugin to create dialogue trees using graph nodes, save them as resource files and use them in your games."
author="Nagi"
version="1.1.0"
version="1.2.0"
script="plugin.gd"
5 changes: 3 additions & 2 deletions addons/dialogue_nodes/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ extends EditorPlugin
const EditorScene = preload('res://addons/dialogue_nodes/Editor.tscn')
const DialogueBoxScene = preload('res://addons/dialogue_nodes/objects/DialogueBox.gd')
const DialogueBubbleScene = preload('res://addons/dialogue_nodes/objects/DialogueBubble.gd')
const DialogueBoxIcon = preload('res://addons/dialogue_nodes/icons/Dialogue.svg')
const DialogueBoxIcon = preload('res://addons/dialogue_nodes/icons/DialogueBox.svg')
const DialogueBubbleIcon = preload('res://addons/dialogue_nodes/icons/DialogueBubble.svg')

var editor

Expand All @@ -31,7 +32,7 @@ func _enter_tree():
'DialogueBubble',
'RichTextLabel',
DialogueBubbleScene,
DialogueBoxIcon
DialogueBubbleIcon
)

print_debug('Plugin Enabled')
Expand Down
Loading

0 comments on commit b7a3ea7

Please sign in to comment.