Cutscene skip tutorial prompt

This commit is contained in:
dawnDus 2022-04-26 23:23:55 -04:00
parent 7e793e09a8
commit 75f5e9f364
No known key found for this signature in database
GPG Key ID: 972AABDE81848F21
2 changed files with 12 additions and 1 deletions

View File

@ -1747,6 +1747,7 @@ impl Scene for GameScene {
self.skip_counter += 1;
if self.skip_counter >= CUTSCENE_SKIP_WAIT {
state.textscript_vm.flags.set_cutscene_skip(true);
state.tutorial_counter = 0;
}
} else if self.skip_counter > 0 {
self.skip_counter -= 1;
@ -1802,6 +1803,13 @@ impl Scene for GameScene {
self.tick = self.tick.wrapping_add(1);
}
if state.tutorial_counter > 0 {
state.tutorial_counter = state.tutorial_counter.saturating_sub(1);
if state.control_flags.control_enabled() {
state.tutorial_counter = 0;
}
}
Ok(())
}
@ -2030,7 +2038,7 @@ impl Scene for GameScene {
self.falling_island.draw(state, ctx, &self.frame)?;
self.text_boxes.draw(state, ctx, &self.frame)?;
if self.skip_counter > 1 {
if self.skip_counter > 1 || state.tutorial_counter > 0 {
let text = state.tt(
"game.cutscene_skip",
HashMap::from([("key".to_owned(), format!("{:?}", state.settings.player1_key_map.inventory))]),

View File

@ -272,6 +272,7 @@ pub struct SharedGameState {
pub difficulty: GameDifficulty,
pub replay_state: ReplayState,
pub mod_requirements: ModRequirements,
pub tutorial_counter: u16,
pub shutdown: bool,
}
@ -399,6 +400,7 @@ impl SharedGameState {
difficulty: GameDifficulty::Normal,
replay_state: ReplayState::None,
mod_requirements,
tutorial_counter: 0,
shutdown: false,
})
}
@ -510,6 +512,7 @@ impl SharedGameState {
self.control_flags.set_tick_world(true);
self.fade_state = FadeState::Hidden;
self.textscript_vm.state = TextScriptExecutionState::Running(self.constants.game.new_game_event, 0);
self.tutorial_counter = 300;
self.next_scene = Some(Box::new(next_scene));