-
Notifications
You must be signed in to change notification settings - Fork 0
To infinity and Beyond! #70
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
Changes from all commits
a84663f
2b9548d
96e6710
6fa1653
7ee18fa
86059e5
8af5b59
b069b9e
17ae30f
eb59de1
e399283
9ca4b0e
68726d1
8082061
0070d55
e14fdc4
417e9f0
b0bc3c8
764ceeb
f6e18c5
41657ba
1400280
865fa46
6e99ff2
bfd0704
11892ba
9facba1
96c6a97
1e14983
1638f40
5ea6797
e329615
d0c6c67
0d9ec6c
e87340b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,21 +55,25 @@ pub fn chat_state_transition_system( | |
| mut chat_state: ResMut<chat_resources::ChatState>, | ||
| ) { | ||
| let current_state_value = current_state.get(); | ||
| let mut next_state_value = current_state_value.clone(); | ||
|
|
||
| if *current_state_value == GameState::WaitingForServer | ||
| || *current_state_value == GameState::LoadingSpawnRegion | ||
| { | ||
| // TODO: Introduce Chatting Substate | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will be implemented in a follow up PR alongside a rework of events |
||
| return; | ||
| } | ||
|
|
||
| if keyboard_input.just_pressed(KeyCode::KeyT) { | ||
| info!("Focusing chat via KeyT"); | ||
| if *current_state_value == GameState::Playing { | ||
| chat_state.just_focused = true; | ||
| next_state_value = GameState::Chatting; | ||
| next_state.set(GameState::Chatting); | ||
| } | ||
| } | ||
| if keyboard_input.just_pressed(KeyCode::Escape) && *current_state_value == GameState::Chatting { | ||
| info!("Unfocusing chat via Escape"); | ||
| next_state_value = GameState::Playing; | ||
| next_state.set(GameState::Playing); | ||
| } | ||
|
|
||
| next_state.set(next_state_value); | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one was annoying to catch. it wasn't possible to transition from WorldLoading to Playing.
|
||
| } | ||
|
|
||
| pub fn process_chat_input_system( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,15 +3,15 @@ use terrain_util::client_block::block_properties; | |
| use crate::prelude::*; | ||
|
|
||
| static COLLIDER_GRID_SIZE: u32 = 4; | ||
| static COLLIDER_RESTING_POSITION: Vec3 = Vec3::ZERO; | ||
| static COLLIDER_RESTING_POSITION: Vec3 = Vec3::MIN; | ||
| static COLLIDER_CUBOID_WIDTH: f32 = 1.0; | ||
|
|
||
| pub fn setup_coliders_system(mut commands: Commands) { | ||
| let collider_range = 0..COLLIDER_GRID_SIZE; | ||
|
|
||
| commands.spawn(( | ||
| Collider::cuboid(256.0, 1.0, 256.0), | ||
| Transform::from_xyz(0.0, 0.0, 0.0), | ||
| Transform::from_translation(COLLIDER_RESTING_POSITION), | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. info: having colliders rest to ZERO could potentially cause issues when more physics objects were to be added in the future. |
||
| )); | ||
|
|
||
| for x in collider_range.clone() { | ||
|
|
@@ -41,7 +41,7 @@ pub fn setup_coliders_system(mut commands: Commands) { | |
| pub fn handle_collider_update_events_system( | ||
| mut collider_grid_events: MessageReader<collider_events::ColliderUpdateEvent>, | ||
| mut query: Query<(&mut Transform, &collider_components::BlockCollider)>, | ||
| mut chunk_manager: ResMut<ChunkManager>, | ||
| chunk_manager: Res<ChunkManager>, | ||
| ) { | ||
| for event in collider_grid_events.read() { | ||
| let event_position = Vec3::new( | ||
|
|
||
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.
my project wasn't building locally anymore for some reason