cawez_puzzlebox/ui/about.gd

24 lines
656 B
GDScript

extends TextureButton
func _ready():
pressed.connect(self._button_pressed)
var was_hovered = false
func _process(delta):
if is_hovered() && !was_hovered:
Sounds.get_node("hover").play()
was_hovered = is_hovered()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _button_pressed():
if (Input.mouse_mode != Input.MOUSE_MODE_CAPTURED):
Sounds.get_node("click").play()
if OS.get_name() == "Linux":
OS.execute("xdg-open", ["https://hiraeth.cawez.ca"])
elif OS.get_name() == "Windows":
OS.execute("CMD.exe", ["/C", "start https://hiraeth.cawez.ca"])
else:
OS.shell_open("https://cawez.ca/hiraeth")