About popup
This commit is contained in:
+7
-1
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user