Compare commits
2 commits
540b3b8165
...
e90ae8e1cb
Author | SHA1 | Date | |
---|---|---|---|
e90ae8e1cb | |||
8b7f68232e |
2 changed files with 8 additions and 10 deletions
|
@ -5,7 +5,7 @@ authors = ["hodasemi <michaelh.95@t-online.de>"]
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
quick-xml = "0.31.0"
|
quick-xml = "0.37.0"
|
||||||
serde = { version = "1.0.203", features = ["derive"] }
|
serde = { version = "1.0.203", features = ["derive"] }
|
||||||
serde_json = { version = "1.0.120" }
|
serde_json = { version = "1.0.120" }
|
||||||
paste = "1.0.15"
|
paste = "1.0.15"
|
||||||
|
|
|
@ -729,13 +729,14 @@ impl GuiHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn accept_custom_selection(
|
pub fn accept_custom_selection(
|
||||||
&self,
|
&mut self,
|
||||||
commands: &mut Commands,
|
commands: &mut Commands,
|
||||||
gui_handler: &mut GuiHandler,
|
|
||||||
button: ControllerButton,
|
button: ControllerButton,
|
||||||
) -> Result<bool> {
|
) -> Result<bool> {
|
||||||
|
let callback_self = unsafe { remove_life_time_mut(self) };
|
||||||
|
|
||||||
if let Some(current_selectable) = &self.current_selectable {
|
if let Some(current_selectable) = &self.current_selectable {
|
||||||
if current_selectable.custom_click_event(commands, gui_handler, button)? {
|
if current_selectable.custom_click_event(commands, callback_self, button)? {
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -934,16 +935,13 @@ impl GuiHandler {
|
||||||
self.callback_list.push(Box::new(f));
|
self.callback_list.push(Box::new(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn process_callbacks(
|
pub fn process_callbacks(&mut self, commands: &mut Commands) -> Result<()> {
|
||||||
&mut self,
|
let callback_self = unsafe { remove_life_time_mut(self) };
|
||||||
commands: &mut Commands,
|
|
||||||
gui_handler: &mut GuiHandler,
|
|
||||||
) -> Result<()> {
|
|
||||||
let callbacks = mem::take(&mut self.callback_list);
|
let callbacks = mem::take(&mut self.callback_list);
|
||||||
|
|
||||||
callbacks
|
callbacks
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.try_for_each(|callback| callback(commands, gui_handler))
|
.try_for_each(|callback| callback(commands, callback_self))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(
|
fn render(
|
||||||
|
|
Loading…
Reference in a new issue