Skip to content

Commit 5fafea2

Browse files
Emit dialogue_started signal when showing balloon (#734)
1 parent d835bab commit 5fafea2

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

addons/dialogue_manager/dialogue_manager.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ const DialogueManagerParseResult = preload("./components/parse_result.gd")
1212
const ResolvedLineData = preload("./components/resolved_line_data.gd")
1313

1414

15+
## Emitted when a dialogue balloon is created and dialogue starts
16+
signal dialogue_started(resource: DialogueResource)
17+
1518
## Emitted when a title is encountered while traversing dialogue, usually when jumping from a
1619
## goto line
1720
signal passed_title(title: String)
@@ -269,6 +272,7 @@ func show_example_dialogue_balloon(resource: DialogueResource, title: String = "
269272
var balloon: Node = load(_get_example_balloon_path()).instantiate()
270273
get_current_scene.call().add_child(balloon)
271274
balloon.start(resource, title, extra_game_states)
275+
dialogue_started.emit(resource)
272276

273277
return balloon
274278

@@ -278,6 +282,7 @@ func show_dialogue_balloon(resource: DialogueResource, title: String = "", extra
278282
var balloon_path: String = DialogueSettings.get_setting(&"balloon_path", _get_example_balloon_path())
279283
if not ResourceLoader.exists(balloon_path):
280284
balloon_path = _get_example_balloon_path()
285+
dialogue_started.emit(resource)
281286
return show_dialogue_balloon_scene(balloon_path, resource, title, extra_game_states)
282287

283288

docs/API.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Signals
66

7+
- `dialogue_started(resource: DialogueResource)` - emitted when a dialogue balloon is created and dialogue begins.
78
- `passed_title(title)` - emitted when a title marker is passed through.
89
- `got_dialogue(line: DialogueLine)` - emitted when a dialogue line is found.
910
- `mutated(mutation: Dictionary)` - emitted when a mutation line is about to be run (not including `set` lines).

0 commit comments

Comments
 (0)