Skip to content

Commit

Permalink
Update butler
Browse files Browse the repository at this point in the history
  • Loading branch information
jwright159 committed Jan 31, 2025
1 parent 6e12c26 commit 54b3af5
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 22 deletions.
2 changes: 1 addition & 1 deletion sbepis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ faker_rand = "0.1.1"
meshtext = "0.3.1"
soundyrust = { path = "../soundyrust" }
blenvy = { git = "https://github.com/jwright159/Blenvy.git" }
bevy-butler = { git = "https://github.com/jwright159/bevy-butler.git" }
bevy-butler = "0.5.4-alpha.3"
bevy_hanabi = "0.14.0"
typetag = "0.2.19"

Expand Down
12 changes: 5 additions & 7 deletions sbepis/src/blenvy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@ use crate::npcs::consort::ConsortSpawner;
use crate::npcs::imp::ImpSpawner;
use crate::{ok_or_continue, some_or_continue};

#[butler_plugin(build(
add_plugins(::blenvy::BlenvyPlugin::default()),
register_type::<MeshColliderBlundle>(),
register_type::<PlanetBlundle>(),
register_type::<BoxBlundle>(),
register_type::<SpawnerBlundle>(),
))]
#[butler_plugin(build(add_plugins(::blenvy::BlenvyPlugin::default())))]
pub struct BlenvyPlugin;

#[derive(Component, Reflect)]
#[reflect(Component)]
#[register_type(plugin = BlenvyPlugin)]
pub struct MeshColliderBlundle;

#[system(
Expand Down Expand Up @@ -55,6 +50,7 @@ fn create_mesh_collider(

#[derive(Component, Reflect)]
#[reflect(Component)]
#[register_type(plugin = BlenvyPlugin)]
pub struct PlanetBlundle {
pub radius: f32,
pub gravity: f32,
Expand All @@ -78,6 +74,7 @@ fn create_planet(scenes: Query<(Entity, &PlanetBlundle)>, mut commands: Commands

#[derive(Component, Reflect)]
#[reflect(Component)]
#[register_type(plugin = BlenvyPlugin)]
pub struct BoxBlundle;

#[system(
Expand All @@ -101,6 +98,7 @@ fn create_box(scenes: Query<Entity, With<BoxBlundle>>, mut commands: Commands) {

#[derive(Component, Reflect)]
#[reflect(Component)]
#[register_type(plugin = BlenvyPlugin)]
pub enum SpawnerBlundle {
Imp,
Consort,
Expand Down
5 changes: 1 addition & 4 deletions sbepis/src/fray/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ use crate::util::MapRange;

mod tracks;

#[butler_plugin(build(
add_plugins(SoundyPlugin),
register_type::<TrackSwitcher>(),
))]
#[butler_plugin(build(add_plugins(SoundyPlugin)))]
pub struct FrayPlugin;

#[system(
Expand Down
1 change: 1 addition & 0 deletions sbepis/src/fray/tracks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::prelude::InteractedWithSet;

#[derive(Component, Reflect)]
#[reflect(Component)]
#[register_type(plugin = FrayPlugin)]
pub struct TrackSwitcher;

#[event(plugin = FrayPlugin, generics = TrackSwitcher)]
Expand Down
7 changes: 3 additions & 4 deletions sbepis/src/gravity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ use itertools::Itertools;

use crate::util::{IterElements, TransformEx};

#[butler_plugin(build(
register_type::<GravityPriority>(),
register_type::<GravityPoint>(),
))]
#[butler_plugin]
pub struct GravityPlugin;

#[derive(Component, Reflect)]
#[register_type(plugin = GravityPlugin)]
pub struct GravityPriority(pub u32);

pub trait GravitationalField {
Expand All @@ -21,6 +19,7 @@ pub trait GravitationalField {
}

#[derive(Component, Reflect)]
#[register_type(plugin = GravityPlugin)]
pub struct GravityPoint {
pub standard_radius: f32,
pub acceleration_at_radius: f32,
Expand Down
2 changes: 1 addition & 1 deletion sbepis/src/menus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use leafwing_input_manager::{Actionlike, InputControlKind};
use crate::input::InputManagerReference;

#[butler_plugin(build(
register_type::<MenuStack>(),
add_plugins(InputManagerMenuPlugin::<CloseMenuAction>::default()),
))]
pub struct MenusPlugin;
Expand Down Expand Up @@ -59,6 +58,7 @@ pub struct MenuDespawnsWhenClosed;

#[derive(Resource, Default, Debug, Reflect)]
#[resource(plugin = MenusPlugin)]
#[register_type(plugin = MenusPlugin)]
pub struct MenuStack {
stack: Vec<Entity>,
current: Option<Entity>,
Expand Down
10 changes: 5 additions & 5 deletions sbepis/src/questing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ pub use quest_markers::SpawnQuestMarker;
pub struct QuestingPlugin;

#[butler_plugin(build(
register_type::<Quests>(),
register_type::<QuestGiver>(),
register_type::<QuestId>(),
register_type::<Quest>(),
add_plugins(InputManagerMenuPlugin::<QuestProposalAction>::default()),
))]
impl Plugin for QuestingPlugin {
Expand All @@ -41,11 +37,13 @@ impl Plugin for QuestingPlugin {
}

#[derive(Resource, Default, Debug, Reflect)]
#[resource(plugin = QuestingPlugin)]
#[reflect(Resource)]
#[resource(plugin = QuestingPlugin)]
#[register_type(plugin = QuestingPlugin)]
pub struct Quests(pub HashMap<QuestId, Quest>);

#[derive(Clone, Copy, Hash, PartialEq, Eq, Debug, Reflect)]
#[register_type(plugin = QuestingPlugin)]
pub struct QuestId(Uuid);
impl QuestId {
#[allow(clippy::new_without_default)]
Expand Down Expand Up @@ -137,6 +135,7 @@ impl Distribution<QuestType> for Standard {
}

#[derive(Debug, Reflect)]
#[register_type(plugin = QuestingPlugin)]
pub struct Quest {
pub id: QuestId,
pub quest_type: QuestType,
Expand Down Expand Up @@ -166,6 +165,7 @@ impl Distribution<Quest> for Standard {
}

#[derive(Component, Default, Reflect)]
#[register_type(plugin = QuestingPlugin)]
pub struct QuestGiver {
pub given_quest: Option<QuestId>,
quest_marker: Option<Entity>,
Expand Down

0 comments on commit 54b3af5

Please sign in to comment.