Rewrite VIP tools to not mutate context
This commit is contained in:
+4
-2
@@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
pub use about::AboutWindow;
|
||||
use egui::{Context, Ui, ViewportBuilder, ViewportId};
|
||||
use egui::{Ui, ViewportBuilder, ViewportId};
|
||||
pub use game::GameWindow;
|
||||
pub use game_screen::DisplayMode;
|
||||
pub use gdb::GdbServerWindow;
|
||||
@@ -32,6 +32,9 @@ 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) {
|
||||
@@ -49,7 +52,6 @@ pub trait AppWindow {
|
||||
}
|
||||
|
||||
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