omg big commit

This commit is contained in:
galister
2024-02-20 20:54:06 +01:00
parent 65fa9d1fae
commit d31b3ca6c0
15 changed files with 441 additions and 123 deletions

View File

@@ -16,6 +16,7 @@ use crate::{
common::{OverlayContainer, TaskType},
input::interact,
openxr::{input::DoubleClickCounter, lines::LinePool, overlay::OpenXrOverlayData},
overlay::OverlayData,
},
graphics::WlxGraphics,
overlays::watch::{watch_fade, WATCH_NAME},
@@ -187,6 +188,24 @@ pub fn openxr_run(running: Arc<AtomicBool>) -> Result<(), BackendError> {
f(&mut app_state, &mut o.state);
}
}
TaskType::CreateOverlay(sel, f) => {
let None = overlays.mut_by_selector(&sel) else {
continue;
};
let Some((state, backend)) = f(&mut app_state) else {
continue;
};
overlays.add(OverlayData {
state,
backend,
..Default::default()
});
}
TaskType::DropOverlay(sel) => {
overlays.drop_by_selector(&sel);
}
TaskType::Toast(t) => {
// TODO toasts
log::info!("Toast: {} {}", t.title, t.body);