mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
fix: exceptions in stat window
This commit is contained in:
parent
a7ff558ed7
commit
0db156a468
1 changed files with 10 additions and 5 deletions
|
|
@ -160,7 +160,7 @@ internal class PluginStatWindow : Window
|
||||||
|
|
||||||
var statsHistory = Framework.StatsHistory.ToArray();
|
var statsHistory = Framework.StatsHistory.ToArray();
|
||||||
var totalLast = statsHistory.Sum(stats => stats.Value.LastOrDefault());
|
var totalLast = statsHistory.Sum(stats => stats.Value.LastOrDefault());
|
||||||
var totalAverage = statsHistory.Sum(stats => stats.Value.Average());
|
var totalAverage = statsHistory.Sum(stats => stats.Value.DefaultIfEmpty().Average());
|
||||||
|
|
||||||
ImGuiComponents.TextWithLabel("Total Last", $"{totalLast:F4}ms", "All last update times added together");
|
ImGuiComponents.TextWithLabel("Total Last", $"{totalLast:F4}ms", "All last update times added together");
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
|
@ -193,16 +193,21 @@ internal class PluginStatWindow : Window
|
||||||
? statsHistory.OrderBy(handler => handler.Key).ToArray()
|
? statsHistory.OrderBy(handler => handler.Key).ToArray()
|
||||||
: statsHistory.OrderByDescending(handler => handler.Key).ToArray(),
|
: statsHistory.OrderByDescending(handler => handler.Key).ToArray(),
|
||||||
2 => sortSpecs.Specs.SortDirection == ImGuiSortDirection.Ascending
|
2 => sortSpecs.Specs.SortDirection == ImGuiSortDirection.Ascending
|
||||||
? statsHistory.OrderBy(handler => handler.Value.Max()).ToArray()
|
? statsHistory.OrderBy(handler => handler.Value.DefaultIfEmpty().Max()).ToArray()
|
||||||
: statsHistory.OrderByDescending(handler => handler.Value.Max()).ToArray(),
|
: statsHistory.OrderByDescending(handler => handler.Value.DefaultIfEmpty().Max()).ToArray(),
|
||||||
3 => sortSpecs.Specs.SortDirection == ImGuiSortDirection.Ascending
|
3 => sortSpecs.Specs.SortDirection == ImGuiSortDirection.Ascending
|
||||||
? statsHistory.OrderBy(handler => handler.Value.Average()).ToArray()
|
? statsHistory.OrderBy(handler => handler.Value.DefaultIfEmpty().Average()).ToArray()
|
||||||
: statsHistory.OrderByDescending(handler => handler.Value.Average()).ToArray(),
|
: statsHistory.OrderByDescending(handler => handler.Value.DefaultIfEmpty().Average()).ToArray(),
|
||||||
_ => statsHistory,
|
_ => statsHistory,
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var handlerHistory in statsHistory)
|
foreach (var handlerHistory in statsHistory)
|
||||||
{
|
{
|
||||||
|
if (!handlerHistory.Value.Any())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.TableNextRow();
|
ImGui.TableNextRow();
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue