Pass window to file picker
This commit is contained in:
+11
-4
@@ -1,3 +1,5 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
pub use about::AboutWindow;
|
||||
use egui::{Context, ViewportBuilder, ViewportId};
|
||||
pub use game::GameWindow;
|
||||
@@ -9,7 +11,7 @@ pub use terminal::TerminalWindow;
|
||||
pub use vip::{
|
||||
BgMapWindow, CharacterDataWindow, FrameBufferWindow, ObjectWindow, RegisterWindow, WorldWindow,
|
||||
};
|
||||
use winit::event::KeyEvent;
|
||||
use winit::{event::KeyEvent, window::Window};
|
||||
|
||||
use crate::emulator::SimId;
|
||||
|
||||
@@ -31,9 +33,8 @@ pub trait AppWindow {
|
||||
}
|
||||
fn initial_viewport(&self) -> ViewportBuilder;
|
||||
fn show(&mut self, ctx: &Context);
|
||||
fn on_init(&mut self, ctx: &Context, render_state: &egui_wgpu::RenderState) {
|
||||
let _ = ctx;
|
||||
let _ = render_state;
|
||||
fn on_init(&mut self, args: InitArgs) {
|
||||
let _ = args;
|
||||
}
|
||||
fn on_destroy(&mut self) {}
|
||||
fn handle_key_event(&mut self, event: &KeyEvent) -> bool {
|
||||
@@ -45,3 +46,9 @@ pub trait AppWindow {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
pub struct InitArgs<'a> {
|
||||
pub ctx: &'a Context,
|
||||
pub window: &'a Arc<Window>,
|
||||
pub render_state: &'a egui_wgpu::RenderState,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user