A10: Menus and settings
The game now opens on a main menu when it has a window: practice against bots (count and skill), join a server (by address, or from a LAN search list), settings, and quit. In a match, Escape brings up a pause menu (the match goes on) with settings and leave; when a match the player was in ends, a results screen shows their place, eliminations and the last of the feed. - KeyBindings: every action rebindable to a key or mouse button. bind() refuses an input another action uses and names it; Escape is reserved. ClientInput reads keys through the bindings. - GameSettings: bindings, mouse, graphics (quality preset and the print pass), audio (master, music and effects buses), display (window mode, vsync, frame cap), name, last server and practice choices, saved in user://settings.cfg. Missing, unreadable or corrupt files and bad values fall back to defaults, value by value; hand-edited key clashes are repaired on load. - Menus (src/ui): paper-and-ink panels, brass focus edge, keyboard navigable; a drawn sea-and-tide-post backdrop, or an ink wash over a match. AppShell runs menus and the session. - LocalServer takes a bot difficulty. - make menu-captures renders every screen. Closes #50 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,17 @@ var camera: Camera3D
|
||||
var rig: CameraRig = CameraRig.new()
|
||||
## The woodcut print pass over the camera (Look.add_print_pass).
|
||||
var print_pass: MeshInstance3D
|
||||
var sun: DirectionalLight3D
|
||||
|
||||
|
||||
## Applies the player's graphics settings: the sun's shadows and the print pass.
|
||||
func apply_settings(settings: GameSettings) -> void:
|
||||
var distance: float = settings.shadow_distance()
|
||||
if sun != null:
|
||||
sun.shadow_enabled = distance > 0.0
|
||||
sun.directional_shadow_max_distance = maxf(distance, 1.0)
|
||||
if print_pass != null:
|
||||
print_pass.visible = settings.print_pass
|
||||
|
||||
|
||||
## Builds the scene for `simulation`. `local_id` is the player this client plays, or 0.
|
||||
@@ -27,7 +38,8 @@ func setup(simulation: Simulation, local_id: int = 0) -> void:
|
||||
var world: WorldEnvironment = WorldEnvironment.new()
|
||||
world.environment = Look.environment()
|
||||
add_child(world)
|
||||
add_child(Look.sun())
|
||||
sun = Look.sun()
|
||||
add_child(sun)
|
||||
|
||||
camera = Camera3D.new()
|
||||
camera.near = CameraRig.NEAR
|
||||
|
||||
Reference in New Issue
Block a user