Vitrine weicht einer startenden Welt
Ein Gast kann die Stilproben öffnen, während er sich verbindet. Kam die Welt dann an, lag sie unter der Vitrine, und „Zurück" legte das Menü über das laufende Spiel. Jetzt schließt die Hauptszene die Vitrine, sobald eine Welt erscheint. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -111,8 +111,7 @@ func _ready() -> void:
|
|||||||
showcase = Showcase.new()
|
showcase = Showcase.new()
|
||||||
showcase.art = art
|
showcase.art = art
|
||||||
showcase.closed.connect(close_showcase)
|
showcase.closed.connect(close_showcase)
|
||||||
showcase.hide()
|
_hide_showcase()
|
||||||
showcase.process_mode = Node.PROCESS_MODE_DISABLED
|
|
||||||
add_child(showcase)
|
add_child(showcase)
|
||||||
_show_menu("")
|
_show_menu("")
|
||||||
match options.start:
|
match options.start:
|
||||||
@@ -216,6 +215,7 @@ func _show_menu(status: String) -> void:
|
|||||||
## Shows the world of the session and puts the figure on the spawn.
|
## Shows the world of the session and puts the figure on the spawn.
|
||||||
func _show_world() -> void:
|
func _show_world() -> void:
|
||||||
menu.hide()
|
menu.hide()
|
||||||
|
_hide_showcase()
|
||||||
hud.show()
|
hud.show()
|
||||||
for node: Node2D in [avatar, marker, figures]:
|
for node: Node2D in [avatar, marker, figures]:
|
||||||
node.show()
|
node.show()
|
||||||
@@ -242,9 +242,15 @@ func open_showcase() -> void:
|
|||||||
|
|
||||||
## Goes back from the style samples to the menu.
|
## Goes back from the style samples to the menu.
|
||||||
func close_showcase() -> void:
|
func close_showcase() -> void:
|
||||||
|
_hide_showcase()
|
||||||
|
menu.show()
|
||||||
|
|
||||||
|
|
||||||
|
## Hides the style samples and stops them. A world that starts while they are
|
||||||
|
## open, such as the one a joining guest receives, takes their place.
|
||||||
|
func _hide_showcase() -> void:
|
||||||
showcase.hide()
|
showcase.hide()
|
||||||
showcase.process_mode = Node.PROCESS_MODE_DISABLED
|
showcase.process_mode = Node.PROCESS_MODE_DISABLED
|
||||||
menu.show()
|
|
||||||
|
|
||||||
|
|
||||||
## Draws the playing field again after the style changed.
|
## Draws the playing field again after the style changed.
|
||||||
|
|||||||
@@ -440,3 +440,15 @@ func test_the_style_samples_open_from_the_menu_and_lead_back_to_it() -> void:
|
|||||||
check(main.menu.visible, "the menu is back")
|
check(main.menu.visible, "the menu is back")
|
||||||
check(not main.showcase.visible, "the samples are gone")
|
check(not main.showcase.visible, "the samples are gone")
|
||||||
_clean_up([directory])
|
_clean_up([directory])
|
||||||
|
|
||||||
|
|
||||||
|
func test_a_world_that_starts_takes_the_place_of_the_style_samples() -> void:
|
||||||
|
var directory := TestFiles.temporary_dir("samples-world")
|
||||||
|
var main := _start_main(directory)
|
||||||
|
main.open_showcase()
|
||||||
|
check(main.showcase.visible, "the samples are open")
|
||||||
|
main.play(false)
|
||||||
|
check(not main.showcase.visible, "the world shows instead of the samples")
|
||||||
|
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])
|
||||||
|
|||||||
Reference in New Issue
Block a user