Debugger - Reworked FPS calculation code

Scripting - Save profile on scripting window close
This commit is contained in:
Robert committed 2021-06-24 19:41:51 +02:00
1 parent a5c13bb543
commit fbaa8c7af7
4 files changed
+134 -118

No files matched your search

@@ -15,16 +15,23 @@ namespace Artemis.UI.Screens.Scripting
{
private readonly IScriptingService _scriptingService;
private readonly IDialogService _dialogService;
private readonly IProfileService _profileService;
private readonly IProfileEditorService _profileEditorService;
private readonly IScriptVmFactory _scriptVmFactory;
public Profile Profile { get; }
public Layer Layer { get; }
public ILayerProperty LayerProperty { get; }
public ScriptsDialogViewModel(Profile profile, IScriptingService scriptingService, IDialogService dialogService, IProfileEditorService profileEditorService, IScriptVmFactory scriptVmFactory)
public ScriptsDialogViewModel(Profile profile,
IScriptingService scriptingService,
IDialogService dialogService,
IProfileService profileService,
IProfileEditorService profileEditorService,
IScriptVmFactory scriptVmFactory)
{
_scriptingService = scriptingService;
_dialogService = dialogService;
_profileService = profileService;
_profileEditorService = profileEditorService;
_scriptVmFactory = scriptVmFactory;
@@ -82,7 +89,10 @@ namespace Artemis.UI.Screens.Scripting
/// <inheritdoc />
protected override void OnClose()
{
_profileEditorService.SaveSelectedProfileConfiguration();
if (_profileEditorService.SelectedProfile == Profile)
_profileEditorService.SaveSelectedProfileConfiguration();
else
_profileService.SaveProfile(Profile, false);
base.OnClose();
}