2026-01-13 04:11:09 -08:00
|
|
|
use bevy::prelude::*;
|
2026-01-13 17:05:56 -08:00
|
|
|
use bevy_ratatui::RatatuiContext;
|
|
|
|
|
use ratatui::Frame;
|
2026-01-13 04:11:09 -08:00
|
|
|
|
2026-01-11 22:32:30 -08:00
|
|
|
pub(crate) mod hand;
|
|
|
|
|
pub(crate) mod ingame;
|
2026-01-13 17:05:56 -08:00
|
|
|
pub(crate) mod menu;
|
2026-01-13 03:32:08 -08:00
|
|
|
pub(crate) mod tile;
|
2026-01-13 04:11:09 -08:00
|
|
|
|
2026-01-13 17:05:56 -08:00
|
|
|
#[derive(Resource, Default)]
|
|
|
|
|
pub(crate) struct WidgetStack(pub(crate) Vec<Box<dyn FnOnce(&mut Frame) + Send + Sync>>);
|
|
|
|
|
|
2026-01-13 04:11:09 -08:00
|
|
|
#[derive(Component)]
|
|
|
|
|
pub(crate) struct Hovered;
|
2026-01-13 17:05:56 -08:00
|
|
|
|
|
|
|
|
pub(crate) fn draw_system(
|
|
|
|
|
mut tui_ctx: ResMut<RatatuiContext>,
|
|
|
|
|
mut widgetstack: ResMut<WidgetStack>,
|
|
|
|
|
) -> Result {
|
|
|
|
|
tui_ctx.draw(|frame| {
|
|
|
|
|
for widget in widgetstack.0.drain(..) {
|
|
|
|
|
widget(frame)
|
|
|
|
|
}
|
|
|
|
|
})?;
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|