Name popups *Popup and give scripts, scenes and classes matching names
Every popup is now called *Popup instead of *Window in its file, root node, node name, class and variable, and PopupWindow becomes BasePopup. Player is PlayerRow, SongListObject is SongRow and Character is CharacterCard. Script files are snake_case and scene files PascalCase, each matching its class or root node, and LightGrayTheme.tres is light_gray_theme.tres.
This commit is contained in:
1 parent
b7d67b573e
commit
390da577d7
78 files changed
+281
-258
No files matched your search
@@ -0,0 +1,26 @@
|
||||
class_name LogPopup
|
||||
extends BasePopup
|
||||
|
||||
@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]
|
||||
Reference in new issue
Block a user