From 3e4605d07c75bca96ce6832df7141b7b758b20cf Mon Sep 17 00:00:00 2001 From: domi41 Date: Wed, 12 Aug 2020 22:35:20 +0200 Subject: [PATCH] feat: allow exiting a poll with ESCAPE --- .../nodes/MajorityJudgmentLinearResultsControl.gd | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd b/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd index bc8c849..2e7bd16 100644 --- a/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd +++ b/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd @@ -18,6 +18,19 @@ onready var ProfilesContainer = find_node("ProfilesContainer", true) var provider:MajorityJudgmentAbstractJudgmentsProvider +func _input(_event): + if Input.is_action_just_pressed("ui_cancel"): + exit_poll() + + +func exit_poll(): + # Check if we want to save or discard? + # … + # Close things up +# stop_providers() + App.go_to_main_menu() + + func get_poll() -> MajorityJudgmentPoll: return poll