detect hand change and render it
This commit is contained in:
parent
d506a25716
commit
3417384b86
9 changed files with 138 additions and 68 deletions
|
|
@ -2,14 +2,26 @@ use std::time::Duration;
|
|||
|
||||
use bevy::{app::ScheduleRunnerPlugin, prelude::*, state::app::StatesPlugin};
|
||||
use bevy_ratatui::RatatuiPlugins;
|
||||
use jong::tiles::InWall;
|
||||
use ratatui::{text::ToSpan, widgets::Paragraph};
|
||||
|
||||
use jong::game::GameState;
|
||||
use jong::game::wall::InWall;
|
||||
|
||||
mod console;
|
||||
mod input;
|
||||
mod render;
|
||||
|
||||
pub struct RiichiTui;
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, States, Default)]
|
||||
enum TuiState {
|
||||
MainMenu,
|
||||
#[default]
|
||||
InGame,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct RiichiTui {
|
||||
// player_names: Vec<String>,
|
||||
}
|
||||
|
||||
impl Plugin for RiichiTui {
|
||||
fn build(&self, app: &mut App) {
|
||||
|
|
@ -25,20 +37,19 @@ impl Plugin for RiichiTui {
|
|||
},
|
||||
))
|
||||
.add_plugins(StatesPlugin)
|
||||
|
||||
// setup console
|
||||
.init_state::<console::ConsoleState>()
|
||||
.add_systems(Update, console::toggle_console)
|
||||
.add_systems(Update, console::draw_console.run_if(in_state(console::ConsoleState::Open)))
|
||||
|
||||
.init_state::<TuiState>()
|
||||
.add_systems(Update, input::keyboard_input_system)
|
||||
// .add_systems(Update, input::keyboard_input_system)
|
||||
.add_systems(Update, render::draw_ingame.run_if(in_state(TuiState::InGame)))
|
||||
.add_systems(Update,render::render_changed_hand.run_if(in_state(GameState::Play)))
|
||||
// semicolon stopper
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, States, Default)]
|
||||
enum TuiState {
|
||||
MainMenu,
|
||||
#[default]
|
||||
InGame,
|
||||
}
|
||||
// fn prompt_names() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue