Rewrite VIP tools to not mutate context

This commit is contained in:
2026-03-29 22:37:46 -04:00
parent 8f6a6f86db
commit 341de60816
8 changed files with 187 additions and 191 deletions
+4 -2
View File
@@ -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,
}