Merge branch '62-shift-modifier-in-timer-settings' into 'dev'
Shift modifier in timer settings See merge request softwaregrundprojekt/2025-2026/einzelprojekt/tutorium-moritz/bernroider-dominik/bernroider-dominik!33
This commit is contained in:
@@ -83,7 +83,14 @@ fn buttons(
|
|||||||
mut savegame_messages: MessageWriter<SavegameDumpMessage>,
|
mut savegame_messages: MessageWriter<SavegameDumpMessage>,
|
||||||
mut next_state: ResMut<NextState<AppState>>,
|
mut next_state: ResMut<NextState<AppState>>,
|
||||||
mut timer_settings: ResMut<TimerSettings>,
|
mut timer_settings: ResMut<TimerSettings>,
|
||||||
|
keys: Res<ButtonInput<KeyCode>>,
|
||||||
) {
|
) {
|
||||||
|
let shift_multiplier = if keys.any_pressed([KeyCode::ShiftLeft, KeyCode::ShiftRight]) {
|
||||||
|
10
|
||||||
|
} else {
|
||||||
|
1
|
||||||
|
};
|
||||||
|
|
||||||
for (interaction, button_type) in &mut interaction_query {
|
for (interaction, button_type) in &mut interaction_query {
|
||||||
match *interaction {
|
match *interaction {
|
||||||
Interaction::Pressed => match button_type {
|
Interaction::Pressed => match button_type {
|
||||||
@@ -99,10 +106,10 @@ fn buttons(
|
|||||||
}
|
}
|
||||||
ButtonType::SettingsTimerChange { input, amount } => match input {
|
ButtonType::SettingsTimerChange { input, amount } => match input {
|
||||||
SettingsTimerInput::Minutes(timer_type) => {
|
SettingsTimerInput::Minutes(timer_type) => {
|
||||||
timer_settings.change(timer_type, 60 * amount)
|
timer_settings.change(timer_type, 60 * amount * shift_multiplier)
|
||||||
}
|
}
|
||||||
SettingsTimerInput::Seconds(timer_type) => {
|
SettingsTimerInput::Seconds(timer_type) => {
|
||||||
timer_settings.change(timer_type, *amount)
|
timer_settings.change(timer_type, *amount * shift_multiplier)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user