Sort the scripts and scenes into folders
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.
This commit is contained in:
1 parent
a0428e3475
commit
d77b72159d
115 files changed
+94
-84
No files matched your search
@@ -15,7 +15,7 @@ func before_test() -> void:
|
||||
Settings.inspiration_list_speed = 0
|
||||
_server = FakeHttpTransport.new().install()
|
||||
_server.respond_json("/music/all", SOUNDTRACKS)
|
||||
_runner = scene_runner("res://InspirationList.tscn")
|
||||
_runner = scene_runner("res://quiz/InspirationList.tscn")
|
||||
_list = _runner.scene()
|
||||
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ func before() -> void:
|
||||
viewport.size = Vector2i(1920, 1080)
|
||||
viewport.gui_embed_subwindows = true
|
||||
Engine.get_main_loop().root.add_child(viewport)
|
||||
_main = load("res://MainWindow.tscn").instantiate()
|
||||
_main = load("res://main/MainWindow.tscn").instantiate()
|
||||
viewport.add_child(_main)
|
||||
await UiTour.new(_main).run(func(state: String, popup: Node) -> void:
|
||||
_layout[state] = UiTour.dump_layout(_main, _main if popup == null else popup))
|
||||
|
||||
@@ -17,7 +17,7 @@ func before_test() -> void:
|
||||
song.song_title = "Song %d" % i
|
||||
song.has_played = true
|
||||
Playlist.add_to_playlist(song)
|
||||
_runner = scene_runner("res://MusicListPanel.tscn")
|
||||
_runner = scene_runner("res://quiz/MusicListPanel.tscn")
|
||||
_panel = _runner.scene()
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ var _player: MusicPlayer
|
||||
func before_test() -> void:
|
||||
_snapshot = AutoloadSnapshot.take([Settings])
|
||||
Settings.auto_repeat_song = true
|
||||
_runner = scene_runner("res://MusicPlayer.tscn")
|
||||
_runner = scene_runner("res://player/MusicPlayer.tscn")
|
||||
_player = _runner.scene()
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ var _now_playing: NowPlaying
|
||||
|
||||
|
||||
func before_test() -> void:
|
||||
_runner = scene_runner("res://NowPlaying.tscn")
|
||||
_runner = scene_runner("res://quiz/NowPlaying.tscn")
|
||||
_now_playing = _runner.scene()
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ func before_test() -> void:
|
||||
_snapshot = AutoloadSnapshot.take([Settings])
|
||||
Settings.player_array.clear()
|
||||
Settings.edit_players = false
|
||||
_runner = scene_runner("res://PlayersPanel.tscn")
|
||||
_runner = scene_runner("res://quiz/PlayersPanel.tscn")
|
||||
_panel = _runner.scene()
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ var _toolbar: QuizToolbar
|
||||
|
||||
|
||||
func before_test() -> void:
|
||||
_runner = scene_runner("res://QuizToolbar.tscn")
|
||||
_runner = scene_runner("res://quiz/QuizToolbar.tscn")
|
||||
_toolbar = _runner.scene()
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,17 @@ const MAIN_WINDOW_CHILDREN: Array[String] = [
|
||||
"ShortcutsPopup", "StatisticsPopupPanel", "AboutPopup", "LogPopup",
|
||||
]
|
||||
|
||||
## The parts of the quiz and the scene each one comes from.
|
||||
const QUIZ_PART_SCENES: Dictionary = {
|
||||
"MusicListPanel": "res://quiz/MusicListPanel.tscn",
|
||||
"PlayersPanel": "res://quiz/PlayersPanel.tscn",
|
||||
"InspirationList": "res://quiz/InspirationList.tscn",
|
||||
"NowPlaying": "res://quiz/NowPlaying.tscn",
|
||||
"QuizToolbar": "res://quiz/QuizToolbar.tscn",
|
||||
"SongControls": "res://quiz/SongControls.tscn",
|
||||
"MusicPlayer": "res://player/MusicPlayer.tscn",
|
||||
}
|
||||
|
||||
## The quiz buttons that are disabled while the server syncs.
|
||||
const LOCKED_BY_SYNC: Array[String] = [
|
||||
"QuizToolbar/SoundTestButton", "QuizToolbar/ResetPlaylistButton",
|
||||
@@ -57,10 +68,9 @@ func test_top_bar_is_drawn_below_the_quiz() -> void:
|
||||
|
||||
|
||||
func test_quiz_parts_are_their_own_scenes() -> void:
|
||||
for node_name: String in ["MusicListPanel", "PlayersPanel", "InspirationList",
|
||||
"NowPlaying", "QuizToolbar", "SongControls", "MusicPlayer"]:
|
||||
for node_name: String in QUIZ_PART_SCENES:
|
||||
assert_str(_quiz.get_node(node_name).scene_file_path) \
|
||||
.is_equal("res://%s.tscn" % node_name)
|
||||
.is_equal(QUIZ_PART_SCENES[node_name])
|
||||
|
||||
|
||||
func test_quiz_downloads_songs_with_a_song_loader() -> void:
|
||||
|
||||
@@ -7,7 +7,7 @@ var _controls: SongControls
|
||||
|
||||
|
||||
func before_test() -> void:
|
||||
_runner = scene_runner("res://SongControls.tscn")
|
||||
_runner = scene_runner("res://quiz/SongControls.tscn")
|
||||
_controls = _runner.scene()
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ func before_test() -> void:
|
||||
Settings.currently_syncing = false
|
||||
_server = FakeHttpTransport.new().install()
|
||||
_server.respond_bytes("/sync", PackedByteArray())
|
||||
_runner = scene_runner("res://SyncPopup.tscn")
|
||||
_runner = scene_runner("res://popups/SyncPopup.tscn")
|
||||
_window = _runner.scene()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user