Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 76cf41e7a9 |
@@ -94,7 +94,7 @@ pub struct SettingsChangedEvent(pub Settings);
|
||||
|
||||
/// Marker on the root Settings panel entity.
|
||||
#[derive(Component, Debug)]
|
||||
struct SettingsPanel;
|
||||
pub struct SettingsPanel;
|
||||
|
||||
/// Marks the `Text` node showing the live SFX volume value.
|
||||
#[derive(Component, Debug)]
|
||||
@@ -1137,6 +1137,7 @@ fn handle_sync_buttons(
|
||||
mut configure_sync: MessageWriter<SyncConfigureRequestEvent>,
|
||||
mut logout_sync: MessageWriter<SyncLogoutRequestEvent>,
|
||||
mut delete_account: MessageWriter<DeleteAccountRequestEvent>,
|
||||
mut screen: ResMut<SettingsScreen>,
|
||||
) {
|
||||
for (interaction, button) in &interaction_query {
|
||||
if *interaction != Interaction::Pressed {
|
||||
@@ -1144,7 +1145,12 @@ fn handle_sync_buttons(
|
||||
}
|
||||
match button {
|
||||
SettingsButton::SyncNow => { manual_sync.write(ManualSyncRequestEvent); }
|
||||
SettingsButton::ConnectSync => { configure_sync.write(SyncConfigureRequestEvent); }
|
||||
SettingsButton::ConnectSync => {
|
||||
// Close settings before the sync-setup modal opens so the
|
||||
// guard in open_sync_setup_modal doesn't block on our own scrim.
|
||||
screen.0 = false;
|
||||
configure_sync.write(SyncConfigureRequestEvent);
|
||||
}
|
||||
SettingsButton::DisconnectSync => { logout_sync.write(SyncLogoutRequestEvent); }
|
||||
SettingsButton::DeleteAccount => { delete_account.write(DeleteAccountRequestEvent); }
|
||||
_ => {}
|
||||
|
||||
@@ -52,7 +52,7 @@ use crate::events::{
|
||||
SyncLogoutRequestEvent,
|
||||
};
|
||||
use crate::font_plugin::FontResource;
|
||||
use crate::settings_plugin::{SettingsResource, SettingsScreen, SettingsStoragePath};
|
||||
use crate::settings_plugin::{SettingsPanel, SettingsResource, SettingsScreen, SettingsStoragePath};
|
||||
use crate::resources::TokioRuntimeResource;
|
||||
use crate::sync_plugin::SyncProviderResource;
|
||||
use crate::ui_modal::{spawn_modal, ModalScrim};
|
||||
@@ -205,10 +205,14 @@ impl Plugin for SyncSetupPlugin {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// Opens the sync-setup modal when `SyncConfigureRequestEvent` is received.
|
||||
#[allow(clippy::type_complexity)]
|
||||
fn open_sync_setup_modal(
|
||||
mut events: MessageReader<SyncConfigureRequestEvent>,
|
||||
existing: Query<(), With<SyncSetupScreen>>,
|
||||
other_modal_scrims: Query<(), (With<ModalScrim>, Without<SyncSetupScreen>)>,
|
||||
// Exclude SettingsPanel: the Connect button closes settings in the same
|
||||
// frame it fires SyncConfigureRequestEvent, but Bevy despawns are deferred
|
||||
// so the settings scrim still exists in the world during this system.
|
||||
other_modal_scrims: Query<(), (With<ModalScrim>, Without<SyncSetupScreen>, Without<SettingsPanel>)>,
|
||||
mut commands: Commands,
|
||||
mut focused: ResMut<SyncFocusedField>,
|
||||
font_res: Option<Res<FontResource>>,
|
||||
|
||||
Reference in New Issue
Block a user