diff --git a/isometric-park-fna/UI/ContractsWindow.cs b/isometric-park-fna/UI/ContractsWindow.cs --- a/isometric-park-fna/UI/ContractsWindow.cs +++ b/isometric-park-fna/UI/ContractsWindow.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using ImGuiNET; @@ -18,6 +19,8 @@ public static ContractStatus selected_status; public static decimal selected_amount; + public static bool show_all; + public static void Render(ImFontPtr font, ImGuiWindowBridgeEngine engine, List<(Entity entity, string name, ContractStatus status, decimal amount)> contracts) { bool newShow = true; @@ -54,7 +57,8 @@ ImGui.SetNextWindowSize(new Num.Vector2(300, 300)); ImGui.Begin("Contracts", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings); ImGui.ListBoxHeader("##Contracts:", new Num.Vector2(300, 150)); - foreach (var contract in contracts) + foreach (var contract in contracts.Where((contract) => ((!(new[] {ContractStatus.Expired, ContractStatus.Broken, ContractStatus.Rejected}.Contains(contract.status)) + || ContractsWindow.show_all )))) { if (ImGui.Selectable(contract.name, ContractsWindow.selected == contract.entity)) { @@ -82,6 +86,11 @@ case ContractStatus.Rejected: case ContractStatus.Broken: case ContractStatus.Expired: + // if (ContractsWindow.show_all) + // { + + // ImGui.TextColored(new Num.Vector4(0.95f, 0.25f, 0.25f, 1f), contract.status.ToString()); + // } ImGui.TextColored(new Num.Vector4(0.95f, 0.25f, 0.25f, 1f), contract.status.ToString()); break; case ContractStatus.Completed: @@ -92,6 +101,10 @@ } } ImGui.ListBoxFooter(); + + ImGui.Checkbox("Show All", ref show_all); + + ImGui.Separator(); ImGui.Text(string.Format("Amount: ${0}/mo.", ContractsWindow.selected_amount)); if (selected_status == ContractStatus.Proposed) { @@ -122,6 +135,8 @@ } } + + ImGui.Separator(); if (ImGui.Button("Okay")) { newShow = false;