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
@@ -58,7 +58,7 @@ func test_adding_a_name_adds_a_player_and_a_row() -> void:
|
||||
assert_str(crono.player_name).is_equal("Crono")
|
||||
await signals.is_emitted("player_added", [crono])
|
||||
assert_str(_panel.new_player_name_field.text).is_empty()
|
||||
assert_object((_rows()[0] as Player).player_object).is_same(crono)
|
||||
assert_object((_rows()[0] as PlayerRow).player_object).is_same(crono)
|
||||
|
||||
|
||||
func test_add_button_in_the_row_adds_the_player() -> void:
|
||||
@@ -105,9 +105,9 @@ func test_rows_follow_player_order_and_numbering() -> void:
|
||||
_add("Marle")
|
||||
_add("Lucca")
|
||||
|
||||
assert_array(_rows().map(func(row: Player) -> String: return row.player_object.player_name)) \
|
||||
assert_array(_rows().map(func(row: PlayerRow) -> String: return row.player_object.player_name)) \
|
||||
.contains_exactly(["Crono", "Marle", "Lucca"])
|
||||
assert_array(_rows().map(func(row: Player) -> int: return row.list_index)) \
|
||||
assert_array(_rows().map(func(row: PlayerRow) -> int: return row.list_index)) \
|
||||
.contains_exactly([0, 1, 2])
|
||||
|
||||
|
||||
@@ -123,12 +123,12 @@ func test_remove_button_removes_the_player_and_row() -> void:
|
||||
assert_array(Settings.player_array.map(
|
||||
func(p: PlayerObject) -> String: return p.player_name)).contains_exactly(["Marle"])
|
||||
assert_int(_rows().size()).is_equal(1)
|
||||
assert_int((_rows()[0] as Player).list_index).is_equal(0)
|
||||
assert_int((_rows()[0] as PlayerRow).list_index).is_equal(0)
|
||||
|
||||
|
||||
func test_character_button_asks_for_a_new_character() -> void:
|
||||
_add("Crono")
|
||||
var row: Player = _rows()[0]
|
||||
var row: PlayerRow = _rows()[0]
|
||||
var signals: GdUnitSignalAssert = assert_signal(monitor_signals(_panel))
|
||||
|
||||
(row.get_node("HBoxContainer/Character") as BaseButton).pressed.emit()
|
||||
@@ -142,5 +142,5 @@ func test_reload_shows_new_scores() -> void:
|
||||
|
||||
_panel.reload()
|
||||
|
||||
assert_str(((_rows()[0] as Player).get_node("HBoxContainer/Name") as Label).text) \
|
||||
assert_str(((_rows()[0] as PlayerRow).get_node("HBoxContainer/Name") as Label).text) \
|
||||
.ends_with("Crono: 3")
|
||||
Reference in new issue
Block a user