mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-14 20:54:17 +01:00
Add drag & drop of automated designs to other automated design sets.
This commit is contained in:
parent
455bdae717
commit
363d1619bc
3 changed files with 42 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue