Fix double dissolve for pieces by moving hierarchy

Thankfully there wasn't a lot of logic tied to that hierarchy...
main
Elijah C. Voigt 1 year ago
parent e9c9afe2b6
commit 7e5564720d

@ -311,8 +311,8 @@ fn initialize(mut commands: Commands, board: Res<game::Board>, assets: Res<Asset
start: 0.0, start: 0.0,
duration: 12.0, duration: 12.0,
}, // Marks pieces as dissolving }, // Marks pieces as dissolving
)) ));
.with_children(|parent| {
// Hitboxes // Hitboxes
game::tiles().for_each(|(index, tile)| { game::tiles().for_each(|(index, tile)| {
let side = Board::side(index).expect("Spawn valid side"); let side = Board::side(index).expect("Spawn valid side");
@ -380,7 +380,6 @@ fn initialize(mut commands: Commands, board: Res<game::Board>, assets: Res<Asset
)); ));
}); });
}); });
});
} }
fn hydrate_camera( fn hydrate_camera(
@ -1268,7 +1267,6 @@ fn continue_title(mut next_state: ResMut<NextState<GameState>>) {
fn dissolve_animation( fn dissolve_animation(
mut query: Query<(Entity, &Dissolvable, &mut Dissolving, &mut Visibility)>, mut query: Query<(Entity, &Dissolvable, &mut Dissolving, &mut Visibility)>,
children: Query<&Children>, children: Query<&Children>,
// Used to create Handle<DissolveMaterial>
mut dissolve_materials: ResMut<Assets<DissolveMaterial>>, mut dissolve_materials: ResMut<Assets<DissolveMaterial>>,
object_materials: Query<(Entity, &Handle<DissolveMaterial>)>, object_materials: Query<(Entity, &Handle<DissolveMaterial>)>,
mut commands: Commands, mut commands: Commands,

@ -100,7 +100,7 @@ fn interactive_button(
while let Some((mut t, mut s)) = ts.fetch_next() { while let Some((mut t, mut s)) = ts.fetch_next() {
s.right = Val::Px(0.0); s.right = Val::Px(0.0);
s.bottom = Val::Px(0.0); s.bottom = Val::Px(0.0);
t.sections.iter_mut().for_each(|mut section| { t.sections.iter_mut().for_each(|section| {
section.style.color = Color::WHITE; section.style.color = Color::WHITE;
}); });
} }
@ -112,7 +112,7 @@ fn interactive_button(
while let Some((mut t, mut s)) = ts.fetch_next() { while let Some((mut t, mut s)) = ts.fetch_next() {
s.right = Val::Px(-2.0); s.right = Val::Px(-2.0);
s.bottom = Val::Px(-1.0); s.bottom = Val::Px(-1.0);
t.sections.iter_mut().for_each(|mut section| { t.sections.iter_mut().for_each(|section| {
section.style.color = Color::hex("E8E8E8").unwrap(); section.style.color = Color::hex("E8E8E8").unwrap();
}); });
} }
@ -120,10 +120,6 @@ fn interactive_button(
Interaction::Pressed => { Interaction::Pressed => {
ui_image.texture = depressed_handle.clone(); ui_image.texture = depressed_handle.clone();
writer.send(audio::AudioEvent::MenuSelect); writer.send(audio::AudioEvent::MenuSelect);
let mut ts = texts.iter_many_mut(children.iter_descendants(entity));
while let Some((_t, mut s)) = ts.fetch_next() {
// TODO: Change text color
}
} }
}); });
} }

Loading…
Cancel
Save