Add drag & drop of automated designs to other automated design sets.

This commit is contained in:
Ottermandias 2023-10-07 03:17:01 +02:00
parent 455bdae717
commit 363d1619bc
3 changed files with 42 additions and 7 deletions

View file

@ -247,6 +247,21 @@ public class AutoDesignManager : ISavable, IReadOnlyList<AutoDesignSet>, IDispos
_event.Invoke(AutomationChanged.Type.AddedDesign, set, set.Designs.Count - 1);
}
/// <remarks> Only used to move between sets. </remarks>
public void MoveDesignToSet(AutoDesignSet from, int idx, AutoDesignSet to)
{
if (ReferenceEquals(from, to))
return;
var design = from.Designs[idx];
to.Designs.Add(design);
from.Designs.RemoveAt(idx);
Save();
Glamourer.Log.Debug($"Moved design {idx} from design set {from.Name} to design set {to.Name}.");
_event.Invoke(AutomationChanged.Type.AddedDesign, to, to.Designs.Count - 1);
_event.Invoke(AutomationChanged.Type.DeletedDesign, from, idx);
}
public void DeleteDesign(AutoDesignSet set, int which)
{
if (which >= set.Designs.Count || which < 0)