we start printing again
This commit is contained in:
parent
65ea256436
commit
59399c3590
7 changed files with 114 additions and 52 deletions
|
|
@ -32,28 +32,51 @@ impl Plugin for RiichiTui {
|
|||
RatatuiPlugins {
|
||||
// enable_kitty_protocol: todo!(),
|
||||
enable_mouse_capture: true,
|
||||
// enable_input_forwarding: false,
|
||||
enable_input_forwarding: true,
|
||||
..Default::default()
|
||||
},
|
||||
))
|
||||
.add_plugins(StatesPlugin)
|
||||
// setup console
|
||||
|
||||
// console
|
||||
.init_state::<console::ConsoleState>()
|
||||
.add_systems(Update, console::toggle_console)
|
||||
.add_systems(Update, console::draw_console.run_if(in_state(console::ConsoleState::Open)))
|
||||
// other setup
|
||||
|
||||
// general setup
|
||||
.init_state::<TuiState>()
|
||||
.add_computed_state::<InGame>()
|
||||
.add_systems(Update, curr_state)
|
||||
|
||||
// main menu
|
||||
.add_systems(Update, (menu::draw_mainmenu,menu::mainmenu_input).run_if(in_state(TuiState::MainMenu)))
|
||||
.add_systems(Update, (menu::draw_mainmenu, menu::mainmenu_input).run_if(in_state(TuiState::MainMenu)))
|
||||
|
||||
// gaming
|
||||
.add_systems(Update, render::ingame::draw_ingame.run_if(in_state(TuiState::InGame)))
|
||||
.init_resource::<render::hand::RenderedHand>()
|
||||
.add_systems(OnEnter(GameState::Play), render::hand::render_hand)
|
||||
.add_systems(Update, render::hand::render_changed_hand.run_if(in_state(InGame).and(in_state(GameState::Play))))
|
||||
.add_systems(Update, render::ingame::draw_ingame.run_if(in_state(TuiState::InGame)))
|
||||
|
||||
// semicolon stopper
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
fn curr_state(
|
||||
curr_gamestate: Option<Res<State<GameState>>>,
|
||||
curr_tuistate: Res<State<TuiState>>,
|
||||
curr_ingame: Option<Res<State<InGame>>>,
|
||||
) {
|
||||
if let Some(curr_gamestate) = curr_gamestate && curr_gamestate.is_changed(){
|
||||
trace!("GameState: {curr_gamestate:?}")
|
||||
}
|
||||
if curr_tuistate.is_changed() {
|
||||
trace!("TuiState: {curr_tuistate:?}")
|
||||
}
|
||||
if let Some(curr_ingame) = curr_ingame && curr_ingame.is_changed(){
|
||||
trace!("InGame: {curr_ingame:?}")
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
|
||||
struct InGame;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue