mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
added the game
This commit is contained in:
22
Scripts/UI/SelectableOptionButton.gd
Normal file
22
Scripts/UI/SelectableOptionButton.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
extends HBoxContainer
|
||||
|
||||
@export var title := ""
|
||||
@export var selected := false
|
||||
|
||||
signal button_pressed
|
||||
|
||||
var selected_index := 0
|
||||
|
||||
@export var press_sfx := "beep"
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if selected:
|
||||
handle_inputs()
|
||||
$Cursor.modulate.a = int(selected)
|
||||
$Title.text = tr(title)
|
||||
|
||||
func handle_inputs() -> void:
|
||||
if Input.is_action_just_pressed("ui_accept"):
|
||||
button_pressed.emit()
|
||||
if press_sfx != "":
|
||||
AudioManager.play_global_sfx(press_sfx)
|
Reference in New Issue
Block a user