diff --git a/SS13WebMap/CodebaseData.cs b/SS13WebMap/CodebaseData.cs index 786f8a52..8c267863 100644 --- a/SS13WebMap/CodebaseData.cs +++ b/SS13WebMap/CodebaseData.cs @@ -1001,5 +1001,30 @@ public class CodebaseData { } } }, }; + + /// <summary> + /// Sum of all codebases. This is done here as a static to not cause runtime load. + /// </summary> + public static int TotalCodebases = Codebases.Count; + + /// <summary> + /// Sum of all maps. This is done here as a static to not cause runtime load. + /// </summary> + public static int TotalMaps = Codebases.Sum(x => x.Value.GameMaps.Count); + + /// <summary> + /// Sum of total normal layers. This is done here as a static to not cause runtime load. + /// </summary> + private static int TotalNormalLayers = Codebases.Where(x => !x.Value.FancySupport).Sum(x => x.Value.GameMaps.Sum(x => x.Layers.Count)); + + /// <summary> + /// Sum of total fancy layers, which is the above but counting fancy, then multiplying by 2. This is done here as a static to not cause runtime load. + /// </summary> + private static int TotalFancyLayers = Codebases.Where(x => x.Value.FancySupport).Sum(x => x.Value.GameMaps.Sum(x => x.Layers.Count)) * 2; + + /// <summary> + /// Sum of total layers. This is done here as a static to not cause runtime load. + /// </summary> + public static int TotalLayers = TotalNormalLayers + TotalFancyLayers; } } diff --git a/SS13WebMap/Views/Home/Index.cshtml b/SS13WebMap/Views/Home/Index.cshtml index f54dd4d5..0736dff3 100644 --- a/SS13WebMap/Views/Home/Index.cshtml +++ b/SS13WebMap/Views/Home/Index.cshtml @@ -7,6 +7,7 @@ <h1 class="display-1 text-white">SS13 WebMap</h1> <p class="text-white"><b>Created by AffectedArc07</b></p> <p class="text-white">Special thanks to <b>Letter_N</b> for HTML theming and JS support.</p> + <p class="text-white">Currently holding <b>@CodebaseData.TotalCodebases</b> codebases with <b>@CodebaseData.TotalMaps</b> maps, and a total of <b>@CodebaseData.TotalLayers</b> layers.</p> <a class="btn btn-primary" target="_blank" href="https://github.com/AffectedArc07/SS13WebMap"><i class="fab fa-github"></i> GitHub</a> <a class="btn btn-primary" target="_blank" href="https://github.com/AffectedArc07/SS13WebMap/tree/master/MAP_REQUESTING.MD"><i class="fas fa-folder-plus"></i> How to get your map on here</a> <a class="btn btn-primary" target="_blank" href="https://onlyfaans.net/"><i class="fas fa-pound-sign"></i> Donate</a>