1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-11-30 16:18:00 +00:00

Revert fade changes

This commit is contained in:
dawnDus 2022-02-28 21:24:24 -05:00
parent 4cdadfc505
commit 7a580fdf44
No known key found for this signature in database
GPG key ID: 972AABDE81848F21
3 changed files with 8 additions and 6 deletions

View file

@ -15,12 +15,12 @@ impl Fade {
impl GameEntity<()> for Fade {
fn tick(&mut self, state: &mut SharedGameState, _custom: ()) -> GameResult {
let fade_ticks = (state.canvas_size.0 / 20.0) as i8;
let fade_ticks = state.constants.textscript.fade_ticks;
match state.fade_state {
FadeState::FadeOut(tick, direction) if tick < 15 => {
FadeState::FadeOut(tick, direction) if tick < fade_ticks => {
state.fade_state = FadeState::FadeOut(tick + 1, direction);
}
FadeState::FadeOut(tick, _) if tick == 15 => {
FadeState::FadeOut(tick, _) if tick == fade_ticks => {
state.fade_state = FadeState::Hidden;
}
FadeState::FadeIn(tick, direction) if tick > -fade_ticks => {

View file

@ -232,6 +232,7 @@ pub struct TextScriptConsts {
pub text_shadow: bool,
pub text_speed_normal: u8,
pub text_speed_fast: u8,
pub fade_ticks: i8,
}
#[derive(Debug)]
@ -1502,6 +1503,7 @@ impl EngineConstants {
text_shadow: false,
text_speed_normal: 4,
text_speed_fast: 1,
fade_ticks: 15,
},
title: TitleConsts {
intro_text: "Studio Pixel presents".to_owned(),
@ -1685,6 +1687,7 @@ impl EngineConstants {
self.textscript.text_shadow = true;
self.textscript.text_speed_normal = 1;
self.textscript.text_speed_fast = 0;
self.textscript.fade_ticks = 21;
self.soundtracks.insert("Famitracks".to_owned(), "/base/ogg17/".to_owned());
self.soundtracks.insert("Ridiculon".to_owned(), "/base/ogg_ridic/".to_owned());
self.game.tile_offset_x = 3;

View file

@ -11,8 +11,8 @@ use std::rc::Rc;
use num_traits::{clamp, FromPrimitive};
use crate::bitfield;
use crate::common::{Direction, FadeDirection, FadeState, Rect};
use crate::common::Direction::{Left, Right};
use crate::common::{Direction, FadeDirection, FadeState, Rect};
use crate::engine_constants::EngineConstants;
use crate::entity::GameEntity;
use crate::frame::UpdateTarget;
@ -1223,8 +1223,7 @@ impl TextScriptVM {
let fade_type = read_cur_varint(&mut cursor)? as usize;
if let Some(direction) = FadeDirection::from_int(fade_type) {
let fade_ticks = (state.canvas_size.0 / 20.0) as i8;
state.fade_state = FadeState::FadeOut(-fade_ticks, direction.opposite());
state.fade_state = FadeState::FadeOut(-15, direction.opposite());
}
exec_state = TextScriptExecutionState::WaitFade(event, cursor.position() as u32);