1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2025-03-14 02:16:10 +00:00

Rename Enum

DirectionalInfluence => Direction
This commit is contained in:
sidschingis 2020-06-13 21:24:15 +02:00
parent 919196c38b
commit 18290df236
3 changed files with 32 additions and 6 deletions

View file

@ -17,10 +17,36 @@ pub enum HitboxVisualization {
/// DI
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum DirectionalInfluence {
pub enum Direction {
None = 0,
Right =1,
UpRight = 2,
Up = 3,
UpLeft = 4,
Left = 5,
DownLeft = 6,
Down = 7,
DownRight = 8,
// lol what goes here jug smh my head
RandomInAway = 9,
Random = 9,
}
impl From<i32> for Direction {
fn from(x: i32) -> Self {
match x {
0 => Direction::None,
1 => Direction::Right,
2 => Direction::UpRight,
3 => Direction::Up,
4 => Direction::UpLeft,
5 => Direction::Left,
6 => Direction::DownLeft,
7 => Direction::Down,
8 => Direction::DownRight,
9 => Direction::Random,
_ => panic!("Invalid direction {}", x),
}
}
}
/// Mash Attack States
@ -220,7 +246,7 @@ pub enum MashInNeutral {
#[repr(C)]
pub struct TrainingModpackMenu {
pub hitbox_vis: HitboxVisualization,
pub di_state: DirectionalInfluence,
pub di_state: Direction,
pub mash_attack_state: Attack,
pub ledge_state: LedgeOption,
pub tech_state: TechOption,

View file

@ -7,7 +7,7 @@ use smash::lib::lua_const::*;
pub static mut MENU_STRUCT: consts::TrainingModpackMenu = consts::TrainingModpackMenu {
hitbox_vis: HitboxVisualization::On,
di_state: DirectionalInfluence::None,
di_state: Direction::None,
mash_attack_state: Attack::Nair,
ledge_state: LedgeOption::Random,
tech_state: TechOption::Random,

View file

@ -24,7 +24,7 @@ unsafe fn mod_handle_di(fighter: &mut L2CFighterCommon, _arg1: L2CValue) {
return;
}
if MENU.di_state == DirectionalInfluence::None {
if MENU.di_state == Direction::None {
return;
}
@ -34,7 +34,7 @@ unsafe fn mod_handle_di(fighter: &mut L2CFighterCommon, _arg1: L2CValue) {
}
// Either left, right, or none
if MENU.di_state == DirectionalInfluence::RandomInAway {
if MENU.di_state == Direction::Random {
DI_ANGLE = get_random_di();
} else {
DI_ANGLE = (MENU.di_state as i32 - 1) as f64 * PI / 4.0;