Compare commits
2 Commits
79a19a5748
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c3ff6294c8 | |||
| c15c037771 |
20
Cargo.lock
generated
20
Cargo.lock
generated
@@ -203,7 +203,7 @@ version = "1.1.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -214,7 +214,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"anstyle",
|
"anstyle",
|
||||||
"once_cell_polyfill",
|
"once_cell_polyfill",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2403,7 +2403,7 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"option-ext",
|
"option-ext",
|
||||||
"redox_users",
|
"redox_users",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.59.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2650,7 +2650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3924,7 +3924,7 @@ version = "0.50.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
|
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.59.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4365,7 +4365,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "otd-ipc"
|
name = "otd-ipc"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://git.avii.nl/Avii/otd-ipc-rs.git#ae15494e857ba93e63055e76da7105dd78b17610"
|
source = "git+https://git.avii.nl/Avii/otd-ipc-rs.git#bb3892a239412d95b954adb795407d6d0a244f07"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"dirs",
|
"dirs",
|
||||||
@@ -4953,7 +4953,7 @@ dependencies = [
|
|||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys 0.11.0",
|
"linux-raw-sys 0.11.0",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5320,10 +5320,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1"
|
checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fastrand",
|
"fastrand",
|
||||||
"getrandom 0.4.1",
|
"getrandom 0.3.4",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.3",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -6183,7 +6183,7 @@ version = "0.1.11"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
use bevy::{
|
use bevy::{
|
||||||
asset::{Asset, Handle},
|
asset::{Asset, Handle, uuid_handle},
|
||||||
image::Image,
|
image::Image,
|
||||||
pbr::{ExtendedMaterial, MaterialExtension, StandardMaterial},
|
pbr::{ExtendedMaterial, MaterialExtension, StandardMaterial},
|
||||||
reflect::TypePath,
|
reflect::TypePath,
|
||||||
render::render_resource::AsBindGroup,
|
render::render_resource::AsBindGroup,
|
||||||
shader::ShaderRef,
|
shader::{Shader, ShaderRef},
|
||||||
};
|
};
|
||||||
|
|
||||||
const SHADER_ASSET_PATH: &str = "shaders/shader.wgsl";
|
// const SHADER_ASSET_PATH: &str = "shaders/shader.wgsl";
|
||||||
|
pub const FRAGMENT_SHADER_HANDLE: Handle<Shader> =
|
||||||
|
uuid_handle!("b70d4f0f-8873-4b2a-bc6f-35b0e3e25e02");
|
||||||
|
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
pub struct CustomMaterial {
|
pub struct CustomMaterial {
|
||||||
@@ -24,7 +26,7 @@ pub struct CustomMaterial {
|
|||||||
/// You only need to implement functions for features that need non-default behavior. See the Material api docs for details!
|
/// You only need to implement functions for features that need non-default behavior. See the Material api docs for details!
|
||||||
impl MaterialExtension for CustomMaterial {
|
impl MaterialExtension for CustomMaterial {
|
||||||
fn fragment_shader() -> ShaderRef {
|
fn fragment_shader() -> ShaderRef {
|
||||||
SHADER_ASSET_PATH.into()
|
FRAGMENT_SHADER_HANDLE.into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use std::f32::consts::{FRAC_PI_2, PI};
|
|||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
app::{App, Plugin, Startup, Update},
|
app::{App, Plugin, Startup, Update},
|
||||||
asset::{Assets, Handle},
|
asset::{Assets, Handle, load_internal_asset},
|
||||||
camera::{Camera, Camera3d, RenderTarget, visibility::RenderLayers},
|
camera::{Camera, Camera3d, RenderTarget, visibility::RenderLayers},
|
||||||
color::{Color, palettes::css},
|
color::{Color, palettes::css},
|
||||||
ecs::{
|
ecs::{
|
||||||
@@ -24,6 +24,7 @@ use bevy::{
|
|||||||
pbr::{MaterialPlugin, MeshMaterial3d, StandardMaterial},
|
pbr::{MaterialPlugin, MeshMaterial3d, StandardMaterial},
|
||||||
prelude::{Deref, DerefMut},
|
prelude::{Deref, DerefMut},
|
||||||
render::render_resource::{Extent3d, TextureUsages},
|
render::render_resource::{Extent3d, TextureUsages},
|
||||||
|
shader::Shader,
|
||||||
transform::components::Transform,
|
transform::components::Transform,
|
||||||
utils::default,
|
utils::default,
|
||||||
};
|
};
|
||||||
@@ -45,7 +46,7 @@ pub use crate::apad::otdipcplugin::TabletRotation;
|
|||||||
use crate::{
|
use crate::{
|
||||||
MainCamera,
|
MainCamera,
|
||||||
apad::{
|
apad::{
|
||||||
custom_material::{CustomMaterial, MyCustomMaterial},
|
custom_material::{CustomMaterial, FRAGMENT_SHADER_HANDLE, MyCustomMaterial},
|
||||||
keyboard::VirtualKeyboard,
|
keyboard::VirtualKeyboard,
|
||||||
otdipcplugin::{OtdIpcPlugin, PenButtons, PenDelta, PenPosition},
|
otdipcplugin::{OtdIpcPlugin, PenButtons, PenDelta, PenPosition},
|
||||||
},
|
},
|
||||||
@@ -119,7 +120,6 @@ impl Plugin for APadPlugin {
|
|||||||
.init_persistent_resource::<KneeboardNotepad>();
|
.init_persistent_resource::<KneeboardNotepad>();
|
||||||
|
|
||||||
app.insert_resource(TabletSize(Vec2::new(210.0, 279.0)));
|
app.insert_resource(TabletSize(Vec2::new(210.0, 279.0)));
|
||||||
// app.insert_resource(TabletResolutionScale(2.25));
|
|
||||||
app.insert_resource(TabletResolutionScale(2.5));
|
app.insert_resource(TabletResolutionScale(2.5));
|
||||||
app.insert_resource(PointerImage(None));
|
app.insert_resource(PointerImage(None));
|
||||||
app.insert_resource(Name("".to_string()));
|
app.insert_resource(Name("".to_string()));
|
||||||
@@ -141,6 +141,13 @@ impl Plugin for APadPlugin {
|
|||||||
.add_systems(Update, update_pointer.in_set(EguiInputSet::WriteEguiEvents))
|
.add_systems(Update, update_pointer.in_set(EguiInputSet::WriteEguiEvents))
|
||||||
.add_systems(Update, render_pointer)
|
.add_systems(Update, render_pointer)
|
||||||
.add_systems(WorldspaceContextPass, update);
|
.add_systems(WorldspaceContextPass, update);
|
||||||
|
|
||||||
|
load_internal_asset!(
|
||||||
|
app,
|
||||||
|
FRAGMENT_SHADER_HANDLE,
|
||||||
|
"../../assets/shaders/shader.wgsl",
|
||||||
|
Shader::from_wgsl
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
|
|
||||||
|
use std::{thread::sleep, time::Duration};
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
app::{App, Plugin, PreUpdate},
|
app::{App, Plugin, PreUpdate},
|
||||||
ecs::{
|
ecs::{
|
||||||
@@ -69,11 +71,22 @@ impl Plugin for OtdIpcPlugin {
|
|||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
let (mut tx, rx) = triple_buffer(&None);
|
let (mut tx, rx) = triple_buffer(&None);
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
let otd_ipc = OtdIpc::new("Kneeboard", "master").unwrap();
|
loop {
|
||||||
|
let Ok(otd_ipc) = OtdIpc::new("Kneeboard", "master") else {
|
||||||
|
sleep(Duration::from_secs(1));
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
|
||||||
for msg in otd_ipc {
|
for msg in otd_ipc {
|
||||||
|
let Ok(msg) = msg else {
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
|
||||||
tx.write(Some(msg));
|
tx.write(Some(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sleep(Duration::from_secs(1));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
app.add_message::<PenDelta>();
|
app.add_message::<PenDelta>();
|
||||||
app.add_message::<PenPosition>();
|
app.add_message::<PenPosition>();
|
||||||
@@ -88,7 +101,6 @@ impl Plugin for OtdIpcPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
|
||||||
fn reader(
|
fn reader(
|
||||||
rotation: Res<TabletRotation>,
|
rotation: Res<TabletRotation>,
|
||||||
mut last_position: ResMut<LastPosition>,
|
mut last_position: ResMut<LastPosition>,
|
||||||
|
|||||||
@@ -26,9 +26,16 @@ pub fn ordnance(ui: &mut Ui, data: &Res<Ordnance>, overview: &Res<super::Overvie
|
|||||||
.size
|
.size
|
||||||
.max(ui.spacing().interact_size.y);
|
.max(ui.spacing().interact_size.y);
|
||||||
|
|
||||||
let mut cols = Vec::new();
|
let mut amount_cols = 0;
|
||||||
|
|
||||||
for _ in &data.flights {
|
for group in &data.flights {
|
||||||
|
if group.len() > amount_cols {
|
||||||
|
amount_cols = group.len();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut cols = Vec::new();
|
||||||
|
for _ in 0..amount_cols {
|
||||||
cols.push(("", Column::remainder()));
|
cols.push(("", Column::remainder()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user