mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-12-01 08:37:23 +00:00
Trigger CPS and CSS when going to title
This commit is contained in:
parent
e4ec69b6dc
commit
f672ff6f24
|
|
@ -101,9 +101,7 @@ impl PauseMenu {
|
||||||
|
|
||||||
// Shortcut for quick restart
|
// Shortcut for quick restart
|
||||||
if ctx.keyboard_context.is_key_pressed(ScanCode::F2) {
|
if ctx.keyboard_context.is_key_pressed(ScanCode::F2) {
|
||||||
state.sound_manager.stop_sfx(40);
|
state.stop_noise();
|
||||||
state.sound_manager.stop_sfx(41);
|
|
||||||
state.sound_manager.stop_sfx(58);
|
|
||||||
state.sound_manager.play_song(0, &state.constants, &state.settings, ctx)?;
|
state.sound_manager.play_song(0, &state.constants, &state.settings, ctx)?;
|
||||||
state.load_or_start_game(ctx)?;
|
state.load_or_start_game(ctx)?;
|
||||||
}
|
}
|
||||||
|
|
@ -118,9 +116,7 @@ impl PauseMenu {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MenuSelectionResult::Selected(1, _) => {
|
MenuSelectionResult::Selected(1, _) => {
|
||||||
state.sound_manager.stop_sfx(40);
|
state.stop_noise();
|
||||||
state.sound_manager.stop_sfx(41);
|
|
||||||
state.sound_manager.stop_sfx(58);
|
|
||||||
state.sound_manager.play_song(0, &state.constants, &state.settings, ctx)?;
|
state.sound_manager.play_song(0, &state.constants, &state.settings, ctx)?;
|
||||||
state.load_or_start_game(ctx)?;
|
state.load_or_start_game(ctx)?;
|
||||||
}
|
}
|
||||||
|
|
@ -151,6 +147,7 @@ impl PauseMenu {
|
||||||
CurrentMenu::ConfirmMenu => match self.confirm_menu.tick(&mut self.controller, state) {
|
CurrentMenu::ConfirmMenu => match self.confirm_menu.tick(&mut self.controller, state) {
|
||||||
MenuSelectionResult::Selected(1, _) => match self.pause_menu.selected {
|
MenuSelectionResult::Selected(1, _) => match self.pause_menu.selected {
|
||||||
3 => {
|
3 => {
|
||||||
|
state.stop_noise();
|
||||||
state.textscript_vm.flags.set_cutscene_skip(false);
|
state.textscript_vm.flags.set_cutscene_skip(false);
|
||||||
state.next_scene = Some(Box::new(TitleScene::new()));
|
state.next_scene = Some(Box::new(TitleScene::new()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -814,7 +814,6 @@ impl Player {
|
||||||
self.skin.set_state(PlayerAnimationState::Jumping);
|
self.skin.set_state(PlayerAnimationState::Jumping);
|
||||||
self.anim_num = 3;
|
self.anim_num = 3;
|
||||||
}
|
}
|
||||||
self.anim_num = 1;
|
|
||||||
self.anim_counter = 0;
|
self.anim_counter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -643,6 +643,13 @@ impl SharedGameState {
|
||||||
self.shutdown = true;
|
self.shutdown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stops SFX 40/41/58 (CPS and CSS)
|
||||||
|
pub fn stop_noise(&mut self) {
|
||||||
|
self.sound_manager.stop_sfx(40);
|
||||||
|
self.sound_manager.stop_sfx(41);
|
||||||
|
self.sound_manager.stop_sfx(58);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn set_flag(&mut self, id: usize, value: bool) {
|
pub fn set_flag(&mut self, id: usize, value: bool) {
|
||||||
if id < self.game_flags.len() {
|
if id < self.game_flags.len() {
|
||||||
self.game_flags.set(id, value);
|
self.game_flags.set(id, value);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue