simplify game setup
This commit is contained in:
parent
f4c4339204
commit
30d19ed9d9
8 changed files with 145 additions and 171 deletions
|
|
@ -6,9 +6,9 @@ use bevy_ratatui::event::KeyMessage;
|
|||
use ratatui::{text::ToSpan, widgets::Paragraph};
|
||||
|
||||
use jong::game::GameState;
|
||||
use jong::game::wall::InWall;
|
||||
// use jong::game::wall::InWall;
|
||||
|
||||
use crate::tui::console::ConsoleState;
|
||||
use crate::tui::{console::ConsoleState, menu::draw_mainmenu, render::ingame::draw_ingame};
|
||||
|
||||
mod console;
|
||||
mod menu;
|
||||
|
|
@ -54,7 +54,7 @@ impl Plugin for RiichiTui {
|
|||
|
||||
// console
|
||||
.init_state::<console::ConsoleState>()
|
||||
.add_systems(Update, console::draw_console.run_if(in_state(console::ConsoleState::Open)))
|
||||
.add_systems(Update, console::draw_console.after_ignore_deferred(draw_mainmenu).after_ignore_deferred(draw_ingame).run_if(in_state(console::ConsoleState::Open)))
|
||||
|
||||
// general setup
|
||||
.init_state::<TuiState>()
|
||||
|
|
@ -67,7 +67,7 @@ impl Plugin for RiichiTui {
|
|||
// gaming
|
||||
.init_resource::<render::hand::RenderedHand>()
|
||||
.add_systems(Update, render::ingame::draw_ingame.run_if(in_state(InGame)))
|
||||
.add_systems(Update, render::hand::render_changed_hand.run_if(in_state(InGame).and(in_state(GameState::Play))))
|
||||
// .add_systems(Update, render::hand::render_changed_hand.run_if(in_state(InGame).and(in_state(GameState::Play))))
|
||||
|
||||
// semicolon stopper
|
||||
;
|
||||
|
|
@ -119,7 +119,7 @@ pub(crate) fn input_system(
|
|||
}
|
||||
_ => {}
|
||||
},
|
||||
GameState::Score => todo!(),
|
||||
_ => todo!(),
|
||||
_ => unreachable!("TuiState::InGame but GameState invalid")
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue