Skip to content

Commit

Permalink
Deprecate configure_set & make configure_sets work for single par…
Browse files Browse the repository at this point in the history
…ams.
  • Loading branch information
geieredgar committed Aug 14, 2023
1 parent 43fe83b commit 35875a5
Show file tree
Hide file tree
Showing 13 changed files with 191 additions and 267 deletions.
13 changes: 3 additions & 10 deletions crates/bevy_app/src/app.rs
Expand Up @@ -393,20 +393,13 @@ impl App {
}

/// Configures a system set in the default schedule, adding the set if it does not exist.
#[deprecated(since = "0.12.0", note = "Please use `configure_sets` instead.")]
pub fn configure_set(
&mut self,
schedule: impl ScheduleLabel,
set: impl IntoSystemSetConfig,
set: impl IntoSystemSetConfigs,
) -> &mut Self {
let mut schedules = self.world.resource_mut::<Schedules>();
if let Some(schedule) = schedules.get_mut(&schedule) {
schedule.configure_set(set);
} else {
let mut new_schedule = Schedule::new();
new_schedule.configure_set(set);
schedules.insert(schedule, new_schedule);
}
self
self.configure_sets(schedule, set)
}

/// Configures a collection of system sets in the default schedule, adding any sets that do not exist.
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_audio/src/lib.rs
Expand Up @@ -71,7 +71,7 @@ pub struct AudioPlugin {
impl Plugin for AudioPlugin {
fn build(&self, app: &mut App) {
app.insert_resource(self.global_volume)
.configure_set(PostUpdate, AudioPlaySet.run_if(audio_output_available))
.configure_sets(PostUpdate, AudioPlaySet.run_if(audio_output_available))
.init_resource::<AudioOutput>();

#[cfg(any(feature = "mp3", feature = "flac", feature = "wav", feature = "vorbis"))]
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/lib.rs
Expand Up @@ -41,8 +41,8 @@ pub mod prelude {
removal_detection::RemovedComponents,
schedule::{
apply_deferred, apply_state_transition, common_conditions::*, Condition,
IntoSystemConfigs, IntoSystemSet, IntoSystemSetConfig, IntoSystemSetConfigs, NextState,
OnEnter, OnExit, OnTransition, Schedule, Schedules, State, States, SystemSet,
IntoSystemConfigs, IntoSystemSet, IntoSystemSetConfigs, NextState, OnEnter, OnExit,
OnTransition, Schedule, Schedules, State, States, SystemSet,
},
system::{
adapter as system_adapter,
Expand Down

0 comments on commit 35875a5

Please sign in to comment.