Vitrine der Stilproben
Das Startmenü führt zu einer Vitrine, die den gewählten Stil an einer kleinen Szene zeigt: Fels, toter und lebendiger Boden, Lebensmoos, eine Ranke, die Steine in eine erwachende Ruine trägt, eine wachsende Faserpflanze, ein hüpfendes Weidetier und zwei Spielfiguren. Knöpfe, die Tasten 1 bis 3 und F2 wechseln den Stil, Esc führt zurück ins Menü. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,7 @@ var clock: TickClock
|
||||
## The style the playing field is drawn in.
|
||||
var art: Art
|
||||
var menu: Menu
|
||||
var showcase: Showcase
|
||||
var map_view: MapView
|
||||
var marker: TileMarker
|
||||
var avatar: Avatar
|
||||
@@ -103,8 +104,16 @@ func _ready() -> void:
|
||||
add_child(menu)
|
||||
menu.name_field.text = options.player_name if not options.player_name.is_empty() else store.player_name()
|
||||
menu.address_field.text = options.address if not options.address.is_empty() else store.last_address()
|
||||
art.changed.connect(_redraw_art)
|
||||
menu.play_chosen.connect(play)
|
||||
menu.join_chosen.connect(join)
|
||||
menu.showcase_chosen.connect(open_showcase)
|
||||
showcase = Showcase.new()
|
||||
showcase.art = art
|
||||
showcase.closed.connect(close_showcase)
|
||||
showcase.hide()
|
||||
showcase.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
add_child(showcase)
|
||||
_show_menu("")
|
||||
match options.start:
|
||||
"solo":
|
||||
@@ -223,6 +232,28 @@ func _show_world() -> void:
|
||||
_own_hits.clear()
|
||||
|
||||
|
||||
## Shows the style samples instead of the menu.
|
||||
func open_showcase() -> void:
|
||||
menu.hide()
|
||||
showcase.time = 0.0
|
||||
showcase.process_mode = Node.PROCESS_MODE_INHERIT
|
||||
showcase.show()
|
||||
|
||||
|
||||
## Goes back from the style samples to the menu.
|
||||
func close_showcase() -> void:
|
||||
showcase.hide()
|
||||
showcase.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
menu.show()
|
||||
|
||||
|
||||
## Draws the playing field again after the style changed.
|
||||
func _redraw_art() -> void:
|
||||
map_view.redraw()
|
||||
for node: Node2D in [marker, figures, avatar]:
|
||||
node.queue_redraw()
|
||||
|
||||
|
||||
## Says in the status line how the game is shared, and with how many.
|
||||
func _update_status() -> void:
|
||||
if link == null:
|
||||
|
||||
Reference in New Issue
Block a user