Skip to content

Commit f37a8cb

Browse files
committed
fixed button img
1 parent 2e782f6 commit f37a8cb

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Scenes/GenericGridItem.gd

+9-6
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ func _on_GenericGridItem_mouse_exited():
3333

3434
func _on_GenericGridItem_gui_input(event):
3535
if event is InputEventMouseButton:
36-
if event.pressed and event.button_index == BUTTON_LEFT:
37-
if img_pressed:
38-
$TextureRect.texture = img_pressed
39-
emit_signal("pressed")
40-
else:
41-
$TextureRect.texture = img_normal
36+
if event.button_index == BUTTON_LEFT:
37+
if event.pressed == true:
38+
if img_pressed:
39+
$TextureRect.texture = img_pressed
40+
emit_signal("pressed")
41+
for i in 20:
42+
yield(get_tree(),'idle_frame')
43+
_on_GenericGridItem_mouse_exited()
44+
4245

4346
func set_image_normal(setVal):
4447
$TextureRect.texture = setVal

Scenes/PickSlabWindow.gd

-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ func custom_slab_add_new_button():
138138
id.connect("mouse_entered", self, "_on_hovered_over_item", [id])
139139
id.connect("mouse_exited", self, "_on_hovered_none")
140140
id.connect("pressed",self,"_on_pressed_add_new_custom_slab")
141-
#id.connect('gui_input',self,"_on_slab_portrait_gui_input",[id])
142141
id.rect_min_size = Vector2(grid_item_size.x * grid_window_scale, grid_item_size.y * grid_window_scale)
143142

144143
var tabID = tabs[Slabs.TAB_CUSTOM][GRIDCON_PATH]

0 commit comments

Comments
 (0)