Cover menu in the soundtrack popup ("Change cover"):
- Choose picture uploads a JPEG, PNG or WebP picture (up to 10 MB).
- Pick by ID uses a game's cover on SteamGridDB or an anime's on AniList.
- Remove cover deletes it, so the server searches for a new one.
- The server's reason is shown when it refuses a change.
After a change the new cover time is fetched, and the popup, the
statistics card and the quiz show the new cover.
Quiz: once the answer is shown, the soundtrack's cover shows to the left of
the titles. Cover and titles are centered together, left and right and up
and down, and each title keeps to two lines. Cover times come from the
soundtrack list, and songs keep their soundtrack's UUID, also in saves.
Requests can now send any body with its content type, and every 2xx answer
counts as success. Cover frames are 2:3 like the server's covers. Small
copies of real covers are used by the tests and screenshots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
1.6 KiB
GDScript
48 lines
1.6 KiB
GDScript
extends GdUnitTestSuite
|
|
## The soundtrack and song shown at the top of the quiz.
|
|
|
|
var _runner: GdUnitSceneRunner
|
|
var _now_playing: NowPlaying
|
|
|
|
|
|
func before_test() -> void:
|
|
_runner = scene_runner("res://quiz/NowPlaying.tscn")
|
|
_now_playing = _runner.scene()
|
|
|
|
|
|
func _label(label_name: String) -> Label:
|
|
return _now_playing.get_node("Titles/" + label_name)
|
|
|
|
|
|
func test_starts_empty() -> void:
|
|
assert_str(_label("SoundtrackLabel").text).is_empty()
|
|
assert_str(_label("SongLabel").text).is_empty()
|
|
|
|
|
|
func test_show_song_shows_soundtrack_and_song() -> void:
|
|
_now_playing.show_song("Chrono Trigger", "Corridors of Time")
|
|
|
|
assert_str(_label("SoundtrackLabel").text).is_equal("Chrono Trigger")
|
|
assert_str(_label("SongLabel").text).is_equal("Corridors of Time")
|
|
|
|
|
|
func test_soundtrack_is_above_song() -> void:
|
|
_now_playing.show_song("Chrono Trigger", "Corridors of Time")
|
|
await _runner.simulate_frames(1)
|
|
|
|
assert_float(_label("SoundtrackLabel").get_global_rect().end.y) \
|
|
.is_less_equal(_label("SongLabel").get_global_rect().position.y)
|
|
|
|
|
|
func test_long_titles_keep_to_two_lines_each() -> void:
|
|
_now_playing.size = Vector2(1088, 328)
|
|
_now_playing.show_song("Final Fantasy Dissidia 012 Duodecim (Sista Fantasin "
|
|
+ "Meningsskiljaktigheter 012 Tolv) Final Mix Special Edition",
|
|
"Cosmos (Arrangement) - Main Theme of the Warriors of Light, Long Version")
|
|
await _runner.simulate_frames(2)
|
|
|
|
for label_name: String in ["SoundtrackLabel", "SongLabel"]:
|
|
assert_int(_label(label_name).get_visible_line_count()).is_less_equal(2)
|
|
assert_float(_label("SongLabel").get_global_rect().end.y) \
|
|
.is_less_equal(_now_playing.get_global_rect().end.y)
|