Compare commits

..

1 commit

Author SHA1 Message Date
540b3b8165 Update Rust crate quick-xml to 0.37.0
Some checks failed
Gavania Merge Build / build (pull_request) Has been cancelled
2025-04-10 06:05:14 +00:00

View file

@ -729,14 +729,13 @@ impl GuiHandler {
} }
pub fn accept_custom_selection( pub fn accept_custom_selection(
&mut self, &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, callback_self, button)? { if current_selectable.custom_click_event(commands, gui_handler, button)? {
return Ok(true); return Ok(true);
} }
} }
@ -935,13 +934,16 @@ impl GuiHandler {
self.callback_list.push(Box::new(f)); self.callback_list.push(Box::new(f));
} }
pub fn process_callbacks(&mut self, commands: &mut Commands) -> Result<()> { pub fn process_callbacks(
let callback_self = unsafe { remove_life_time_mut(self) }; &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, callback_self)) .try_for_each(|callback| callback(commands, gui_handler))
} }
fn render( fn render(