Files
aventuriers-des-mots/scenes/exercises/multiple_choice.gd
T
Denis Defolie 97a065879c Visual overhaul: theme, illustrations, redesigned screens (0.3.0)
Phase "habillage" of the post-0.1.0 plan. Rendering was reviewed on real
screenshots (new tools/screenshot.gd, `make screenshot`), which also
caught and fixed map markers overlapping and truncated titles.

- Global Godot theme (Atkinson Hyperlegible font, cream/green/gold
  palette, raised buttons, rounded cards, thick keyboard focus).
- Original vector art: forest/marsh backdrops, Plume the owl, stars,
  exercise-type icons, correct/try-again icons, 10 collection items.
- Redesigned world map (markers as cards with icon, title and stars,
  responsive layout), profile screens, mission intro, exercise host,
  rule/feedback panels, reward screen and collection grid.
- Motion helper (pop-in, fade) honouring an animations setting.
- Settings: animations flag; base window 1152x648 with canvas_items.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 22:36:43 +02:00

32 lines
1.0 KiB
GDScript

extends Control
## Exercice a choix multiple. Scene autonome : emet la reponse par signal,
## ne touche ni a la sauvegarde ni a la progression (invariant d'architecture,
## CLAUDE.md).
signal answer_submitted(selected_index: int)
@onready var _instruction_label: Label = %InstructionLabel
@onready var _question_label: Label = %QuestionLabel
@onready var _answers_box: VBoxContainer = %AnswersBox
func load_exercise(exercise: Dictionary) -> void:
_instruction_label.text = exercise["instruction"]
_question_label.text = exercise["question"]
for child in _answers_box.get_children():
child.queue_free()
var answers: Array = exercise["answers"]
for i in answers.size():
var button := Button.new()
button.text = answers[i]
button.custom_minimum_size = Vector2(0, 64)
button.add_theme_font_size_override("font_size", 28)
button.pressed.connect(_on_answer_pressed.bind(i))
_answers_box.add_child(button)
func _on_answer_pressed(index: int) -> void:
answer_submitted.emit(index)