Skip to content

Commit d1e4fef

Browse files
committed
Merge branch 'fou_chien' of https://github.com/Zehir/gaea into pr/366
2 parents b056c76 + ee1d15b commit d1e4fef

File tree

520 files changed

+27765
-192
lines changed

Some content is hidden

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

520 files changed

+27765
-192
lines changed

.gitattributes

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33

44
# Only include the addons folder when downloading from the Asset Library.
55
/** export-ignore
6-
/addons !export-ignore
7-
/addons/** !export-ignore
8-
/addons/gdscript_formatter export-ignore
9-
/addons/gdscript_formatter/** export-ignore
6+
/addons/gaea !export-ignore
7+
/addons/gaea/** !export-ignore
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: GHA
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- '**.yml'
7+
- '**.md'
8+
workflow_dispatch:
9+
10+
11+
concurrency:
12+
group: ${{ github.workflow }}|${{ github.ref_name }}
13+
cancel-in-progress: true
14+
15+
16+
jobs:
17+
generate_test:
18+
name: "Generation Testing"
19+
runs-on: 'ubuntu-22.04'
20+
timeout-minutes: 10 # The overall timeout
21+
permissions:
22+
actions: write
23+
checks: write
24+
contents: write
25+
pull-requests: write
26+
statuses: write
27+
28+
steps:
29+
# checkout your repository
30+
- uses: actions/checkout@v4
31+
with:
32+
lfs: true
33+
# run tests by using the gdUnit4-action with Godot version 4.2.1 and the latest GdUnit4 release
34+
- uses: MikeSchulze/gdUnit4-action@v1.1.6
35+
with:
36+
godot-version: '4.4.1'
37+
paths: |
38+
res://testing/generation
39+
timeout: 5
40+
publish-report: false
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: GHA
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- '**.yml'
7+
- '**.md'
8+
workflow_dispatch:
9+
10+
11+
concurrency:
12+
group: ${{ github.workflow }}|${{ github.ref_name }}
13+
cancel-in-progress: true
14+
15+
16+
jobs:
17+
warning_check:
18+
name: "Node Testing"
19+
runs-on: 'ubuntu-22.04'
20+
timeout-minutes: 10 # The overall timeout
21+
permissions:
22+
actions: write
23+
checks: write
24+
contents: write
25+
pull-requests: write
26+
statuses: write
27+
28+
steps:
29+
# checkout your repository
30+
- uses: actions/checkout@v4
31+
with:
32+
lfs: true
33+
# run tests by using the gdUnit4-action with Godot version 4.2.1 and the latest GdUnit4 release
34+
- uses: MikeSchulze/gdUnit4-action@v1.1.6
35+
with:
36+
godot-version: '4.4.1'
37+
paths: |
38+
res://testing/graph_nodes
39+
timeout: 5
40+
publish-report: false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ scenes/test/*
1818

1919
# Editor-specific ignores
2020
.vscode/*
21+
22+
GdUnitRunner.cfg

addons/gaea/editor/graph_edit.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func delete_nodes(nodes: Array[StringName]) -> void:
3232
for connection in node.connections:
3333
disconnect_node(connection.from_node, connection.from_port, connection.to_node, connection.to_port)
3434
node.removed.emit()
35-
elif node is GraphFrame:
35+
elif node is GaeaGraphFrame:
3636
for attached in get_attached_nodes_of_frame(node.name):
3737
attached_elements.erase(attached)
3838
node.queue_free()

addons/gaea/editor/node_popup.gd

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func populate(selected: Array) -> void:
3434
if graph_edit.attached_elements.has(node.name):
3535
add_item("Detach from Parent Frame", Action.DETACH)
3636
break
37-
if selected.front() is GraphFrame and selected.size() == 1:
37+
if selected.front() is GaeaGraphFrame and selected.size() == 1:
3838
add_separator()
3939
add_item("Rename Frame", Action.RENAME)
4040
add_check_item("Enable Auto Shrink", Action.ENABLE_AUTO_SHRINK)
@@ -67,54 +67,25 @@ func _on_id_pressed(id: int) -> void:
6767
Action.RENAME:
6868
var selected: Array = graph_edit.get_selected()
6969
var node: GraphElement = selected.front()
70-
if node is GraphFrame:
71-
var line_edit: LineEdit = LineEdit.new()
72-
line_edit.text = node.title
73-
line_edit.select_all()
74-
line_edit.expand_to_text_length = true
75-
line_edit.position = owner.get_local_mouse_position()
76-
line_edit.text_submitted.connect(node.set_title)
77-
line_edit.text_submitted.connect(line_edit.queue_free.unbind(1), CONNECT_DEFERRED)
78-
line_edit.focus_exited.connect(line_edit.queue_free)
79-
owner.add_child(line_edit)
80-
line_edit.grab_click_focus()
81-
line_edit.grab_focus()
70+
if node is GaeaGraphFrame:
71+
node.start_rename(owner)
8272

8373
Action.TINT:
8474
var selected: Array = graph_edit.get_selected()
8575
var node: GraphElement = selected.front()
86-
if node is GraphFrame:
87-
var _popup: PopupPanel = PopupPanel.new()
88-
_popup.position = owner.get_global_mouse_position() as Vector2i
89-
90-
var vbox_container: VBoxContainer = VBoxContainer.new()
91-
92-
var color_picker: ColorPicker = ColorPicker.new()
93-
color_picker.color_changed.connect(node.set_tint_color)
94-
color_picker.color = node.tint_color
95-
96-
var ok_button: Button = Button.new()
97-
ok_button.text = "OK"
98-
ok_button.pressed.connect(_popup.queue_free)
99-
100-
vbox_container.add_child(color_picker)
101-
vbox_container.add_child(ok_button)
102-
103-
_popup.add_child(vbox_container)
104-
105-
owner.add_child(_popup)
106-
_popup.popup()
76+
if node is GaeaGraphFrame:
77+
node.start_tint_color_change(owner)
10778
Action.ENABLE_TINT:
10879
set_item_checked(idx, not is_item_checked(idx))
10980
var selected: Array = graph_edit.get_selected()
11081
var node: GraphElement = selected.front()
111-
if node is GraphFrame:
82+
if node is GaeaGraphFrame:
11283
node.set_tint_color_enabled(is_item_checked(idx))
11384
Action.ENABLE_AUTO_SHRINK:
11485
set_item_checked(idx, not is_item_checked(idx))
11586
var selected: Array = graph_edit.get_selected()
11687
var node: GraphElement = selected.front()
117-
if node is GraphFrame:
88+
if node is GaeaGraphFrame:
11889
node.set_autoshrink_enabled(is_item_checked(idx))
11990
Action.DETACH:
12091
var selected: Array = graph_edit.get_selected()

addons/gaea/editor/panel.gd

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,12 @@ func _save_data() -> void:
158158
children.sort_custom(func(a: Node, b: Node): return a.name.naturalcasecmp_to(b.name) < 0)
159159
for child in children:
160160
if child is GaeaGraphNode:
161-
162161
resource_uids.append(ResourceUID.id_to_text(
163162
ResourceLoader.get_resource_uid(child.resource.get_script().get_path())
164163
))
165164
resources.append(child.resource)
166-
elif child is GraphFrame:
167-
other.get_or_add(&"frames", []).append(_get_frame_save_data(child))
165+
elif child is GaeaGraphFrame:
166+
other.get_or_add(&"frames", []).append(child.get_save_data())
168167

169168
for connection in connections:
170169
var from_node: GraphNode = _graph_edit.get_node(NodePath(connection.from_node))
@@ -187,19 +186,6 @@ func _save_data() -> void:
187186
EditorInterface.mark_scene_as_unsaved()
188187

189188

190-
func _get_frame_save_data(frame: GraphFrame) -> Dictionary[String, Variant]:
191-
return {
192-
&"title": frame.title,
193-
&"tint_color": frame.tint_color,
194-
&"tint_color_enabled": frame.tint_color_enabled,
195-
&"position": frame.position_offset,
196-
&"attached": _graph_edit.get_attached_nodes_of_frame(frame.name),
197-
&"size": frame.size,
198-
&"autoshrink": frame.autoshrink_enabled,
199-
&"name": frame.name
200-
}
201-
202-
203189

204190
func _load_data() -> void:
205191
is_loading = true
@@ -245,15 +231,9 @@ func _load_connections(connections: Array[Dictionary]) -> void:
245231

246232

247233
func _load_frame(frame_data: Dictionary) -> void:
248-
var new_frame: GraphFrame = GraphFrame.new()
249-
new_frame.title = frame_data.get(&"title", "Frame")
250-
new_frame.position_offset = frame_data.get(&"position", Vector2.ZERO)
251-
new_frame.size = frame_data.get(&"size", Vector2(64, 64))
252-
new_frame.tint_color = frame_data.get(&"tint_color", new_frame.tint_color)
253-
new_frame.tint_color_enabled = frame_data.get(&"tint_color_enabled", false)
254-
new_frame.name = frame_data.get_or_add(&"name", new_frame.name)
255-
new_frame.autoshrink_enabled = frame_data.get(&"autoshrink", true)
234+
var new_frame: GaeaGraphFrame = GaeaGraphFrame.new()
256235
_graph_edit.add_child(new_frame)
236+
new_frame.load_save_data(frame_data)
257237

258238

259239
func _load_node(resource: GaeaNodeResource, saved_data: Dictionary) -> GraphNode:
@@ -347,12 +327,9 @@ func _on_tree_node_selected_for_creation(resource: GaeaNodeResource) -> void:
347327
func _on_tree_special_node_selected_for_creation(id: StringName) -> void:
348328
match id:
349329
&"frame":
350-
var new_frame: GraphFrame = GraphFrame.new()
351-
new_frame.size = Vector2(512, 256)
330+
var new_frame: GaeaGraphFrame = GaeaGraphFrame.new()
352331
new_frame.set_position_offset((_graph_edit.get_local_mouse_position() + _graph_edit.scroll_offset) / _graph_edit.zoom)
353-
new_frame.title = "Frame"
354332
_graph_edit.add_child(new_frame)
355-
new_frame.name = new_frame.name.replace("@", "_")
356333
_save_data.call_deferred()
357334
_create_node_popup.hide()
358335

addons/gaea/graph/graph_nodes/generic_classes/constant.gd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,4 @@ func _get_overridden_output_port_idx(_output_name: StringName) -> int:
3434

3535

3636
func _get_data(output_port: StringName, area: AABB, graph: GaeaGraph) -> Variant:
37-
_log_data(output_port, graph)
3837
return _get_arg(&"value", area, graph)

addons/gaea/graph/graph_nodes/generic_classes/number_operation.gd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ func _get_output_port_display_name(_output_name: StringName) -> String:
129129

130130

131131

132-
func _get_data(output_port: StringName, _area: AABB, graph: GaeaGraph) -> Variant:
133-
_log_data(output_port, graph)
132+
func _get_data(_output_port: StringName, _area: AABB, graph: GaeaGraph) -> Variant:
134133
var operation: Operation = get_enum_selection(0) as Operation
135134
var args: Array
136135
for arg_name: StringName in OPERATION_DEFINITIONS[operation].args:

addons/gaea/graph/graph_nodes/generic_classes/parameter.gd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ func _get_output_port_type(_output_name: StringName) -> GaeaValue.Type:
6868
return GaeaValue.from_variant_type(_get_variant_type(), _get_property_hint(), _get_property_hint_string())
6969

7070

71-
func _get_data(output_port: StringName, area: AABB, graph: GaeaGraph) -> Variant:
72-
_log_data(output_port, graph)
71+
func _get_data(_output_port: StringName, area: AABB, graph: GaeaGraph) -> Variant:
7372
var data = graph.parameters.get(_get_arg(&"name", area, null))
7473
if data.has("value"):
7574
return data.get("value")

0 commit comments

Comments
 (0)