Skip to content

Commit

Permalink
Prevents Exit button from being compiled in WASM builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mnmaita committed Nov 19, 2023
1 parent c67045a commit 5c89c5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Plugin for MainMenuPlugin {
enum MainMenuButtonAction {
NewGame,
Settings,
// TODO: Do not compile in WASM builds
#[cfg(not(target_family = "wasm"))]
Exit,
}

Expand Down Expand Up @@ -91,7 +91,7 @@ fn setup_main_menu(mut commands: Commands) {
});
});

// TODO: Do not compile in WASM builds
#[cfg(not(target_family = "wasm"))]
node.spawn((
ButtonBundle {
background_color: Color::ALICE_BLUE.into(),
Expand Down Expand Up @@ -123,7 +123,7 @@ fn handle_main_menu_button_interactions(
for (interaction, main_menu_button_action) in query.iter() {
match interaction {
Interaction::Pressed => match main_menu_button_action {
// TODO: Do not compile in WASM builds
#[cfg(not(target_family = "wasm"))]
MainMenuButtonAction::Exit => exit.send(AppExit),
MainMenuButtonAction::NewGame => app_state.set(AppState::InGame),
MainMenuButtonAction::Settings => (),
Expand Down

0 comments on commit 5c89c5d

Please sign in to comment.