A UI Razor component that lists all Perk types from a TypeLibrary and renders a PerkIconStatic for each enabled Perk with fixed size and level 1. It filters out Perk types missing a PerkAttribute or marked Disabled.
@namespace Sandbox
@using Sandbox;
@using Sandbox.UI;
@using System;
@inherits Panel
@attribute [StyleSheet("DebugAllPerksPanel.razor.scss")]
@{
}
<root>
<div class="itemlist">
@foreach(var perkType in TypeLibrary.GetTypes<Perk>())
{
var attrib = perkType.GetAttribute<PerkAttribute>();
if(attrib == null)
continue;
if(attrib.Disabled)
continue;
<PerkIconStatic style="width: 64px; height: 64px;" PerkType=@perkType Level=@(1) HideLevel=@true Banished=@false />
}
</div>
</root>
@code
{
}