diff --git a/src/lib.rs b/src/lib.rs index 9e9e31c..af3978d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -216,7 +216,6 @@ impl ImguiRenderLoop for MainHud { style_padding.end(); for (tw, _) in &mut self.tweaks { - if let Err(e) = tw.constant_render(ui) { self.errors.push(e); self.show = true; diff --git a/src/tweaks/mod.rs b/src/tweaks/mod.rs index c449fd5..3009c9f 100644 --- a/src/tweaks/mod.rs +++ b/src/tweaks/mod.rs @@ -39,7 +39,11 @@ pub trait Tweak { Ok(()) } - fn render_category(&mut self, _ui: &hudhook::imgui::Ui, _category: Option<&str>) -> anyhow::Result<()> { + fn render_category( + &mut self, + _ui: &hudhook::imgui::Ui, + _category: Option<&str>, + ) -> anyhow::Result<()> { Ok(()) } @@ -125,7 +129,11 @@ impl TweakWrapper { Ok(()) } - pub fn render_category(&mut self, ui: &hudhook::imgui::Ui, category: Option<&str>) -> anyhow::Result<()> { + pub fn render_category( + &mut self, + ui: &hudhook::imgui::Ui, + category: Option<&str>, + ) -> anyhow::Result<()> { self.inner.render_category(ui, category) } diff --git a/src/tweaks/settings/toggle.rs b/src/tweaks/settings/toggle.rs index c8cb328..645844d 100644 --- a/src/tweaks/settings/toggle.rs +++ b/src/tweaks/settings/toggle.rs @@ -67,10 +67,7 @@ impl<'b, 'r> ToggleBuilder<'b, 'r> { } #[must_use] - pub fn on_value_changed( - mut self, - callback: impl FnMut(bool) + Send + Sync + 'static, - ) -> Self { + pub fn on_value_changed(mut self, callback: impl FnMut(bool) + Send + Sync + 'static) -> Self { self.toggle.value_changed_listeners.push(Box::new(callback)); self } diff --git a/src/tweaks/transform_edit.rs b/src/tweaks/transform_edit.rs index be59ce4..f6f0665 100644 --- a/src/tweaks/transform_edit.rs +++ b/src/tweaks/transform_edit.rs @@ -315,7 +315,11 @@ impl Tweak for TransformEditTweak { Ok(()) } - fn render_category(&mut self, ui: &hudhook::imgui::Ui, category: Option<&str>) -> anyhow::Result<()> { + fn render_category( + &mut self, + ui: &hudhook::imgui::Ui, + category: Option<&str>, + ) -> anyhow::Result<()> { if category.is_none() { if let Some(tr) = unsafe { TRANSFORM } { ui.separator(); @@ -323,9 +327,10 @@ impl Tweak for TransformEditTweak { if ui.is_item_hovered() { ui.tooltip_text("These numbers represent the rotation matrix of the component being placed (same as in XML).\nYou can also increment (or hold Alt to decrement) using the Numpad (make sure NumLock is on).\nNumpad 0 resets the matrix."); } - + let mut next = unsafe { (*tr).rotation_mat3i_cur }; let mut changed = false; + #[allow(clippy::identity_op)] for r in 0..3 { ui.set_next_item_width(80.0); @@ -360,7 +365,7 @@ impl Tweak for TransformEditTweak { (*tr).rotation_mat3f_cur = next.map(|i| i as _); } } - + self.check_orthonormal(&next); } }