Skip to content

Commit 29294d5

Browse files
authored
Add documentation to most scripts and update naming of certain symbols (#326)
* Add documentation to `GaeaData` * Add documentation to `GaeaGrid`. * Add documentation to materials * Change mentions of `Gridmap` to `GridMap`. * Add documentation to GaeaRenderer and make its methods private * Add documentation to `TileMapGaeaRenderer`. * Add documentation to `GridMapRenderer`. * Add documentation to `GaeaNodeResource`. * Make `_get_data` private. * Make cache methods private * Make input methods private * Make `_get_arg` private. * Make logging methods private * Make more methods private * Hide some methods from documentation and warn in GaeaData * Add documentation to `GaeaValue`. * Add some documentation to `GaeaGraphNode` * Rename `GaeaGraphNodeParameter` to `GaeaGraphNodeParameterEditor` * Finish documentation of `GaeaGraphNode` * Make the connection_idx methods public again * Update some naming and reconnect disconnected signals * Add documentation to `GaeaGraphNodeParameterEditor` * Add documentation to `GaeaGraphNodeOutput` * Change description of `notify_connections_updated` * Add documentation to `GaeaGenerator`. * Add `class_name` to all ParameterEditors * Change icon of ParameterEditors to hide it more in Godot's add node tree * Add `class_name` to all graph nodes * Add script classes * Change naming of signal-emitting methods in generator * Add proper spacing to `node_resource.gd` * Update some comments * Update naming of idx * Update gaea_value.gd * Update node_resource.gd * Add documentation to `GaeaNode`s (part 1) * I fucked up (fixed typo) * Add icon to `GaeaNodeResource` * Add documentation to `GaeaNode`s (part 2) * Add virtual version of `get_scene` * Finish `GaeaNodeResource`s documentation
1 parent d5c294d commit 29294d5

File tree

139 files changed

+983
-523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+983
-523
lines changed
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://d01oerqx1xuok"
6+
path="res://.godot/imported/gaea_node_resource.svg-22fbdf1f633d28c47aacd2eb3d0636e4.ctex"
7+
metadata={
8+
"has_editor_variant": true,
9+
"vram_texture": false
10+
}
11+
12+
[deps]
13+
14+
source_file="res://addons/gaea/assets/gaea_node_resource.svg"
15+
dest_files=["res://.godot/imported/gaea_node_resource.svg-22fbdf1f633d28c47aacd2eb3d0636e4.ctex"]
16+
17+
[params]
18+
19+
compress/mode=0
20+
compress/high_quality=false
21+
compress/lossy_quality=0.7
22+
compress/hdr_compression=1
23+
compress/normal_map=0
24+
compress/channel_pack=0
25+
mipmaps/generate=false
26+
mipmaps/limit=-1
27+
roughness/mode=0
28+
roughness/src_normal=""
29+
process/fix_alpha_border=true
30+
process/premult_alpha=false
31+
process/normal_map_invert_y=false
32+
process/hdr_as_srgb=false
33+
process/hdr_clamp_exposure=false
34+
process/size_limit=0
35+
detect_3d/compress_to=1
36+
svg/scale=1.0
37+
editor/scale_with_editor_scale=true
38+
editor/convert_colors_with_editor_theme=true
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://dox5e4tnafwet"
6+
path="res://.godot/imported/parameter_editor.svg-8a5814218dcd6dff896188e64ebe9abb.ctex"
7+
metadata={
8+
"has_editor_variant": true,
9+
"vram_texture": false
10+
}
11+
12+
[deps]
13+
14+
source_file="res://addons/gaea/assets/parameter_editor.svg"
15+
dest_files=["res://.godot/imported/parameter_editor.svg-8a5814218dcd6dff896188e64ebe9abb.ctex"]
16+
17+
[params]
18+
19+
compress/mode=0
20+
compress/high_quality=false
21+
compress/lossy_quality=0.7
22+
compress/hdr_compression=1
23+
compress/normal_map=0
24+
compress/channel_pack=0
25+
mipmaps/generate=false
26+
mipmaps/limit=-1
27+
roughness/mode=0
28+
roughness/src_normal=""
29+
process/fix_alpha_border=true
30+
process/premult_alpha=false
31+
process/normal_map_invert_y=false
32+
process/hdr_as_srgb=false
33+
process/hdr_clamp_exposure=false
34+
process/size_limit=0
35+
detect_3d/compress_to=1
36+
svg/scale=1.0
37+
editor/scale_with_editor_scale=true
38+
editor/convert_colors_with_editor_theme=true

addons/gaea/editor/graph_edit.gd

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
extends GraphEdit
33

44

5-
signal request_connection_update
6-
signal request_save
5+
signal connection_update_requested
6+
signal save_requested
77

88
var attached_elements: Dictionary
99

@@ -30,15 +30,15 @@ func delete_nodes(nodes: Array[StringName]) -> void:
3030
continue
3131
for connection in node.connections:
3232
disconnect_node(connection.from_node, connection.from_port, connection.to_node, connection.to_port)
33-
node.on_removed()
33+
node.removed.emit()
3434
elif node is GraphFrame:
3535
for attached in get_attached_nodes_of_frame(node.name):
3636
attached_elements.erase(attached)
3737
node.queue_free()
3838
await node.tree_exited
3939

40-
request_connection_update.emit()
41-
request_save.emit()
40+
connection_update_requested.emit()
41+
save_requested.emit()
4242

4343

4444
func _on_connection_request(from_node: StringName, from_port: int, to_node: StringName, to_port: int) -> void:
@@ -67,21 +67,21 @@ func _on_connection_request(from_node: StringName, from_port: int, to_node: Stri
6767
)
6868

6969
connect_node(from_node, from_port, to_node, to_port)
70-
request_connection_update.emit()
70+
connection_update_requested.emit()
7171

7272
get_node(NodePath(from_node)).notify_connections_updated.call_deferred()
7373
target_node.notify_connections_updated.call_deferred()
7474

75-
request_save.emit()
75+
save_requested.emit()
7676

7777
func _on_disconnection_request(from_node: StringName, from_port: int, to_node: StringName, to_port: int) -> void:
7878
disconnect_node(from_node, from_port, to_node, to_port)
79-
request_connection_update.emit()
79+
connection_update_requested.emit()
8080

8181
get_node(NodePath(from_node)).notify_connections_updated.call_deferred()
8282
get_node(NodePath(to_node)).notify_connections_updated.call_deferred()
8383

84-
request_save.emit()
84+
save_requested.emit()
8585

8686
func remove_invalid_connections() -> void:
8787
for connection in get_connection_list():
@@ -100,7 +100,7 @@ func remove_invalid_connections() -> void:
100100
disconnect_node(connection.from_node, connection.from_port, connection.to_node, connection.to_port)
101101
continue
102102

103-
request_save.emit()
103+
save_requested.emit()
104104

105105
func is_nodes_connected_relatively(from_node: StringName, to_node: StringName) -> bool:
106106
var nodes_to_check: Array[StringName] = [from_node]
@@ -132,12 +132,12 @@ func _on_graph_elements_linked_to_frame_request(elements: Array, frame: StringNa
132132
for element in elements:
133133
attach_graph_element_to_frame(element, frame)
134134
_on_element_attached_to_frame(element, frame)
135-
request_save.emit.call_deferred()
135+
save_requested.emit.call_deferred()
136136

137137

138138
func _on_element_attached_to_frame(element: StringName, frame: StringName) -> void:
139139
attached_elements.set(element, frame)
140-
request_save.emit()
140+
save_requested.emit()
141141

142142

143143
func _is_node_hover_valid(from_node: StringName, _from_port: int, to_node: StringName, _to_port: int) -> bool:

addons/gaea/editor/node_popup.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func populate(selected: Array) -> void:
4848
if selected.front() is GaeaGraphNode and selected.size() == 1:
4949
var node: GaeaGraphNode = selected.front()
5050
var resource: GaeaNodeResource = node.resource
51-
if resource is GaeaVariableNodeResource:
51+
if resource is GaeaNodeVariable:
5252
var data: GaeaData = panel.get_selected_generator().data
5353
var parameter: Dictionary = data.parameters.get(node.get_arg_value("name"), {})
5454
if parameter.get("value") is Resource:
@@ -125,7 +125,7 @@ func _on_id_pressed(id: int) -> void:
125125
Action.OPEN_IN_INSPECTOR:
126126
var node: GaeaGraphNode = graph_edit.get_selected().front()
127127
var resource: GaeaNodeResource = node.resource
128-
if resource is GaeaVariableNodeResource:
128+
if resource is GaeaNodeVariable:
129129
var data: GaeaData = panel.get_selected_generator().data
130130
var parameter: Dictionary = data.parameters.get(node.get_arg_value("name"), {})
131131
var value: Variant = parameter.get("value")

addons/gaea/editor/panel.gd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,10 @@ func _add_node_from_resource(resource: GaeaNodeResource, p_is_loading: bool = fa
319319
node.resource = resource
320320
node.generator = get_selected_generator()
321321
_graph_edit.add_child(node)
322-
node.on_added()
323322
node.save_requested.connect(_save_data)
324323
node.name = node.name.replace("@", "_")
325324
if not p_is_loading:
326-
node.finished_loading = true
325+
node.set_finished_loading(true)
327326
return node
328327

329328

@@ -458,7 +457,7 @@ func _on_reload_parameters_list_button_pressed() -> void:
458457
if node is not GaeaGraphNode:
459458
continue
460459

461-
if node.resource is GaeaVariableNodeResource:
460+
if node.resource is GaeaNodeVariable:
462461
existing_parameters.append(node.get_arg_value("name"))
463462

464463

addons/gaea/editor/panel.tscn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,14 +393,14 @@ exclusive = true
393393
[connection signal="pressed" from="Editor/VBoxContainer/HBoxContainer/WindowPopoutButton" to="." method="_on_window_popout_button_pressed"]
394394
[connection signal="connection_request" from="Editor/VBoxContainer/GraphEdit" to="Editor/VBoxContainer/GraphEdit" method="_on_connection_request"]
395395
[connection signal="connection_to_empty" from="Editor/VBoxContainer/GraphEdit" to="." method="_on_graph_edit_connection_to_empty"]
396+
[connection signal="connection_update_requested" from="Editor/VBoxContainer/GraphEdit" to="." method="update_connections"]
396397
[connection signal="delete_nodes_request" from="Editor/VBoxContainer/GraphEdit" to="Editor/VBoxContainer/GraphEdit" method="_on_delete_nodes_request"]
397398
[connection signal="disconnection_request" from="Editor/VBoxContainer/GraphEdit" to="Editor/VBoxContainer/GraphEdit" method="_on_disconnection_request"]
398399
[connection signal="end_node_move" from="Editor/VBoxContainer/GraphEdit" to="." method="_save_data"]
399400
[connection signal="graph_elements_linked_to_frame_request" from="Editor/VBoxContainer/GraphEdit" to="Editor/VBoxContainer/GraphEdit" method="_on_graph_elements_linked_to_frame_request"]
400401
[connection signal="gui_input" from="Editor/VBoxContainer/GraphEdit" to="." method="_on_graph_edit_gui_input"]
401402
[connection signal="node_selected" from="Editor/VBoxContainer/GraphEdit" to="Editor/VBoxContainer/GraphEdit" method="_on_node_selected"]
402-
[connection signal="request_connection_update" from="Editor/VBoxContainer/GraphEdit" to="." method="update_connections"]
403-
[connection signal="request_save" from="Editor/VBoxContainer/GraphEdit" to="." method="_save_data"]
403+
[connection signal="save_requested" from="Editor/VBoxContainer/GraphEdit" to="." method="_save_data"]
404404
[connection signal="scroll_offset_changed" from="Editor/VBoxContainer/GraphEdit" to="." method="_on_graph_edit_scroll_offset_changed"]
405405
[connection signal="text_changed" from="Editor/CreateNodePopup/MainContentContainer/VBox/SearchContainer/SearchBar" to="Editor/CreateNodePopup/MainContentContainer/VBox/CreateNodeTree" method="_on_search_bar_text_changed"]
406406
[connection signal="text_submitted" from="Editor/CreateNodePopup/MainContentContainer/VBox/SearchContainer/SearchBar" to="Editor/CreateNodePopup/MainContentContainer/VBox/CreateNodeTree" method="_on_search_bar_text_submitted"]
Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
@tool
22
class_name GaeaGraphNodeOutput
33
extends MarginContainer
4+
## An output slot inside a [GaeaGraphNode].
45

56

7+
## The resource holding the information for this slot such as [member GaeaNodeSlotOutput.name].
68
var resource: GaeaNodeSlotOutput
79
## Reference to the [GaeaGraphNode] instance
810
var graph_node: GaeaGraphNode
9-
## ID of the slot in the [GaeaGraphNode].
11+
## Index of the slot in the [GaeaGraphNode].
1012
var idx: int
1113

1214

1315
@onready var _label: RichTextLabel = %RightLabel
14-
@onready var toggle_preview_button: TextureButton = %TogglePreviewButton
16+
@onready var _toggle_preview_button: TextureButton = %TogglePreviewButton : get = get_toggle_preview_button
1517

1618

17-
func initialize(_graph_node: GaeaGraphNode, _idx: int) -> void:
18-
graph_node = _graph_node
19-
idx = _idx
19+
## Sets the corresponding variables.
20+
func initialize(for_graph_node: GaeaGraphNode, for_idx: int) -> void:
21+
graph_node = for_graph_node
22+
idx = for_idx
2023

2124

2225
func _ready() -> void:
@@ -27,11 +30,16 @@ func _ready() -> void:
2730
await graph_node.ready
2831

2932
_label.text = resource.name.capitalize()
30-
toggle_preview_button.texture_normal = get_theme_icon(&"GuiVisibilityHidden", &"EditorIcons")
31-
toggle_preview_button.texture_pressed = get_theme_icon(&"GuiVisibilityVisible", &"EditorIcons")
32-
toggle_preview_button.toggle_mode = true
33-
33+
_toggle_preview_button.texture_normal = get_theme_icon(&"GuiVisibilityHidden", &"EditorIcons")
34+
_toggle_preview_button.texture_pressed = get_theme_icon(&"GuiVisibilityVisible", &"EditorIcons")
35+
_toggle_preview_button.toggle_mode = true
36+
3437
graph_node.set_slot_enabled_right(idx, true)
3538
graph_node.set_slot_type_right(idx, resource.type)
3639
graph_node.set_slot_color_right(idx, GaeaValue.get_color(resource.type))
3740
graph_node.set_slot_custom_icon_right(idx, GaeaValue.get_slot_icon(resource.type))
41+
42+
43+
## Returns the button used to toggle the preview for this output slot.
44+
func get_toggle_preview_button() -> TextureButton:
45+
return _toggle_preview_button

addons/gaea/graph/components/inputs/base_parameter.tscn

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

55
[node name="BaseParameter" type="HBoxContainer"]
66
script = ExtResource("1_rylg1")
7-
add_input_slot = false
87

98
[node name="Label" type="Label" parent="."]
109
layout_mode = 2

0 commit comments

Comments
 (0)