Skip to content

Commit 5303341

Browse files
Replace call with callv in event 042 (#824)
* Replace `call` with `callv` in event 042 * Updating the changelog, updating tutorial and labels Co-authored-by: Emilio Coppola <[email protected]>
1 parent b31a2b5 commit 5303341

File tree

5 files changed

+37
-37
lines changed

5 files changed

+37
-37
lines changed

addons/dialogic/Documentation/Content/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- You can now make a list of words like this: `[word1,word2,word3]` and Dialogic will pick a random word from the list. If the word is a Dialogic variable name and it gets picked it will show the value of that variable.
99
- New commands [signal=argument], [pause=wait_time], [play=soundname], [nv=v] (for waiting until the audio finishes) added to the Text Event [[KvaGram](https://github.com/KvaGram)]
1010
- The Character Join and Character Leave events have been removed in favor of the new `Character Event`. They will be converted automatically. The new events allows for more customization including animations. These use the anima system. Learn more about the [event](./Events/002.md) and the [animations](./Tutorials/AddNewAnimations.md) [[Jowan-Spooner](https://github.com/Jowan-Spooner)]
11+
- The `Call Node Event` now sends arguments instead of a single array. If you were using it in one of your timelines you will need to update the functions you are calling to accommodate this. [[AnidemDex](https://github.com/AnidemDex)]
1112

1213

1314
#### Settings/Themes

addons/dialogic/Documentation/Content/Tutorials/Updating.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ This assumes you are upgrading from version 1.3.
66
Here is everything you need to do to successfully updated (as far as we know):
77

88
## 1. Make a backup of your project
9-
- Close your project/Godot
10-
- Make a full project backup just in case you lose some data while upgrading
11-
- Remove the `/addons/dialogic` folder from your project
12-
- Paste the new Dialogic 1.4 into the addons folder
13-
- Open your project/Godot again
14-
- Enable the new Dialogic from the plugin menu (Project Settings/Plugins)
9+
- Close your project/Godot
10+
- Make a full project backup just in case you lose some data while upgrading
11+
- Remove the `/addons/dialogic` folder from your project
12+
- Paste the new Dialogic 1.4 into the addons folder
13+
- Open your project/Godot again
14+
- Enable the new Dialogic from the plugin menu (Project Settings/Plugins)
15+
16+
## Update the call node events target functions
17+
- The `Call Node Event` now sends arguments instead of a single array. If you were using it in one of your timelines you will need to update the functions you are calling to accommodate this. So if the function you were calling before was something like `func hello(Array)` now it should be `func hello(argument1, argument2, argument3, ...)` with as many arguments as you have in the event settings.

addons/dialogic/Editor/Events/Parts/CallNode/CallNodePicker.tscn

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,57 +16,57 @@ __meta__ = {
1616

1717
[node name="Label" parent="." instance=ExtResource( 2 )]
1818
margin_top = 0.0
19-
margin_right = 792.0
19+
margin_right = 782.0
2020
margin_bottom = 14.0
2121
custom_colors/font_color = Color( 0, 0, 0, 1 )
22-
text = "This event calls the method [Method Name] on the node [Target Node]. It passes an array to the method."
22+
text = "This event calls the function [Function Name] on the [Target Node] (use full path!). It also passes a number of arguments."
2323

2424
[node name="Properties" type="HBoxContainer" parent="."]
2525
margin_top = 18.0
26-
margin_right = 792.0
27-
margin_bottom = 52.0
26+
margin_right = 782.0
27+
margin_bottom = 45.0
2828
custom_constants/separation = 8
2929

3030
[node name="TargetNodeLabel" type="Label" parent="Properties"]
31-
margin_top = 10.0
31+
margin_top = 6.0
3232
margin_right = 81.0
33-
margin_bottom = 24.0
33+
margin_bottom = 20.0
3434
text = "Target Node:"
3535

3636
[node name="TargetNodeEdit" parent="Properties" instance=ExtResource( 3 )]
3737
margin_left = 89.0
3838
margin_right = 329.0
39-
margin_bottom = 34.0
39+
margin_bottom = 27.0
4040
rect_min_size = Vector2( 240, 27 )
4141

4242
[node name="CallMethodLabel" type="Label" parent="Properties"]
4343
margin_left = 337.0
44-
margin_top = 10.0
44+
margin_top = 6.0
4545
margin_right = 432.0
46-
margin_bottom = 24.0
46+
margin_bottom = 20.0
4747
text = "Method Name:"
4848

4949
[node name="CallMethodEdit" parent="Properties" instance=ExtResource( 3 )]
5050
margin_left = 440.0
5151
margin_right = 620.0
52-
margin_bottom = 34.0
52+
margin_bottom = 27.0
5353
rect_min_size = Vector2( 180, 27 )
5454

5555
[node name="ArgumentsLabel" type="Label" parent="Properties"]
5656
margin_left = 628.0
57-
margin_top = 10.0
58-
margin_right = 708.0
59-
margin_bottom = 24.0
60-
text = "ArrayLength:"
57+
margin_top = 6.0
58+
margin_right = 698.0
59+
margin_bottom = 20.0
60+
text = "Arguments"
6161

6262
[node name="ArgumentsSpinBox" type="SpinBox" parent="Properties"]
63-
margin_left = 716.0
64-
margin_right = 792.0
65-
margin_bottom = 34.0
63+
margin_left = 706.0
64+
margin_right = 782.0
65+
margin_bottom = 27.0
6666
max_value = 99.0
6767

6868
[node name="Arguments" type="VBoxContainer" parent="."]
69-
margin_top = 56.0
70-
margin_right = 792.0
71-
margin_bottom = 56.0
69+
margin_top = 49.0
70+
margin_right = 782.0
71+
margin_bottom = 49.0
7272
custom_constants/separation = 5

addons/dialogic/Editor/Events/Parts/CallNode/EventPart_CallNodePicker.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func _create_argument_controls():
9191

9292
var label = Label.new()
9393
label.name = "IndexLabel"
94-
label.text = "Index %s:" % index
94+
label.text = "Argument %s:" % index
9595
label.rect_min_size.x = 100
9696
container.add_child(label)
9797

addons/dialogic/Nodes/DialogNode.gd

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -978,16 +978,12 @@ func event_handler(event: Dictionary):
978978
if (not args is Array):
979979
args = []
980980

981-
if (target != null):
982-
if (target.has_method(method_name)):
983-
if (args.empty()):
984-
var func_result = target.call(method_name)
985-
if (func_result is GDScriptFunctionState):
986-
yield(func_result, "completed")
987-
else:
988-
var func_result = target.call(method_name, args)
989-
if (func_result is GDScriptFunctionState):
990-
yield(func_result, "completed")
981+
if is_instance_valid(target):
982+
if target.has_method(method_name):
983+
var func_result = target.callv(method_name, args)
984+
985+
if (func_result is GDScriptFunctionState):
986+
yield(func_result, "completed")
991987

992988
set_state(state.IDLE)
993989
$TextBubble.visible = true

0 commit comments

Comments
 (0)