57 lines
1.6 KiB
GDScript
57 lines
1.6 KiB
GDScript
extends Node3D
|
|
|
|
var current_question = 0
|
|
var audio_playing = true
|
|
@onready var quiz_modules = [$quiz_module, $quiz_module2, $quiz_module3]
|
|
|
|
func _ready() -> void:
|
|
DialogueManager.dialogue_ended.connect(_on_dialogue_ended)
|
|
DialogueManager.show_chosen_dialogue_balloon(load("res://Interact/dialogue/quiz_explainer.dialogue"), "/game_balloons/game_balloon_v_4.tscn", "start")
|
|
|
|
|
|
func _on_pressure_block_activated() -> void:
|
|
Transition.change_scene("res://flight_back.tscn")
|
|
|
|
|
|
func _on_quiz_module_question_answered() -> void:
|
|
quiz_modules[current_question].question_panel.visible = false
|
|
await get_tree().create_timer(2.0).timeout
|
|
current_question += 1
|
|
if current_question < len(quiz_modules):
|
|
quiz_modules[current_question].set_question()
|
|
|
|
func _on_dialogue_ended(_resource: DialogueResource) -> void:
|
|
quiz_modules[current_question].set_question()
|
|
$AudioStreamPlayer.volume_db = -10.0
|
|
|
|
func openLinkinBrowser(link):
|
|
OS.shell_open(link)
|
|
|
|
func openAIActinBrowser():
|
|
openLinkinBrowser("https://eur-lex.europa.eu/legal-content/DE/TXT/?uri=CELEX:32024R1689")
|
|
|
|
func openDSGVOinBrowser():
|
|
openLinkinBrowser("https://dsgvo-gesetz.de/")
|
|
|
|
|
|
func _on_player_chatbot_opened() -> void:
|
|
quiz_modules[current_question].question_panel.visible = false
|
|
|
|
func _on_chatbot_closing_chatbot() -> void:
|
|
quiz_modules[current_question].question_panel.visible = true
|
|
|
|
func quiet_down_music() -> void:
|
|
$AudioStreamPlayer.volume_db = -20.0
|
|
|
|
func reset_music_volume() -> void:
|
|
$AudioStreamPlayer.volume_db = -10.0
|
|
|
|
|
|
func toggle_music() -> void:
|
|
if not audio_playing:
|
|
audio_playing = true
|
|
$AudioStreamPlayer.play()
|
|
else:
|
|
$AudioStreamPlayer.stop()
|
|
audio_playing = false
|