Skip to content
Open
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions material_maker/nodes/base.gd
Original file line number Diff line number Diff line change
Expand Up @@ -538,3 +538,19 @@ func finalize_generator_update() -> void:
get_parent().undoredo_create_step("Edit node", generator.get_parent().get_hier_name(), edit_generator_prev_state, edit_generator_next_state)
edit_generator_prev_state = {}
edit_generator_next_state = {}

func _process(_delta: float) -> void:
# Disable node controls when zoomed out
const simplified_zoom = 0.3
var is_simplified : bool = get_parent().zoom <= simplified_zoom
var control_nodes : Array[Node]
for c in get_children():
if c is Container:
control_nodes.append_array(c.get_children())
elif c is not Label:
control_nodes.append(c)
for control in control_nodes:
if control.get_script() != null or control is BaseButton:
control.mouse_filter = MOUSE_FILTER_IGNORE if is_simplified else MOUSE_FILTER_STOP
if control is GradientEdit:
control.get_child(0).visible = not is_simplified
2 changes: 2 additions & 0 deletions material_maker/nodes/tones/tones.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class Cursor:
draw_polyline(polygon, Color(outline_color, outline_color, outline_color), 1.0, true)

func _gui_input(ev) -> void:
if get_parent().modulate.a == 0.0:
return
if ev is InputEventMouseMotion && (ev.button_mask & 1) != 0:
position.x += ev.relative.x
position.x = min(max(-0.5*WIDTH, position.x), get_parent().size.x-0.5*WIDTH)
Expand Down
2 changes: 2 additions & 0 deletions material_maker/widgets/gradient_editor/gradient_edit.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
extends PanelContainer

class_name GradientEdit

# Emitted whenever the gradient changed
signal updated(value, merge_undos:bool)
# Emitted whenever the active cursor index changed
Expand Down
1 change: 1 addition & 0 deletions material_maker/widgets/gradient_editor/gradient_edit.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ code = "shader_type canvas_item;"
shader = SubResource("Shader_786ke")

[node name="GradientEdit" type="PanelContainer"]
custom_minimum_size = Vector2(0, 25)
offset_right = 351.0
offset_bottom = 42.0
focus_mode = 2
Expand Down
1 change: 1 addition & 0 deletions material_maker/widgets/histogram/histogram.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,4 @@ material = SubResource("12")
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 1