Put the whole look into one project theme
themes/main_theme.tres is the project theme. It holds Godot's default look for every control type the game uses, plus named styles for the game's own look (popups, the background, spacers, list rows, title and text sizes, highlights) and a palette for the popup dimming. Scenes and scripts name these styles instead of setting colours, sizes or style boxes, and the five old theme files are gone. themes/README.md explains the styles and how to make a new theme. The screenshot tour now uses the real character pictures, so the layout baseline is taken again. Screenshots are pixel-identical to before, and test_theme.gd checks that the look stays in the theme.
This commit was merged in pull request #36.
This commit is contained in:
1 parent
a7bf38c5f9
commit
8b71723a34
39 files changed
+3283
-1869
No files matched your search
+22
-1
@@ -27,6 +27,9 @@ const SYNC_RESULT: Dictionary = {
|
||||
"total_time": "00:00:03",
|
||||
}
|
||||
|
||||
## The character pictures the fake server hands out.
|
||||
const CHARACTERS_DIR: String = "res://characters"
|
||||
|
||||
## Popups in the order the tour opens them: the state name, then the popup's node. The
|
||||
## state names are what the popups were first called, so screenshots taken before they
|
||||
## were renamed can still be compared with new ones.
|
||||
@@ -53,7 +56,11 @@ static func make_server() -> FakeHttpTransport:
|
||||
server.respond_json("/music/all", SOUNDTRACKS)
|
||||
server.respond_json("/music/all/order", SOUNDTRACKS)
|
||||
server.respond_json("/music/list", [])
|
||||
server.respond_json("/characters", [])
|
||||
var characters: Array[String] = character_names()
|
||||
server.respond_json("/characters", characters)
|
||||
for character_name: String in characters:
|
||||
server.respond_bytes("/character?name=" + character_name.uri_encode(),
|
||||
FileAccess.get_file_as_bytes(CHARACTERS_DIR.path_join(character_name)))
|
||||
server.respond_bytes("/music/rand", mp3)
|
||||
server.respond_bytes("/music/addQue", PackedByteArray())
|
||||
server.respond_json("/music/info", SONG_INFO)
|
||||
@@ -64,6 +71,16 @@ static func make_server() -> FakeHttpTransport:
|
||||
return server
|
||||
|
||||
|
||||
## The pictures in [constant CHARACTERS_DIR], sorted by name.
|
||||
static func character_names() -> Array[String]:
|
||||
var names: Array[String] = []
|
||||
for file_name: String in DirAccess.get_files_at(CHARACTERS_DIR):
|
||||
if file_name.ends_with(".png"):
|
||||
names.append(file_name)
|
||||
names.sort()
|
||||
return names
|
||||
|
||||
|
||||
## Puts Settings and Playlist in the state the tour expects. Call it before the main
|
||||
## window is created.
|
||||
static func prepare_autoloads() -> void:
|
||||
@@ -104,6 +121,10 @@ func run(on_state: Callable) -> void:
|
||||
_call("play_next_song")
|
||||
await _settle()
|
||||
_freeze_music_player()
|
||||
var picture: Image = Image.new()
|
||||
picture.load_png_from_buffer(
|
||||
FileAccess.get_file_as_bytes(CHARACTERS_DIR.path_join(character_names()[0])))
|
||||
_player_row(0).new_character_selected(ImageTexture.create_from_image(picture))
|
||||
_player_row(0).add_point()
|
||||
_player_row(0).add_point()
|
||||
_player_row(1).add_point()
|
||||
|
||||
Reference in new issue
Block a user