Fix entity sorting
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Specialized;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -13,6 +14,7 @@ using System.Windows.Media.Imaging;
|
|||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
using Torch.Collections;
|
||||||
using Torch.Server.ViewModels;
|
using Torch.Server.ViewModels;
|
||||||
using Torch.Server.ViewModels.Blocks;
|
using Torch.Server.ViewModels.Blocks;
|
||||||
using Torch.Server.ViewModels.Entities;
|
using Torch.Server.ViewModels.Entities;
|
||||||
@@ -29,6 +31,8 @@ namespace Torch.Server.Views
|
|||||||
{
|
{
|
||||||
public EntityTreeViewModel Entities { get; set; }
|
public EntityTreeViewModel Entities { get; set; }
|
||||||
|
|
||||||
|
private static readonly Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
public EntitiesControl()
|
public EntitiesControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -88,10 +92,10 @@ namespace Torch.Server.Views
|
|||||||
Task[] sortTasks = new Task[4];
|
Task[] sortTasks = new Task[4];
|
||||||
|
|
||||||
Entities.CurrentSort = sort;
|
Entities.CurrentSort = sort;
|
||||||
Entities.SortedCharacters.Sort(comparer);
|
Entities.SortedCharacters.SetComparer(comparer);
|
||||||
Entities.SortedFloatingObjects.Sort(comparer);
|
Entities.SortedFloatingObjects.SetComparer(comparer);
|
||||||
Entities.SortedGrids.Sort(comparer);
|
Entities.SortedGrids.SetComparer(comparer);
|
||||||
Entities.SortedVoxelMaps.Sort(comparer);
|
Entities.SortedVoxelMaps.SetComparer(comparer);
|
||||||
|
|
||||||
foreach (var i in Entities.SortedCharacters)
|
foreach (var i in Entities.SortedCharacters)
|
||||||
i.DescriptiveName = i.GetSortedName(sort);
|
i.DescriptiveName = i.GetSortedName(sort);
|
||||||
|
@@ -48,7 +48,7 @@ namespace Torch.Collections
|
|||||||
|
|
||||||
public IEnumerator<T> GetEnumerator()
|
public IEnumerator<T> GetEnumerator()
|
||||||
{
|
{
|
||||||
return _backing.GetEnumerator();
|
return _store.GetEnumerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator()
|
IEnumerator IEnumerable.GetEnumerator()
|
||||||
@@ -100,6 +100,7 @@ namespace Torch.Collections
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_store.Sort(comparer);
|
_store.Sort(comparer);
|
||||||
|
|
||||||
CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
|
CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user