diff --git a/Cargo.lock b/Cargo.lock
index 1ca0bd6..bf36244 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -72,6 +72,12 @@ dependencies = [
"winit",
]
+[[package]]
+name = "adler"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+
[[package]]
name = "ahash"
version = "0.8.11"
@@ -1503,6 +1509,15 @@ dependencies = [
"windows 0.54.0",
]
+[[package]]
+name = "crc32fast"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa"
+dependencies = [
+ "cfg-if",
+]
+
[[package]]
name = "crossbeam-channel"
version = "0.5.12"
@@ -1739,6 +1754,15 @@ version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984"
+[[package]]
+name = "fdeflate"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645"
+dependencies = [
+ "simd-adler32",
+]
+
[[package]]
name = "file-id"
version = "0.2.1"
@@ -1766,6 +1790,16 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
+[[package]]
+name = "flate2"
+version = "1.0.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e"
+dependencies = [
+ "crc32fast",
+ "miniz_oxide",
+]
+
[[package]]
name = "foreign-types"
version = "0.5.0"
@@ -2086,6 +2120,7 @@ dependencies = [
"color_quant",
"jpeg-decoder",
"num-traits",
+ "png",
]
[[package]]
@@ -2392,6 +2427,16 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
+[[package]]
+name = "miniz_oxide"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
+dependencies = [
+ "adler",
+ "simd-adler32",
+]
+
[[package]]
name = "mio"
version = "0.8.11"
@@ -2903,6 +2948,19 @@ version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
+[[package]]
+name = "png"
+version = "0.17.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1"
+dependencies = [
+ "bitflags 1.3.2",
+ "crc32fast",
+ "fdeflate",
+ "flate2",
+ "miniz_oxide",
+]
+
[[package]]
name = "polling"
version = "3.5.0"
@@ -3286,6 +3344,12 @@ dependencies = [
"wide",
]
+[[package]]
+name = "simd-adler32"
+version = "0.3.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
+
[[package]]
name = "slab"
version = "0.4.9"
diff --git a/Cargo.toml b/Cargo.toml
index 48644bb..c6f188b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,7 @@ rust-version = "1.76.0"
[dependencies]
regex = "1"
-bevy = { version = "0.13.2", default-features = false, features = ["animation", "bevy_asset", "bevy_audio", "bevy_scene", "bevy_winit", "bevy_core_pipeline", "bevy_pbr", "bevy_gltf", "bevy_render", "bevy_text", "bevy_ui", "jpeg", "multi-threaded", "tonemapping_luts", "vorbis"]}
+bevy = { version = "0.13.2", default-features = false, features = ["animation", "bevy_asset", "bevy_audio", "bevy_scene", "bevy_winit", "bevy_core_pipeline", "bevy_pbr", "bevy_gltf", "bevy_render", "bevy_text", "bevy_ui", "jpeg", "multi-threaded", "png", "tonemapping_luts", "vorbis"]}
bevy_xpbd_3d = { version = "0.4.2", default-features = false, features = ["3d", "f64", "parry-f64", "parallel", "async-collider"] }
bevy_embedded_assets = { version = "0.10.2", optional = true }
fastrand = "2.0"
diff --git a/assets/sprites/reticule.png b/assets/sprites/reticule.png
new file mode 100644
index 0000000..1eb89a2
Binary files /dev/null and b/assets/sprites/reticule.png differ
diff --git a/assets/sprites/reticule2.png b/assets/sprites/reticule2.png
new file mode 100644
index 0000000..d97afb1
Binary files /dev/null and b/assets/sprites/reticule2.png differ
diff --git a/assets/sprites/reticule3.png b/assets/sprites/reticule3.png
new file mode 100644
index 0000000..4db6e86
Binary files /dev/null and b/assets/sprites/reticule3.png differ
diff --git a/media/reticule.svg b/media/reticule.svg
new file mode 100644
index 0000000..0bfb176
--- /dev/null
+++ b/media/reticule.svg
@@ -0,0 +1,74 @@
+
+
+
+
diff --git a/media/reticule2.svg b/media/reticule2.svg
new file mode 100644
index 0000000..7f9bfc5
--- /dev/null
+++ b/media/reticule2.svg
@@ -0,0 +1,129 @@
+
+
+
+
diff --git a/media/reticule3.svg b/media/reticule3.svg
new file mode 100644
index 0000000..80bddb4
--- /dev/null
+++ b/media/reticule3.svg
@@ -0,0 +1,90 @@
+
+
+
+
diff --git a/src/hud.rs b/src/hud.rs
index 081b25f..b0db0af 100644
--- a/src/hud.rs
+++ b/src/hud.rs
@@ -290,23 +290,31 @@ fn setup(
});
// Add Reticule
- commands.spawn((
- Reticule,
- ToggleableHudElement,
- NodeBundle {
- style: Style {
- width: Val::Px(2.0),
- height: Val::Px(2.0),
- position_type: PositionType::Absolute,
- top: Val::Vh(50.0),
- left: Val::Vw(50.0),
- ..default()
- },
- visibility,
- background_color: Color::rgb(0.4, 0.4, 0.6).into(),
+ let reticule_handle: Handle = asset_server.load("sprites/reticule3.png");
+ commands.spawn(NodeBundle {
+ style: Style {
+ width: Val::Percent(100.0),
+ height: Val::Percent(100.0),
+ align_items: AlignItems::Center,
+ justify_content: JustifyContent::SpaceAround,
..default()
},
- ));
+ ..default()
+ }).with_children(|builder| {
+ builder.spawn((
+ ImageBundle {
+ image: UiImage::new(reticule_handle),
+ style: Style {
+ width: Val::VMin(3.0),
+ height: Val::VMin(3.0),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ ToggleableHudElement,
+ Reticule,
+ ));
+ });
// Chat "subtitles" and choices
commands.spawn(NodeBundle {