a game about throwing hammers made for the github game off
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
extends Control
class_name Popuppable

const RemapButton := preload("res://addons/remap/RemapButton.gd")

signal close

@export var focus: Control

func open() -> void:
  show()
  if focus is RemapButton:
    focus.button.grab_focus()
  else:
    focus.grab_focus()

func _unhandled_input(event: InputEvent) -> void:
  if visible and event.is_action("ui_cancel"):
    accept_event()
    exit()

func exit() -> void:
  close.emit()
  hide()