main
Elijah Voigt 1 month ago
parent acbf89a077
commit 882aac6e6e

@ -16,7 +16,6 @@ fn main() {
name: "flappy".into(), name: "flappy".into(),
game_type: GameType::Two, game_type: GameType::Two,
target_resolution: (360, 640).into(), target_resolution: (360, 640).into(),
..default()
}, },
Physics2dPlugin, Physics2dPlugin,
)) ))

@ -229,7 +229,7 @@ fn assign_monologue_event(
monologues: Query<&TreeMonologue>, monologues: Query<&TreeMonologue>,
) { ) {
let TreeMonologue(handle) = monologues.get(event.entity).unwrap(); let TreeMonologue(handle) = monologues.get(event.entity).unwrap();
events.write(AssignMonologue(handle.clone())); events.write(AssignMonologue(*handle));
} }
/// Observer for the "Plant a new tree" button in the debug UI /// Observer for the "Plant a new tree" button in the debug UI

@ -191,7 +191,7 @@ fn start_dialog(
debug!("Click event detected in start dialog systme"); debug!("Click event detected in start dialog systme");
if let Ok(TreeMonologue(id)) = query.get(event.entity) { if let Ok(TreeMonologue(id)) = query.get(event.entity) {
debug!("Tree Monologue received, sending start dialog event"); debug!("Tree Monologue received, sending start dialog event");
dialog_events.write(DialogEvent::Start(event.entity, id.clone())); dialog_events.write(DialogEvent::Start(event.entity, *id));
dialog_events.write(DialogEvent::NextBatch); dialog_events.write(DialogEvent::NextBatch);
} }
}) })
@ -246,7 +246,7 @@ fn dialog_engine(
next_state.set(DialogState::Ongoing); next_state.set(DialogState::Ongoing);
// Copy monologue asset into local // Copy monologue asset into local
*asset_id = id.clone(); *asset_id = *id;
*tree_entity = Some(*e); *tree_entity = Some(*e);
} }
DialogEvent::NextBatch => { DialogEvent::NextBatch => {
@ -254,7 +254,7 @@ fn dialog_engine(
commands.entity(*dialog_box).with_children(|parent| { commands.entity(*dialog_box).with_children(|parent| {
// Fetch this monologue from the assets // Fetch this monologue from the assets
if let Some(monologue) = monologues.get(asset_id.clone()) { if let Some(monologue) = monologues.get(*asset_id) {
// Fetch this batch of options // Fetch this batch of options
if let Some(batch) = monologue.get(*idx) { if let Some(batch) = monologue.get(*idx) {
// Spawn the dialog options in the dialog box // Spawn the dialog options in the dialog box
@ -443,7 +443,7 @@ fn handle_plant_tree(
tree.insert((mesh, material, transform)); tree.insert((mesh, material, transform));
if let Some(id) = assignment { if let Some(id) = assignment {
assignments.write(AssignMonologue(id.clone())); assignments.write(AssignMonologue(*id));
} }
}); });
} }

@ -6,7 +6,7 @@ pub struct Physics2dPlugin;
impl Plugin for Physics2dPlugin { impl Plugin for Physics2dPlugin {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {
app.add_plugins((PhysicsPlugins::default(), PhysicsDebugPlugin::default())) app.add_plugins((PhysicsPlugins::default(), PhysicsDebugPlugin))
.add_systems( .add_systems(
Update, Update,
toggle_physics_debug_render.run_if(state_changed::<DebuggingState>), toggle_physics_debug_render.run_if(state_changed::<DebuggingState>),

Loading…
Cancel
Save