Show More
Commit Description:
Change delta to be per-year
Commit Description:
Change delta to be per-year
References:
File last commit:
Show/Diff file:
Action:
isometric-park-fna/Renderers/ImGuiWindowRenderer.cs
65 lines | 2.1 KiB | text/x-csharp | CSharpLexer
65 lines | 2.1 KiB | text/x-csharp | CSharpLexer
r194 | using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Graphics; | |||
using System.Collections.Generic; | |||
using isometricparkfna.UI; | |||
using isometricparkfna.Engines; | |||
using isometricparkfna.Components; | |||
using isometricparkfna.Messages; | |||
using ImGuiNET; | |||
using Encompass; | |||
using SpriteFontPlus; | |||
namespace isometricparkfna.Renderers | |||
{ | |||
public class ImGuiWindowRenderer : GeneralRenderer | |||
{ | |||
private ImFontPtr font; | |||
private ImGuiWindowBridgeEngine BridgeEngine; | |||
public ImGuiWindowRenderer(ImFontPtr font, ImGuiWindowBridgeEngine engine) | |||
{ | |||
this.font = font; | |||
this.BridgeEngine = engine; | |||
} | |||
public override void Render() | |||
{ | |||
foreach (ref readonly var entity in ReadEntities<WindowTypeComponent>()) | |||
{ | |||
var window_type = GetComponent<WindowTypeComponent>(entity).type; | |||
var visible = GetComponent<VisibilityComponent>(entity).visible; | |||
if (visible) | |||
{ | |||
switch (window_type) | |||
{ | |||
case Window.Contracts: | |||
var contracts = ReadEntities<AreaComponent>(); | |||
r201 | var contract_data = new List<(Entity, string, ContractStatus, decimal)>(); | ||
r194 | |||
// var names = contracts.Select(entity => GetComponent<NameComponent>(entity).DisplayName) | |||
foreach(var e in contracts) | |||
{ | |||
r195 | var name = GetComponent<NameComponent>(e).DisplayName; | ||
var status = GetComponent<ContractStatusComponent>(e).status; | |||
r201 | var amount = GetComponent<BudgetLineComponent>(e).amount; | ||
contract_data.Add((e, name, status, amount)); | |||
r194 | |||
} | |||
r195 | ContractsWindow.Render(this.font, this.BridgeEngine, contract_data); | ||
r194 | break; | ||
default: | |||
break; | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} |