Make the music list, player list and inspiration list their own scenes
MusicListPanel, PlayersPanel (was Players) and InspirationList (was ScrollContainer) each get their own scene and script. They report what happens through signals, and the quiz wires them to the playlist, the music player, the log and the popups. Every node keeps its place on screen. Screenshots of every UI state are pixel-identical to before, the layout test still matches the original baseline, and each part is tested on its own as well as through the quiz.
This commit is contained in:
1 parent
3c7b4e5c9d
commit
8c1987807c
24 files changed
+932
-466
No files matched your search
@@ -179,11 +179,14 @@ func _node(node_name: String) -> Node:
|
||||
return null
|
||||
|
||||
|
||||
## Calls [param method] on the main window, or on its Quiz scene if that has it.
|
||||
## Calls [param method] on the players panel, the quiz or the main window, whichever
|
||||
## has it first.
|
||||
func _call(method: String, args: Array = []) -> Variant:
|
||||
var quiz: Node = _main.get_node_or_null("Quiz")
|
||||
var target: Node = quiz if quiz != null && quiz.has_method(method) else _main
|
||||
return target.callv(method, args)
|
||||
for path: String in ["Quiz/PlayersPanel", "Quiz"]:
|
||||
var target: Node = _main.get_node_or_null(path)
|
||||
if target != null && target.has_method(method):
|
||||
return target.callv(method, args)
|
||||
return _main.callv(method, args)
|
||||
|
||||
|
||||
func _server() -> FakeHttpTransport:
|
||||
@@ -196,13 +199,13 @@ func _settle() -> void:
|
||||
|
||||
|
||||
func _add_player(player_name: String) -> void:
|
||||
(_node("Players").get_node("VBoxContainer/AddPlayerContainer/PlayerNameField") \
|
||||
(_node("PlayersPanel").get_node("VBoxContainer/AddPlayerContainer/PlayerNameField") \
|
||||
as TextEdit).text = player_name
|
||||
_call("add_player")
|
||||
|
||||
|
||||
func _player_row(index: int) -> Player:
|
||||
return _node("Players").get_node(
|
||||
return _node("PlayersPanel").get_node(
|
||||
"VBoxContainer/ScrollContainer/PlayersListVBoxContainer").get_child(index)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user