Skip to content

Commit

Permalink
Remove debug ui
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmauro committed Apr 8, 2024
1 parent efbd85f commit 1d9ea5c
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions src/game/ui/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use bevy::prelude::*;
use bevy_egui::{egui, EguiContexts};

use crate::state::{AppState, OnGameScreen};

Expand All @@ -8,10 +7,7 @@ use self::{
text::{round_system, CurrentRoundText},
};

use super::{
core::{cue::CueEngine, round::Round, score::Score, state::GameState},
settings::GameSettings,
};
use super::settings::GameSettings;

pub mod button;
pub mod text;
Expand Down Expand Up @@ -178,27 +174,3 @@ pub fn setup(mut commands: Commands, settings: Res<GameSettings>, asset_server:
});
});
}

/// Debug interface.
pub fn debug_ui(
mut egui_context: EguiContexts,
mut query: Query<(&CueEngine, &Round, &Score, &mut GameState)>,
) {
if let Ok((engine, round, score, mut state)) = query.get_single_mut() {
egui::Window::new("debug").show(egui_context.ctx_mut(), |ui| {
ui.label(format!("N-back: {}", engine.n()));
ui.label(format!("Correct: {}", score.correct()));
ui.label(format!("Wrong: {}", score.wrong()));
ui.label(format!("Answer: {:?}", round.answer));
ui.label(format!("Score: {}", score.f1_score_percent()));

if ui.button("Play").clicked() {
*state = GameState::Playing;
}

if ui.button("Pause").clicked() {
*state = GameState::Paused;
}
});
}
}

0 comments on commit 1d9ea5c

Please sign in to comment.