resource production via graveyard, workers, and selectable buildlings
This commit is contained in:
parent
87fcc35a49
commit
921947c131
20 changed files with 364 additions and 24 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
use bevy::prelude::*;
|
||||
use building::{BuildingInfo, BuildingPreview, PlaceBuilding, PlacedBuildings};
|
||||
use input::{Cancellable, Inputs, actions::InputAction};
|
||||
use input::{Cancellable, Inputs, Selected, actions::InputAction};
|
||||
use physics::Ground;
|
||||
|
||||
pub struct BuildingPlacementPlugin;
|
||||
|
|
@ -37,9 +37,10 @@ fn init(mut commands: Commands, query: Single<Entity, With<Ground>>, mut setup:
|
|||
fn cancel_preview(
|
||||
mut writer: EventWriter<SelectBuildingPreview>,
|
||||
query: Query<(), (With<ActiveBuildingPreview>, With<Cancellable>)>,
|
||||
selected: Query<(), With<Selected>>,
|
||||
inputs: Res<Inputs<Update>>,
|
||||
) {
|
||||
if !query.is_empty() && inputs.just_pressed(InputAction::Cancel) {
|
||||
if !query.is_empty() && (inputs.just_pressed(InputAction::Cancel) || !selected.is_empty()) {
|
||||
writer.write(SelectBuildingPreview(None));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue