Fix Save/Load State #28

Merged
awonak merged 6 commits from fix-save-state into main 2025-08-17 17:18:57 +00:00
3 changed files with 31 additions and 17 deletions
Showing only changes of commit 330f5e6ceb - Show all commits

View File

@ -227,11 +227,13 @@ void HandleEncoderPressed() {
case PARAM_MAIN_LOAD_DATA:
if (app.selected_sub_param < StateManager::MAX_SAVE_SLOTS) {
app.selected_save_slot = app.selected_sub_param;
// Load pattern data into app state.
stateManager.loadData(app, app.selected_save_slot);
// Load global performance settings if they have changed.
if (gravity.clock.Tempo() != app.tempo) {
gravity.clock.SetTempo(app.tempo);
}
// If clock is active, just load the pattern, do not change other global state.
// Load global settings only clock is not active.
if (gravity.clock.IsPaused()) {
InitGravity(app);
}