main/ holds the main window and top bar, quiz/ the quiz and its parts, player/ the music player, popups/ every popup and what they share, data/ the songs, players, playlist and settings, server/ the MusicServer client, common/ the list row and GameLog, and themes/ the themes and style boxes.
29 lines
827 B
GDScript
29 lines
827 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.add_theme_font_size_override("font_size", 20)
|
|
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]
|