|
|
|
@ -31,14 +31,14 @@ impl Plugin for Display3dPlugin {
|
|
|
|
Update,
|
|
|
|
Update,
|
|
|
|
(
|
|
|
|
(
|
|
|
|
hydrate_camera, // TODO: add run_if...
|
|
|
|
hydrate_camera, // TODO: add run_if...
|
|
|
|
menu::exit_to_menu.run_if(in_state(GameState::Display3d)),
|
|
|
|
|
|
|
|
set_piece_model.run_if(any_component_added::<Piece>),
|
|
|
|
set_piece_model.run_if(any_component_added::<Piece>),
|
|
|
|
set_board_model.run_if(any_component_added::<game::BoardComponent>),
|
|
|
|
set_board_model.run_if(any_component_added::<game::BoardComponent>),
|
|
|
|
set_tile_hitbox.run_if(any_component_added::<game::Tile>),
|
|
|
|
set_tile_hitbox.run_if(any_component_added::<game::Tile>),
|
|
|
|
set_piece_position.run_if(any_component_changed::<BoardIndex>),
|
|
|
|
set_piece_position.run_if(any_component_changed::<BoardIndex>),
|
|
|
|
set_piece_texture.run_if(any_component_changed::<Side>),
|
|
|
|
set_piece_texture.run_if(any_component_changed::<Side>),
|
|
|
|
select
|
|
|
|
select
|
|
|
|
.run_if(in_state(GameState::Display3d))
|
|
|
|
.run_if(in_state(GameState::Play))
|
|
|
|
|
|
|
|
.run_if(in_state(DisplayState::Display3d))
|
|
|
|
.run_if(on_event::<MouseButtonInput>()),
|
|
|
|
.run_if(on_event::<MouseButtonInput>()),
|
|
|
|
pick_up.run_if(any_component_added::<game::Selected>),
|
|
|
|
pick_up.run_if(any_component_added::<game::Selected>),
|
|
|
|
put_down.run_if(any_component_removed::<game::Selected>()),
|
|
|
|
put_down.run_if(any_component_removed::<game::Selected>()),
|
|
|
|
@ -49,23 +49,26 @@ impl Plugin for Display3dPlugin {
|
|
|
|
(
|
|
|
|
(
|
|
|
|
move_camera
|
|
|
|
move_camera
|
|
|
|
.run_if(resource_exists::<debug::DebugEnabled>())
|
|
|
|
.run_if(resource_exists::<debug::DebugEnabled>())
|
|
|
|
.run_if(in_state(GameState::Display3d))
|
|
|
|
.run_if(in_state(GameState::Play))
|
|
|
|
|
|
|
|
.run_if(in_state(DisplayState::Display3d))
|
|
|
|
.run_if(on_event::<MouseMotion>()),
|
|
|
|
.run_if(on_event::<MouseMotion>()),
|
|
|
|
gizmo_system
|
|
|
|
gizmo_system
|
|
|
|
.run_if(resource_exists::<debug::DebugEnabled>())
|
|
|
|
.run_if(resource_exists::<debug::DebugEnabled>())
|
|
|
|
.run_if(in_state(GameState::Display3d)),
|
|
|
|
.run_if(in_state(GameState::Play))
|
|
|
|
|
|
|
|
.run_if(in_state(DisplayState::Display3d)),
|
|
|
|
mouse_zoom
|
|
|
|
mouse_zoom
|
|
|
|
.run_if(resource_exists::<debug::DebugEnabled>())
|
|
|
|
.run_if(resource_exists::<debug::DebugEnabled>())
|
|
|
|
.run_if(in_state(GameState::Display3d))
|
|
|
|
.run_if(in_state(GameState::Play))
|
|
|
|
|
|
|
|
.run_if(in_state(DisplayState::Display3d))
|
|
|
|
.run_if(on_event::<MouseWheel>()),
|
|
|
|
.run_if(on_event::<MouseWheel>()),
|
|
|
|
selected_gizmo.run_if(resource_exists::<debug::DebugEnabled>()),
|
|
|
|
selected_gizmo.run_if(resource_exists::<debug::DebugEnabled>()),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.add_systems(
|
|
|
|
.add_systems(
|
|
|
|
OnEnter(GameState::Display3d),
|
|
|
|
OnEnter(DisplayState::Display3d),
|
|
|
|
(activate::<Display3d>, set_piece_texture),
|
|
|
|
(activate::<Display3d>, set_piece_texture),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.add_systems(OnExit(GameState::Display3d), deactivate::<Display3d>);
|
|
|
|
.add_systems(OnExit(DisplayState::Display3d), deactivate::<Display3d>);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -199,11 +202,7 @@ fn hydrate_camera(
|
|
|
|
UiCameraConfig { show_ui: true },
|
|
|
|
UiCameraConfig { show_ui: true },
|
|
|
|
FogSettings {
|
|
|
|
FogSettings {
|
|
|
|
color: Color::WHITE,
|
|
|
|
color: Color::WHITE,
|
|
|
|
falloff: FogFalloff::from_visibility_colors(
|
|
|
|
falloff: FogFalloff::from_visibility_colors(100.0, Color::NONE, Color::NONE),
|
|
|
|
100.0,
|
|
|
|
|
|
|
|
Color::ORANGE_RED,
|
|
|
|
|
|
|
|
Color::NONE,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
));
|
|
|
|
));
|
|
|
|
|