Disable debug hotkeys in non-debug mode, fix Balrog text scrolling sound from #165
This commit is contained in:
parent
21221d80e7
commit
3468bcf5fd
|
@ -269,7 +269,6 @@ fn init_logger() -> GameResult {
|
||||||
.level(log::LevelFilter::Debug)
|
.level(log::LevelFilter::Debug)
|
||||||
.chain(
|
.chain(
|
||||||
fern::Dispatch::new()
|
fern::Dispatch::new()
|
||||||
.level(log::LevelFilter::Info)
|
|
||||||
.chain(std::io::stderr())
|
.chain(std::io::stderr())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -281,7 +280,7 @@ fn init_logger() -> GameResult {
|
||||||
|
|
||||||
dispatcher = dispatcher.chain(
|
dispatcher = dispatcher.chain(
|
||||||
fern::Dispatch::new()
|
fern::Dispatch::new()
|
||||||
.level(log::LevelFilter::Debug)
|
.level(log::LevelFilter::Info)
|
||||||
.chain(fern::log_file(file).unwrap())
|
.chain(fern::log_file(file).unwrap())
|
||||||
);
|
);
|
||||||
dispatcher.apply()?;
|
dispatcher.apply()?;
|
||||||
|
|
|
@ -459,7 +459,11 @@ impl TextScriptVM {
|
||||||
} else {
|
} else {
|
||||||
state.constants.textscript.text_speed_fast
|
state.constants.textscript.text_speed_fast
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ticks > 0 {
|
||||||
|
state.sound_manager.play_sfx(2);
|
||||||
|
}
|
||||||
|
|
||||||
state.textscript_vm.state = if new_line {
|
state.textscript_vm.state = if new_line {
|
||||||
TextScriptExecutionState::MsgNewLine(
|
TextScriptExecutionState::MsgNewLine(
|
||||||
event,
|
event,
|
||||||
|
|
|
@ -2308,6 +2308,11 @@ impl Scene for GameScene {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process_debug_keys(&mut self, state: &mut SharedGameState, ctx: &mut Context, key_code: ScanCode) -> GameResult {
|
fn process_debug_keys(&mut self, state: &mut SharedGameState, ctx: &mut Context, key_code: ScanCode) -> GameResult {
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
if !state.settings.debug_mode {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
if key_code == ScanCode::F3 && ctx.keyboard_context.active_mods().ctrl() {
|
if key_code == ScanCode::F3 && ctx.keyboard_context.active_mods().ctrl() {
|
||||||
let _ = state.sound_manager.reload();
|
let _ = state.sound_manager.reload();
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
@ -2319,11 +2324,6 @@ impl Scene for GameScene {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(debug_assertions))]
|
|
||||||
if !state.settings.debug_mode {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
match key_code {
|
match key_code {
|
||||||
ScanCode::F3 => state.settings.god_mode = !state.settings.god_mode,
|
ScanCode::F3 => state.settings.god_mode = !state.settings.god_mode,
|
||||||
ScanCode::F4 => state.settings.infinite_booster = !state.settings.infinite_booster,
|
ScanCode::F4 => state.settings.infinite_booster = !state.settings.infinite_booster,
|
||||||
|
|
Loading…
Reference in New Issue