From 3ab70a861b891d280912536e37e93d3710dbb85c Mon Sep 17 00:00:00 2001 From: RodZill4 Date: Tue, 28 Jan 2020 23:11:27 +0100 Subject: [PATCH] Fixed problem with preview buttons in nodes --- material_maker/nodes/generic.gd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/material_maker/nodes/generic.gd b/material_maker/nodes/generic.gd index 98290d6..3d93986 100644 --- a/material_maker/nodes/generic.gd +++ b/material_maker/nodes/generic.gd @@ -355,7 +355,12 @@ func update_preview_buttons(index : int) -> void: var line = get_child(i) line.get_child(line.get_child_count()-1).pressed = false +var processing_button = false + func on_preview_button(pressed : bool, index : int) -> void: + if processing_button: + return + processing_button = true if pressed: preview_index = index var width @@ -371,6 +376,7 @@ func on_preview_button(pressed : bool, index : int) -> void: preview.visible = false remove_child(preview) rect_size = Vector2(0, 0) + processing_button = false func update_preview(size : int = 0) -> void: if preview_index == -1: