-
Notifications
You must be signed in to change notification settings - Fork 0
Integrate egui-inspector, add game states #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Update, | ||
( | ||
player_systems::handle_controller_movement_system, | ||
player_systems::handle_player_collider_events_system, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems contraversial at first:
Q: Why would you want to run the controller movement systems when the player is chatting?
A: What if the player jumped into the air and while in air opened up the chat? Without these systems, the player would fall through the ground.
mut next_state: ResMut<NextState<GameState>>, | ||
key_input: Res<ButtonInput<KeyCode>>, | ||
) { | ||
if key_input.just_pressed(KeyCode::Tab) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love how clean the state transitions are here 😍
chat_input_query.get_single_mut(), | ||
) { | ||
info!("Handling unfocus state"); | ||
container_classes.remove_class("focused"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still unhappy with the classes, but what can I do 🤷♂️
|
||
#chat_message_input { | ||
margin: 0px; | ||
margin-top: 15px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change, but might aswell fix the margin..
) { | ||
let mut window = window_query.single_mut(); | ||
if btn.just_pressed(MouseButton::Left) { | ||
if btn.just_pressed(MouseButton::Left) && *current_state.get() != GameState::Debugging { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could check for playing and chatting instead...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
In addition to the egui crate and the inspector crate, the entire state needs to be reworked because technical debt and problems:
I am so relieved that the chat system is no longer sketchy but looks like a genuinely robust solution with the state transitions 😄
New States