Skip to content

Minimize nodes with H key #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions material_maker/panels/graph_edit/graph_edit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ func _gui_input(event) -> void:
if event.pressed:
var scancode_with_modifiers = event.get_keycode_with_modifiers()
match scancode_with_modifiers:
KEY_H:
minimize_selection()
KEY_DELETE,KEY_BACKSPACE:
remove_selection()
KEY_LEFT:
Expand Down Expand Up @@ -668,6 +670,11 @@ func remove_selection() -> void:
var next = generator.serialize()
undoredo_create_step("Delete nodes", generator.get_hier_name(), prev, next)

func minimize_selection() -> void:
for c in get_children():
if c is GraphElement and c.selected:
c.on_minimize_pressed()

# Maybe move this to gen_graph...
func serialize_selection(nodes = []) -> Dictionary:
var data = { nodes = [], connections = [] }
Expand Down