Skip to content

Commit e638fd5

Browse files
committed
Merge branch 'feature/shipsort' into develop
2 parents 453cc58 + ab1e370 commit e638fd5

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Grabacr07.KanColleViewer/ViewModels/Catalogs/ShipCatalogSortWorker.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public SortableColumnSelector[] Selectors
7575
public ShipCatalogSortWorker()
7676
{
7777
this.UpdateSelectors();
78+
79+
this.SetFirst(LevelColumn);
7880
}
7981

8082
public IEnumerable<Ship> Sort(IEnumerable<Ship> ships)
@@ -96,12 +98,28 @@ public IEnumerable<Ship> Sort(IEnumerable<Ship> ships)
9698

9799
public void SetFirst(SortableColumn column)
98100
{
99-
if (this.Selectors.HasItems())
101+
if (!this.Selectors.HasItems()) return;
102+
103+
if (column == StypeColumn)
104+
{
105+
// 列ヘッダーから艦種が選択されたときは、艦種 (降順) -> 艦名 (昇順) に設定
106+
// (ゲーム内の艦種ソートと同じ動作)
107+
108+
this.Selectors[0].SafeUpdate(StypeColumn);
109+
this.Selectors[0].SafeUpdate(false);
110+
if (this.Selectors.Length >= 2)
111+
{
112+
this.Selectors[1].SafeUpdate(NameColumn);
113+
this.Selectors[1].SafeUpdate(true);
114+
}
115+
}
116+
else
100117
{
101118
this.Selectors[0].SafeUpdate(column);
102119
this.Selectors[0].SafeUpdate(!column.DefaultIsDescending);
103-
this.UpdateSelectors();
104120
}
121+
122+
this.UpdateSelectors();
105123
}
106124

107125
public void Clear()

0 commit comments

Comments
 (0)