What problem does it solve?
Provides a single reference and integration point for managing UI screens, context-sensitive input, and the flow of UI state into game actions so developers can consistently add or modify interface elements without breaking render or input behavior.
Core Features & Use Cases
- UiState centralization: A single UiState struct holds all menu and overlay states for predictable rendering and input handling.
- Render priority and flow: Defines fullscreen menu early-returns, overlays, death screen, and main game view rendering order to avoid visual and interaction conflicts.
- Input-to-Action mapping: Context-sensitive input handling converts keystrokes into Action variants for the game loop and supports menus, look mode, targeting, and debug commands.
- Camera and overlays: Camera smoothing, dialog box lifecycle, tutorial messages, and modal focus rules simplify adding features like world map, inventory, and debug consoles.
Quick Start
Create a new UI screen by adding src/ui/my_screen.rs with state and render functions, add the state to UiState, register the module in src/ui/mod.rs, call the render with fullscreen early-return in main render, and implement input handling to emit appropriate Action variants.