1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-09-28 21:19:24 +00:00

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; self.skip_counter += 1;
if self.skip_counter >= CUTSCENE_SKIP_WAIT { if self.skip_counter >= CUTSCENE_SKIP_WAIT {
state.textscript_vm.flags.set_cutscene_skip(true); state.textscript_vm.flags.set_cutscene_skip(true);
state.tutorial_counter = 0;
} }
} else if self.skip_counter > 0 { } else if self.skip_counter > 0 {
self.skip_counter -= 1; self.skip_counter -= 1;
@ -1802,6 +1803,13 @@ impl Scene for GameScene {
self.tick = self.tick.wrapping_add(1); 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(()) Ok(())
} }
@ -2030,7 +2038,7 @@ impl Scene for GameScene {
self.falling_island.draw(state, ctx, &self.frame)?; self.falling_island.draw(state, ctx, &self.frame)?;
self.text_boxes.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( let text = state.tt(
"game.cutscene_skip", "game.cutscene_skip",
HashMap::from([("key".to_owned(), format!("{:?}", state.settings.player1_key_map.inventory))]), 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 difficulty: GameDifficulty,
pub replay_state: ReplayState, pub replay_state: ReplayState,
pub mod_requirements: ModRequirements, pub mod_requirements: ModRequirements,
pub tutorial_counter: u16,
pub shutdown: bool, pub shutdown: bool,
} }
@ -399,6 +400,7 @@ impl SharedGameState {
difficulty: GameDifficulty::Normal, difficulty: GameDifficulty::Normal,
replay_state: ReplayState::None, replay_state: ReplayState::None,
mod_requirements, mod_requirements,
tutorial_counter: 0,
shutdown: false, shutdown: false,
}) })
} }
@ -510,6 +512,7 @@ impl SharedGameState {
self.control_flags.set_tick_world(true); self.control_flags.set_tick_world(true);
self.fade_state = FadeState::Hidden; self.fade_state = FadeState::Hidden;
self.textscript_vm.state = TextScriptExecutionState::Running(self.constants.game.new_game_event, 0); 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)); self.next_scene = Some(Box::new(next_scene));