mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-09-28 21:19:24 +00:00
fade direction fix
This commit is contained in:
parent
11a8cb9e83
commit
703303d18f
|
@ -86,6 +86,16 @@ impl FadeDirection {
|
|||
_ => { None }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn opposite(&self) -> FadeDirection {
|
||||
match self {
|
||||
FadeDirection::Left => { FadeDirection::Right }
|
||||
FadeDirection::Up => { FadeDirection::Down }
|
||||
FadeDirection::Right => { FadeDirection::Left }
|
||||
FadeDirection::Down => { FadeDirection::Up }
|
||||
FadeDirection::Center => { FadeDirection::Center }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Copy, Clone)]
|
||||
|
|
|
@ -631,7 +631,7 @@ impl TextScriptVM {
|
|||
OpCode::FAO => {
|
||||
let fade_type = read_cur_varint(&mut cursor)? as usize;
|
||||
if let Some(direction) = FadeDirection::from_int(fade_type) {
|
||||
state.fade_state = FadeState::FadeOut(-15, direction);
|
||||
state.fade_state = FadeState::FadeOut(-15, direction.opposite());
|
||||
}
|
||||
|
||||
exec_state = TextScriptExecutionState::WaitFade(event, cursor.position() as u32);
|
||||
|
|
Loading…
Reference in a new issue