Compare commits

...

2 commits

Author SHA1 Message Date
b19aa9eaaf Update Rust crate anyhow to 1.0.85
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 17m52s
2024-05-18 09:06:53 +00:00
7c62e62414 Some minor qol changes 2024-05-18 09:39:15 +02:00
5 changed files with 25 additions and 15 deletions

View file

@ -12,7 +12,7 @@ vulkan-rs = { git = "https://gavania.de/hodasemi/vulkan_lib.git" }
utilities = { git = "https://gavania.de/hodasemi/utilities.git" } utilities = { git = "https://gavania.de/hodasemi/utilities.git" }
paste = "1.0.15" paste = "1.0.15"
assetpath = { git = "https://gavania.de/hodasemi/vulkan_lib.git" } assetpath = { git = "https://gavania.de/hodasemi/vulkan_lib.git" }
anyhow = { version = "1.0.83", features = ["backtrace"] } anyhow = { version = "1.0.85", features = ["backtrace"] }
# optional # optional
audio = { git = "https://gavania.de/hodasemi/audio.git", optional = true } audio = { git = "https://gavania.de/hodasemi/audio.git", optional = true }

View file

@ -35,6 +35,7 @@ pub struct NeighbourInfo {
pub id: String, pub id: String,
} }
#[derive(Debug)]
pub struct ButtonInfo { pub struct ButtonInfo {
// global unique id, if set // global unique id, if set
pub id: String, pub id: String,

View file

@ -69,3 +69,12 @@ impl<T: Copy + Send + Sync> Mandatory<T> {
} }
} }
} }
impl<T: Send + Sync + std::fmt::Debug> std::fmt::Debug for Mandatory<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("Mandatory")
.field("value", &self.value)
.field("modified", &self.modified)
.finish()
}
}

View file

@ -581,9 +581,9 @@ impl Grid {
dim: (usize, usize), dim: (usize, usize),
) -> Result<bool> { ) -> Result<bool> {
match Self::search_neighbour_in_direction(grid, pos, (0, 1), dim) { match Self::search_neighbour_in_direction(grid, pos, (0, 1), dim) {
Some(north_neighbour) => { Some(neighbour) => {
current_child.set_south_neighbour(Some(&north_neighbour)); current_child.set_south_neighbour(Some(&neighbour));
north_neighbour.set_north_neighbour(Some(current_child)); neighbour.set_north_neighbour(Some(current_child));
Ok(true) Ok(true)
} }
@ -599,9 +599,9 @@ impl Grid {
dim: (usize, usize), dim: (usize, usize),
) -> Result<bool> { ) -> Result<bool> {
match Self::search_neighbour_in_direction(grid, pos, (0, -1), dim) { match Self::search_neighbour_in_direction(grid, pos, (0, -1), dim) {
Some(north_neighbour) => { Some(neighbour) => {
current_child.set_north_neighbour(Some(&north_neighbour)); current_child.set_north_neighbour(Some(&neighbour));
north_neighbour.set_south_neighbour(Some(current_child)); neighbour.set_south_neighbour(Some(current_child));
Ok(true) Ok(true)
} }
@ -617,9 +617,9 @@ impl Grid {
dim: (usize, usize), dim: (usize, usize),
) -> Result<bool> { ) -> Result<bool> {
match Self::search_neighbour_in_direction(grid, pos, (1, 0), dim) { match Self::search_neighbour_in_direction(grid, pos, (1, 0), dim) {
Some(north_neighbour) => { Some(neighbour) => {
current_child.set_east_neighbour(Some(&north_neighbour)); current_child.set_east_neighbour(Some(&neighbour));
north_neighbour.set_west_neighbour(Some(current_child)); neighbour.set_west_neighbour(Some(current_child));
Ok(true) Ok(true)
} }
@ -635,9 +635,9 @@ impl Grid {
dim: (usize, usize), dim: (usize, usize),
) -> Result<bool> { ) -> Result<bool> {
match Self::search_neighbour_in_direction(grid, pos, (-1, 0), dim) { match Self::search_neighbour_in_direction(grid, pos, (-1, 0), dim) {
Some(north_neighbour) => { Some(neighbour) => {
current_child.set_west_neighbour(Some(&north_neighbour)); current_child.set_west_neighbour(Some(&neighbour));
north_neighbour.set_east_neighbour(Some(current_child)); neighbour.set_east_neighbour(Some(current_child));
Ok(true) Ok(true)
} }

View file

@ -735,7 +735,7 @@ impl GuiHandler {
Ok(false) Ok(false)
} }
fn current_selectable(&self) -> Result<Option<Arc<Selectable>>> { pub fn current_selectable(&self) -> Result<Option<Arc<Selectable>>> {
match self.current_selectable.read().unwrap().as_ref() { match self.current_selectable.read().unwrap().as_ref() {
Some(selectable) => Ok(Some(selectable.clone())), Some(selectable) => Ok(Some(selectable.clone())),
None => Ok(None), None => Ok(None),
@ -1268,7 +1268,7 @@ impl GuiHandler {
} }
} }
// private // private - create rendering stuff
impl GuiHandler { impl GuiHandler {
fn create_render_targets( fn create_render_targets(
device: &Arc<Device>, device: &Arc<Device>,