Skip to content

Commit

Permalink
fix: save reloaded presets
Browse files Browse the repository at this point in the history
  • Loading branch information
InuInu2022 committed Nov 3, 2024
1 parent 155b967 commit e2ddbd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/YMM4VoiSonaPlugin/ViewModel/TalkPresetsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public TalkPresetsViewModel(
.ConfigureAwait(true);
TaskbarUtil.FinishIndeterminate();
Presets = [.. presets];
VoiSonaTalkSettings.Default
.SpeakersPresets[voice] = [..presets];
VoiSonaTalkSettings.Default.Save();
WindowUtil.FocusBack();
PresetIndex = -1;
});
Expand Down Expand Up @@ -92,6 +95,7 @@ await _service.SetPresetsAsync(voice, preset)
Value = s.Value,
Description = $"Style: {s.Key}",
});
vsParam.Preset = [.. Presets];
vsParam.PresetIndex = index;
vsParam.Alpha = globalParams["Alpha"];
vsParam.Husky = globalParams["Hus."];
Expand Down
3 changes: 1 addition & 2 deletions src/YMM4VoiSonaPlugin/VoiSonaTalkSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ await UIThread.InvokeAsync(()=>{

await UIThread.InvokeAsync(()=>{
TaskbarUtil.FinishIndeterminate();
WindowUtil.FocusBack();
return ValueTask.CompletedTask;
}).ConfigureAwait(false);

WindowUtil.FocusBack();
}
}

0 comments on commit e2ddbd8

Please sign in to comment.