themes/main_theme.tres is the project theme. It holds Godot's default look for every control type the game uses, plus named styles for the game's own look (popups, the background, spacers, list rows, title and text sizes, highlights) and a palette for the popup dimming. Scenes and scripts name these styles instead of setting colours, sizes or style boxes, and the five old theme files are gone. themes/README.md explains the styles and how to make a new theme. The screenshot tour now uses the real character pictures, so the layout baseline is taken again. Screenshots are pixel-identical to before, and test_theme.gd checks that the look stays in the theme.
29 lines
817 B
GDScript
29 lines
817 B
GDScript
class_name LogPopup
|
|
extends BasePopup
|
|
## The game log: a row with the time for each thing that happens in the quiz, such as a
|
|
## player getting a point. Opened with Alt+L.
|
|
|
|
var log_rows: Array
|
|
|
|
@onready var log_panel: Panel = %LogPanel
|
|
@onready var log_box: VBoxContainer = %LogVBoxContainer
|
|
|
|
|
|
func add_log_row(text: String) -> void:
|
|
var log_row: String = get_time() + text
|
|
log_rows.append(log_row)
|
|
log_box.add_child(make_log_label(log_row))
|
|
|
|
|
|
func make_log_label(row: String) -> Label:
|
|
var log_label: Label = Label.new()
|
|
log_label.theme_type_variation = &"TextLarge"
|
|
log_label.text = row
|
|
log_label.autowrap_mode = TextServer.AUTOWRAP_WORD
|
|
return log_label
|
|
|
|
|
|
func get_time() -> String:
|
|
var time: Dictionary = Time.get_time_dict_from_system()
|
|
return "%02d:%02d:%02d " % [time.hour, time.minute, time.second]
|