#
#  Ham'n'Cheese
#  Copyright (C) 2023-2024 Scott Duensing <scott@kangaroopunch.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>
#


extends Control


signal _disclaimer_closed


@onready var disclaimer_window = %DisclaimerWindow


var _result = false


func _on_disclaimer_window_close_requested():
	_result = false
	_disclaimer_closed.emit()


func _on_button_pressed():
	_result = true
	_disclaimer_closed.emit()


func show_disclaimer():
	# ***DEBUG*** Is not modal on Windows!
	Disclaimer.disclaimer_window.visible = true
	Disclaimer.disclaimer_window.move_to_center()
	await _disclaimer_closed
	Disclaimer.disclaimer_window.visible = false
	return _result
