Popups: - All nine popups now extend a shared PopupWindow class with open(), close() and toggle(), instead of each copying its own close-on-click code. Popups that need cleanup override close(). - A click outside a popup closed it and also pressed whatever was underneath, e.g. Reset playlist. The closing click is now consumed. - Popups used Godot's see-through default panel, so the song list and titles showed through. They now use an opaque popup theme, and a backdrop dims the window behind them. - The main window root now fills the screen, so the backdrop covers it. Text and images: - Many labels and buttons forced nearest filtering, which made text and icons jagged when the window is not 1920x1080. They now use the default smooth filtering. Only the pixel-art "no character" picture keeps nearest filtering when the winner window enlarges it. Player list: - A long player name pushed that row's character and buttons to the right. Names now take the free space and shorten with an ellipsis, so all rows line up and use the full width of the panel.
26 lines
673 B
GDScript
26 lines
673 B
GDScript
extends PopupWindow
|
|
|
|
@onready
|
|
var log_panel: Panel = %LogPanel
|
|
|
|
@onready
|
|
var log_box: VBoxContainer = %LogVBoxContainer
|
|
|
|
var log_rows: Array
|
|
|
|
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]
|