Module options_ui

Module options_ui 

Source
Expand description

egui-based Options overlay rendered on top of the MilkDrop visuals.

The overlay shows two tabs — Visuals and Engine — covering the V1 scope of the user-facing settings (see settings.rs). The widgets mutate a Settings struct in place; this module also returns an OptionsActions bundle so the caller can apply the diff to the live engine (mesh rebuild, profile toggle, …) and persist it.

Toggled by the Tab key. While open, Esc closes the overlay instead of quitting the app.

Structs§

HudData
Per-frame data the HUD needs from main.rs. Decoupled from OptionsUi so the panel itself stays stateless about engine internals.
OptionsActions
Diff produced by drawing one frame of the Options UI.
OptionsUi
Stateful egui overlay. Owns the renderer + the winit event translator; the visualiser keeps one of these for the life of the window.

Enums§

Tab 🔒
Which tab is currently in front.

Constants§

BEAT_MODE_NAMES 🔒
Beat-detection mode variants the picker can offer. Mirrors BeatDetectionMode::next()’s cycle so the dropdown order is predictable. The HardCut6 variant has a special_preset field that the GUI never edits — we materialise it with an empty string when the user selects it, which BeatDetector handles identically.
MESH_PRESETS 🔒
Concrete mesh sizes for the named quality presets. Kept in lockstep with onedrop_renderer::MeshQuality::size; we duplicate here so the dropdown can list “Custom” without forcing a round-trip through the renderer crate just for labels.

Functions§

draw_audio_tab 🔒
draw_engine_tab 🔒
draw_hud 🔒
Translucent corner HUD: FPS + current preset name + mesh size. Drawn even when the options panel is hidden, gated by Settings::window::hud.
draw_options_window 🔒
draw_playback_tab 🔒
draw_visuals_tab 🔒
draw_window_tab 🔒
mode_from_name 🔒