Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
PieKing1215 committed Sep 24, 2024
1 parent e729bfc commit cf01166
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 10 additions & 2 deletions src/tweaks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

Expand Down Expand Up @@ -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)
}

Expand Down
5 changes: 1 addition & 4 deletions src/tweaks/settings/toggle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
11 changes: 8 additions & 3 deletions src/tweaks/transform_edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,17 +315,22 @@ 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();
ui.text("Editor Placement Transform");
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);
Expand Down Expand Up @@ -360,7 +365,7 @@ impl Tweak for TransformEditTweak {
(*tr).rotation_mat3f_cur = next.map(|i| i as _);
}
}

self.check_orthonormal(&next);
}
}
Expand Down

0 comments on commit cf01166

Please sign in to comment.