Skip to content

Commit

Permalink
Fixed in-editor settings selection and save-on-change behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
ilexp committed Sep 5, 2020
1 parent c85ed95 commit ea5acb3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions Source/Editor/DualityEditor/DualityEditorApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,14 @@ private static void OnObjectPropertyChanged(object sender, ObjectPropertyChanged
{
settings.Save();
}
// If any settings are modified, save them
if (args.Objects.OtherObjectCount > 0)
{
if (args.HasObject(DualityApp.AppData.Instance)) DualityApp.AppData.Save();
if (args.HasObject(DualityApp.UserData.Instance)) DualityApp.UserData.Save();
if (args.HasObject(DualityEditorApp.AppData.Instance)) DualityEditorApp.AppData.Save();
if (args.HasObject(DualityEditorApp.UserData.Instance)) DualityEditorApp.UserData.Save();
}
}

// Fire the actual event
Expand Down
8 changes: 4 additions & 4 deletions Source/Plugins/EditorBase/EditorBasePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ protected override IDockContent DeserializeDockContent(Type dockContentType)
this.isLoading = false;
return result;
}

private void slicingForm_FormClosed(object sender, FormClosedEventArgs e)
{
this.pixmapSlicerSettings = new XElement(ElementNamePixmapSlicer);
Expand All @@ -142,16 +143,15 @@ private void slicingForm_FormClosed(object sender, FormClosedEventArgs e)
}
private void menuItemAppData_Click(object sender, EventArgs e)
{
DualityEditorApp.Select(this, new ObjectSelection(new [] { DualityApp.AppData }));
DualityEditorApp.Select(this, new ObjectSelection(new [] { DualityApp.AppData.Instance }));
}
private void menuItemUserData_Click(object sender, EventArgs e)
{
DualityEditorApp.Select(this, new ObjectSelection(new [] { DualityApp.UserData }));
DualityEditorApp.Select(this, new ObjectSelection(new [] { DualityApp.UserData.Instance }));
}

private void menuItemProjectSettings_Click(object sender, EventArgs e)
{
DualityEditorApp.Select(this, new ObjectSelection(new[] { DualityEditorApp.AppData }));
DualityEditorApp.Select(this, new ObjectSelection(new[] { DualityEditorApp.AppData.Instance }));
}

private void DualityEditorApp_ObjectPropertyChanged(object sender, ObjectPropertyChangedEventArgs e)
Expand Down

0 comments on commit ea5acb3

Please sign in to comment.