Skip to content

Commit

Permalink
fixed button img
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed May 1, 2024
1 parent 2e782f6 commit f37a8cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
15 changes: 9 additions & 6 deletions Scenes/GenericGridItem.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ func _on_GenericGridItem_mouse_exited():

func _on_GenericGridItem_gui_input(event):
if event is InputEventMouseButton:
if event.pressed and event.button_index == BUTTON_LEFT:
if img_pressed:
$TextureRect.texture = img_pressed
emit_signal("pressed")
else:
$TextureRect.texture = img_normal
if event.button_index == BUTTON_LEFT:
if event.pressed == true:
if img_pressed:
$TextureRect.texture = img_pressed
emit_signal("pressed")
for i in 20:
yield(get_tree(),'idle_frame')
_on_GenericGridItem_mouse_exited()


func set_image_normal(setVal):
$TextureRect.texture = setVal
Expand Down
1 change: 0 additions & 1 deletion Scenes/PickSlabWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ func custom_slab_add_new_button():
id.connect("mouse_entered", self, "_on_hovered_over_item", [id])
id.connect("mouse_exited", self, "_on_hovered_none")
id.connect("pressed",self,"_on_pressed_add_new_custom_slab")
#id.connect('gui_input',self,"_on_slab_portrait_gui_input",[id])
id.rect_min_size = Vector2(grid_item_size.x * grid_window_scale, grid_item_size.y * grid_window_scale)

var tabID = tabs[Slabs.TAB_CUSTOM][GRIDCON_PATH]
Expand Down

0 comments on commit f37a8cb

Please sign in to comment.