complete page_3 and setup game menu tabs
This commit is contained in:
28
core/game_menu/game_menu_tab.gd
Normal file
28
core/game_menu/game_menu_tab.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
@tool
|
||||
extends Control
|
||||
|
||||
class_name GameMenuTab
|
||||
|
||||
signal on_tab_selected(index: int)
|
||||
|
||||
@export var index: int = 0
|
||||
@export var image: Texture:
|
||||
set(value):
|
||||
image = value
|
||||
if is_inside_tree() and has_node("%Texture"):
|
||||
$%Texture.texture_normal = image
|
||||
|
||||
var is_selected: bool = false
|
||||
|
||||
func _ready():
|
||||
if image != null and has_node("%Texture"):
|
||||
$%Texture.texture_normal = image
|
||||
|
||||
func _on_texture_pressed() -> void:
|
||||
on_tab_selected.emit(index)
|
||||
|
||||
func select():
|
||||
is_selected = true
|
||||
|
||||
func deselect():
|
||||
is_selected = false
|
||||
Reference in New Issue
Block a user