Stil wählen, merken und fotografieren
F2 wechselt im Spiel den Stil und meldet ihn, --style=NAME wählt ihn beim Start, und das Spiel merkt sich die Wahl in den Einstellungen. Das Bildschirmfoto-Werkzeug nimmt Bilder in einem bestimmten Stil und von der Vitrine auf und zeigt eine zweite Figur mit Namen. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,3 +28,11 @@ func test_profile_names_cannot_leave_the_profile_folder() -> void:
|
||||
check_eq(options.storage_dir(), "user://", "a bad profile is ignored")
|
||||
check_eq(options.port, NetLink.DEFAULT_PORT, "a bad port is ignored")
|
||||
check_eq(options.ignored, PackedStringArray(["--profile=../oops", "--port=70000", "--fly"]), "everything ignored is listed")
|
||||
|
||||
|
||||
func test_a_style_can_be_chosen() -> void:
|
||||
check_eq(LaunchOptions.parse(PackedStringArray(["--style=glow"])).style, GlowStyle.KEY, "a known style")
|
||||
check_eq(LaunchOptions.parse(PackedStringArray()).style, &"", "none without the argument")
|
||||
var unknown := LaunchOptions.parse(PackedStringArray(["--style=watercolour"]))
|
||||
check_eq(unknown.style, &"", "an unknown style is not taken")
|
||||
check_eq(unknown.ignored, PackedStringArray(["--style=watercolour"]), "but listed as ignored")
|
||||
|
||||
@@ -452,3 +452,30 @@ func test_a_world_that_starts_takes_the_place_of_the_style_samples() -> void:
|
||||
check_eq(main.showcase.process_mode, Node.PROCESS_MODE_DISABLED, "and the samples take no input")
|
||||
check(not main.menu.visible, "the menu stays hidden")
|
||||
_clean_up([directory])
|
||||
|
||||
|
||||
func test_f2_switches_the_style_and_the_choice_is_kept() -> void:
|
||||
var directory := TestFiles.temporary_dir("style")
|
||||
var main := _start_main(directory)
|
||||
main.play(false)
|
||||
var first: StringName = main.art.style.key()
|
||||
_press(main, "next_style")
|
||||
var second: StringName = main.art.style.key()
|
||||
check(second != first, "another style")
|
||||
check_eq(main.hud.message(), tr("STYLE_SWITCHED") % tr(main.art.style.title_key()), "the player is told")
|
||||
_stop_main(main)
|
||||
|
||||
var later := _start_main(directory)
|
||||
check_eq(later.art.style.key(), second, "the next start draws in it again")
|
||||
_clean_up([directory])
|
||||
|
||||
|
||||
func test_the_command_line_chooses_the_style() -> void:
|
||||
var directory := TestFiles.temporary_dir("style-option")
|
||||
var main: Node = load("res://main.tscn").instantiate()
|
||||
main.storage_dir = directory
|
||||
main.command_line = PackedStringArray(["--style=pastel"])
|
||||
tree.root.add_child(main)
|
||||
_started.append(main)
|
||||
check_eq(main.art.style.key(), PastelStyle.KEY, "the style of the command line")
|
||||
_clean_up([directory])
|
||||
|
||||
@@ -189,3 +189,12 @@ func test_settings_that_cannot_be_read_right_now_are_not_overwritten() -> void:
|
||||
check_eq(later.player_name(), "Ada", "the name on disk is the old one")
|
||||
check_eq(later.last_address(), "192.168.1.20", "the address is kept")
|
||||
TestFiles.remove_dir(directory)
|
||||
|
||||
|
||||
func test_the_chosen_style_is_kept() -> void:
|
||||
var directory := TestFiles.temporary_dir("style")
|
||||
var store := SaveStore.new(directory)
|
||||
check_eq(store.style(), "", "no style at first")
|
||||
store.set_style("pastel")
|
||||
check_eq(SaveStore.new(directory).style(), "pastel", "kept for the next start")
|
||||
TestFiles.remove_dir(directory)
|
||||
|
||||
Reference in New Issue
Block a user