Give every script a class name and use it for typed references
The popups, the volume slider, the player name field and the main window get a class_name, so the main window and the quiz hold them by their real type instead of Control. The classes already use the names the files will get.
This commit is contained in:
1 parent
5831e1e73d
commit
b7d67b573e
15 files changed
+23
-10
No files matched your search
+7
-6
@@ -1,3 +1,4 @@
|
||||
class_name MainWindow
|
||||
extends Control
|
||||
## The main window: the top bar, the popups opened from it and the quiz below it.
|
||||
##
|
||||
@@ -11,22 +12,22 @@ var top_bar: TopBar = $TopBar
|
||||
var quiz: Quiz = $Quiz
|
||||
|
||||
@onready
|
||||
var search_view: Control = $Search
|
||||
var search_view: SearchPopup = $Search
|
||||
|
||||
@onready
|
||||
var sync_window: Control = %SyncWindow
|
||||
var sync_window: SyncPopup = %SyncWindow
|
||||
|
||||
@onready
|
||||
var shortcuts_window: Control = %ShortcutsWindow
|
||||
var shortcuts_window: ShortcutsPopup = %ShortcutsWindow
|
||||
|
||||
@onready
|
||||
var qr_window: Control = %QRWindow
|
||||
var qr_window: QRPopup = %QRWindow
|
||||
|
||||
@onready
|
||||
var about_window: Control = %AboutWindow
|
||||
var about_window: AboutPopup = %AboutWindow
|
||||
|
||||
@onready
|
||||
var log_window: Control = %Log
|
||||
var log_window: LogPopup = %Log
|
||||
|
||||
@onready
|
||||
var statistic_popup: PopupPanel = $StatisticsPopupPanel
|
||||
|
||||
Reference in new issue
Block a user