diff --git a/src/common/consts.rs b/src/common/consts.rs index 7d308bc..12bf7e4 100644 --- a/src/common/consts.rs +++ b/src/common/consts.rs @@ -2,21 +2,6 @@ use crate::common::get_random_int; use core::f64::consts::PI; use smash::lib::lua_const::*; -/// Hitbox Visualization -#[repr(i32)] -#[derive(Debug, Clone, Copy, PartialEq)] -pub enum HitboxVisualization { - Off = 0, - On = 1, -} - -#[repr(i32)] -#[derive(Debug, Clone, Copy, PartialEq)] -pub enum StageHazards { - Off = 0, - On = 1, -} - // bitflag helper function macro macro_rules! to_vec_impl { ($e:ty) => { @@ -314,8 +299,8 @@ impl BoolFlag { #[repr(C)] pub struct TrainingModpackMenu { - pub hitbox_vis: HitboxVisualization, - pub stage_hazards: StageHazards, + pub hitbox_vis: OnOff, + pub stage_hazards: OnOff, pub di_state: Direction, pub sdi_state: Direction, pub air_dodge_dir: Direction, diff --git a/src/common/mod.rs b/src/common/mod.rs index ae9eb74..e9bf32a 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -6,8 +6,8 @@ use smash::hash40; use smash::lib::lua_const::*; pub static mut MENU_STRUCT: consts::TrainingModpackMenu = consts::TrainingModpackMenu { - hitbox_vis: HitboxVisualization::On, - stage_hazards: StageHazards::Off, + hitbox_vis: OnOff::On, + stage_hazards: OnOff::Off, di_state: Direction::empty(), sdi_state: Direction::empty(), air_dodge_dir: Direction::empty(), diff --git a/src/hazard_manager/mod.rs b/src/hazard_manager/mod.rs index c7c23c0..89becd8 100644 --- a/src/hazard_manager/mod.rs +++ b/src/hazard_manager/mod.rs @@ -93,7 +93,7 @@ fn hazard_intercept(ctx: &skyline::hooks::InlineCtx) { fn mod_handle_hazards() { unsafe { - *HAZARD_FLAG_ADDRESS = (MENU.stage_hazards == StageHazards::On) as u8; + *HAZARD_FLAG_ADDRESS = (MENU.stage_hazards == OnOff::On) as u8; } } diff --git a/src/hitbox_visualizer/mod.rs b/src/hitbox_visualizer/mod.rs index af9dea5..c3f35a0 100644 --- a/src/hitbox_visualizer/mod.rs +++ b/src/hitbox_visualizer/mod.rs @@ -157,7 +157,7 @@ pub unsafe fn get_command_flag_cat(module_accessor: &mut app::BattleObjectModule // Resume Effect AnimCMD incase we don't display hitboxes MotionAnimcmdModule::set_sleep_effect(module_accessor, false); - if MENU.hitbox_vis == HitboxVisualization::Off { + if MENU.hitbox_vis == OnOff::Off { return; } @@ -230,7 +230,7 @@ unsafe fn mod_handle_attack(lua_state: u64) { } // Hitbox Visualization - if MENU.hitbox_vis == HitboxVisualization::On { + if MENU.hitbox_vis == OnOff::On { // get all necessary grabbox params let id = l2c_agent.pop_lua_stack(1); // int let joint = l2c_agent.pop_lua_stack(3); // hash40 @@ -276,7 +276,7 @@ unsafe fn handle_catch(lua_state: u64) { } unsafe fn mod_handle_catch(lua_state: u64) { - if MENU.hitbox_vis == HitboxVisualization::Off { + if MENU.hitbox_vis == OnOff::Off { return; }