Make the buttons consistent and rework the player list
Buttons get 12 px of side padding. The top bar buttons, the quiz toolbar and Show answer/Next are laid out in rows with 12 px gaps and are all 36 px tall, and the ±1 buttons use a compact StepButton style. "Randomize new track" is now "Next song". Player rows show the name and the score apart, alternate like the other lists and highlight the character under the mouse. The name field is a LineEdit with a 10-letter limit; blank and duplicate names are refused, and a full list says "Up to 7 players". Remove buttons update when editing is switched instead of every frame, and the spacer panels are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e4352a9f34
commit
70e970b24c
39 files changed
+2054
-2177
No files matched your search
@@ -48,6 +48,8 @@ func before_test() -> void:
|
||||
_runner = scene_runner("res://main/MainWindow.tscn")
|
||||
_window = _runner.scene()
|
||||
_quiz = _window.get_node("Quiz")
|
||||
# Rows of buttons are laid out by their containers at the end of the first frame
|
||||
await _runner.simulate_frames(1)
|
||||
|
||||
|
||||
## Override to change the fake server before the window starts and sends its first
|
||||
@@ -82,7 +84,7 @@ func _play_first_song() -> void:
|
||||
|
||||
## Adds a player through the name field, the same way the user does.
|
||||
func _add_player(player_name: String) -> PlayerObject:
|
||||
var name_field: TextEdit = _quiz.get_node(
|
||||
var name_field: LineEdit = _quiz.get_node(
|
||||
"PlayersPanel/VBoxContainer/AddPlayerContainer/PlayerNameField")
|
||||
name_field.text = player_name
|
||||
_quiz.players_panel.add_player()
|
||||
@@ -101,7 +103,7 @@ func _player_row(player_object: PlayerObject) -> PlayerRow:
|
||||
|
||||
## Removes a player with the remove button in its row.
|
||||
func _remove_player(player_object: PlayerObject) -> void:
|
||||
(_player_row(player_object).get_node("HBoxContainer/RemovePlayer") as BaseButton) \
|
||||
(_player_row(player_object).get_node("%RemovePlayer") as BaseButton) \
|
||||
.pressed.emit()
|
||||
await _runner.simulate_frames(1)
|
||||
|
||||
|
||||
Reference in new issue
Block a user