About popup

This commit is contained in:
2024-12-15 00:00:22 -05:00
parent e31269368d
commit c694d234e7
6 changed files with 71 additions and 24 deletions
+7 -1
View File
@@ -18,7 +18,7 @@ use crate::{
emulator::{EmulatorClient, EmulatorCommand, SimId},
input::MappingProvider,
persistence::Persistence,
window::{AppWindow, GameWindow, InputWindow},
window::{AboutWindow, AppWindow, GameWindow, InputWindow},
};
fn load_icon() -> anyhow::Result<IconData> {
@@ -179,6 +179,10 @@ impl ApplicationHandler<UserEvent> for Application {
};
viewport.app.handle_gamepad_event(&event);
}
UserEvent::OpenAbout => {
let about = AboutWindow;
self.open(event_loop, Box::new(about));
}
UserEvent::OpenInput => {
let input = InputWindow::new(self.mappings.clone());
self.open(event_loop, Box::new(input));
@@ -254,6 +258,7 @@ impl Viewport {
s.wrap_mode = Some(TextWrapMode::Extend);
s.visuals.menu_rounding = Default::default();
});
egui_extras::install_image_loaders(&ctx);
let mut info = ViewportInfo::default();
let mut builder = app.initial_viewport();
@@ -365,6 +370,7 @@ impl Drop for Viewport {
#[derive(Debug)]
pub enum UserEvent {
GamepadEvent(gilrs::Event),
OpenAbout,
OpenInput,
OpenPlayer2,
}