implements PLN-0058
This commit is contained in:
@@ -61,14 +61,15 @@ impl PrometeuHub {
|
||||
}
|
||||
|
||||
if let Some((title, rect, color)) = next_window {
|
||||
os.window_manager.remove_all_windows();
|
||||
let id = os.window_manager.add_window(title, rect, color);
|
||||
os.window_manager.set_focus(id);
|
||||
let mut window = os.window();
|
||||
window.remove_all_windows();
|
||||
let id = window.add_window(title, rect, color);
|
||||
window.set_focus(id);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn render(&mut self, os: &mut SystemOS, hw: &mut dyn HardwareBridge) {
|
||||
for window in &os.window_manager.windows {
|
||||
for window in os.window().windows() {
|
||||
hw.gfx_mut().fill_rect(
|
||||
window.viewport.x,
|
||||
window.viewport.y,
|
||||
@@ -90,17 +91,17 @@ impl PrometeuHub {
|
||||
|
||||
self.gui_update(os, hw);
|
||||
|
||||
if let Some(focused_id) = os.window_manager.focused {
|
||||
if let Some(focused_id) = os.window().focused_window() {
|
||||
if hw.pad().start().down {
|
||||
os.window_manager.remove_window(focused_id);
|
||||
os.window().close_window(focused_id);
|
||||
} else {
|
||||
crash = os.tick_vm(vm, signals, hw);
|
||||
crash = os.vm().tick(vm, signals, hw);
|
||||
}
|
||||
}
|
||||
|
||||
self.render(os, hw);
|
||||
hw.gfx_mut().present();
|
||||
|
||||
SystemProfileUpdate { crash, focused_window_active: os.window_manager.focused.is_some() }
|
||||
SystemProfileUpdate { crash, focused_window_active: os.window().focused_window().is_some() }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user