From 3c7b392475171cf2cc312eeda2b3132e263e2612 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Wed, 30 Nov 2022 11:39:40 +0100 Subject: [PATCH] Prepare stat window for 6.35 --- Pal.Client/Windows/StatisticsWindow.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Pal.Client/Windows/StatisticsWindow.cs b/Pal.Client/Windows/StatisticsWindow.cs index cef527c..4b270d9 100644 --- a/Pal.Client/Windows/StatisticsWindow.cs +++ b/Pal.Client/Windows/StatisticsWindow.cs @@ -30,9 +30,16 @@ namespace Pal.Client.Windows public override void Draw() { - if (ImGui.CollapsingHeader("Discovered Traps & Coffers per Instance", ImGuiTreeNodeFlags.DefaultOpen)) + DrawDungeonStats("Palace of the Dead", ETerritoryType.Palace_1_10, ETerritoryType.Palace_191_200); + DrawDungeonStats("Heaven on High", ETerritoryType.HeavenOnHigh_1_10, ETerritoryType.HeavenOnHigh_91_100); + } + + private void DrawDungeonStats(string name, ETerritoryType minTerritory, ETerritoryType maxTerritory) + { + + if (ImGui.CollapsingHeader(name, ImGuiTreeNodeFlags.DefaultOpen)) { - if (ImGui.BeginTable("TrapHoardStatistics", 4, ImGuiTableFlags.Borders | ImGuiTableFlags.Resizable)) + if (ImGui.BeginTable($"TrapHoardStatistics{name}", 4, ImGuiTableFlags.Borders | ImGuiTableFlags.Resizable)) { ImGui.TableSetupColumn("Id"); ImGui.TableSetupColumn("Instance"); @@ -40,7 +47,7 @@ namespace Pal.Client.Windows ImGui.TableSetupColumn("Hoard"); ImGui.TableHeadersRow(); - foreach (var (territoryType, stats) in _territoryStatistics) + foreach (var (territoryType, stats) in _territoryStatistics.Where(x => x.Key >= minTerritory && x.Key <= maxTerritory)) { ImGui.TableNextRow(); if (ImGui.TableNextColumn())