GTK: Show seasons for enemies in grid

This commit is contained in:
2020-03-12 22:10:27 +01:00
parent 3247ba17b8
commit 62d98b054b

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using EstusShots.Gtk.Controls; using EstusShots.Gtk.Controls;
using EstusShots.Gtk.Dialogs; using EstusShots.Gtk.Dialogs;
@@ -23,8 +24,13 @@ namespace EstusShots.Gtk
var columns = new List<DataColumn> var columns = new List<DataColumn>
{ {
new DataColumnText(nameof(Enemy.Name)), new DataColumnText(nameof(Enemy.Name)),
new DataColumnBool(nameof(Enemy.Boss)){Title = "Is Boss?"}, new DataColumnBool(nameof(Enemy.Boss)) {Title = "Is Boss?"},
new DataColumnBool(nameof(Enemy.Defeated)){Title = "Defeated?"} new DataColumnBool(nameof(Enemy.Defeated)) {Title = "Defeated?"},
new DataColumnText(nameof(Enemy.Seasons))
{
Title = "Game",
DisplayConverter = seasons => string.Join(", ", ((IEnumerable<Season>) seasons).Select(x => x.Game))
}
}; };
_enemiesControl = new BindableListControl<Enemy>(columns, nameof(Enemy.EnemyId), _enemiesTreeView); _enemiesControl = new BindableListControl<Enemy>(columns, nameof(Enemy.EnemyId), _enemiesTreeView);