mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-09-30 05:59:46 +00:00
fade direction fix
This commit is contained in:
parent
11a8cb9e83
commit
703303d18f
|
@ -86,6 +86,16 @@ impl FadeDirection {
|
||||||
_ => { None }
|
_ => { 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)]
|
#[derive(Debug, PartialEq, Copy, Clone)]
|
||||||
|
|
|
@ -631,7 +631,7 @@ impl TextScriptVM {
|
||||||
OpCode::FAO => {
|
OpCode::FAO => {
|
||||||
let fade_type = read_cur_varint(&mut cursor)? as usize;
|
let fade_type = read_cur_varint(&mut cursor)? as usize;
|
||||||
if let Some(direction) = FadeDirection::from_int(fade_type) {
|
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);
|
exec_state = TextScriptExecutionState::WaitFade(event, cursor.position() as u32);
|
||||||
|
|
Loading…
Reference in a new issue