forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making
inst_to_dict
and dict_to_inst
recursive
Fixes godotengine#6533 Making GDScript inst_to_dict/dict_to_inst utility functions recursive. Adding also a new macro to validate the number of the required arguments and another to validate that an argument is boolean.
- Loading branch information
Showing
10 changed files
with
212 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
modules/gdscript/tests/scripts/utility_functions/bar.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extends Resource | ||
|
||
@export var text: String | ||
@export var qux: Resource | ||
|
||
|
||
func _init(p_text = "", p_qux = null): | ||
text = p_text | ||
qux = p_qux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://cqd4xsl30rr7b"] | ||
|
||
[ext_resource type="Script" path="./bar.notest.gd" id="1_bar"] | ||
[ext_resource type="Script" path="./qux.tres" id="1_qux"] | ||
|
||
[resource] | ||
script = ExtResource("1_bar") | ||
text = "lorem ipsum" | ||
qux = ExtResource("1_qux") |
9 changes: 9 additions & 0 deletions
9
modules/gdscript/tests/scripts/utility_functions/foo.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extends Resource | ||
|
||
@export var number: int | ||
@export var bar: Resource | ||
|
||
|
||
func _init(p_number = 0, p_bar = null): | ||
number = p_number | ||
bar = p_bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://cqd4xsl30rr7a"] | ||
|
||
[ext_resource type="Script" path="./foo.notest.gd" id="1_foo"] | ||
[ext_resource type="Script" path="./bar.tres" id="1_bar"] | ||
|
||
[resource] | ||
script = ExtResource("1_foo") | ||
number = 42 | ||
bar = ExtResource("1_bar") |
Oops, something went wrong.