lemur/src/window.rs

56 lines
1.3 KiB
Rust

use std::sync::Arc;
pub use about::AboutWindow;
use egui::{Ui, ViewportBuilder};
pub use game::{ChildWindow, GameWindow};
pub use game_screen::{DisplayMode, GameScreen};
pub use gdb::GdbServerWindow;
pub use hotkeys::HotkeysWindow;
pub use input::InputWindow;
pub use profile::ProfileWindow;
pub use terminal::TerminalWindow;
pub use vip::{
BgMapWindow, CharacterDataWindow, FrameBufferWindow, ObjectWindow, RegisterWindow, WorldWindow,
};
use winit::{event::KeyEvent, window::Window};
use crate::emulator::SimId;
mod about;
mod game;
mod game_screen;
mod gdb;
mod hotkeys;
mod input;
mod profile;
mod terminal;
mod utils;
mod vip;
pub trait AppWindow {
fn sim_id(&self) -> SimId {
SimId::Player1
}
fn image_url(&self, name: &str) -> String {
format!("vip://{}/{name}", self.sim_id())
}
fn initial_viewport(&self) -> ViewportBuilder;
fn show(&mut self, ui: &mut Ui);
fn on_init(&mut self, args: InitArgs) {
let _ = args;
}
fn handle_key_event(&mut self, event: &KeyEvent) -> bool {
let _ = event;
false
}
fn handle_gamepad_event(&mut self, event: &gilrs::Event) -> bool {
let _ = event;
false
}
}
pub struct InitArgs<'a> {
pub window: &'a Arc<Window>,
pub render_state: &'a egui_wgpu::RenderState,
}