From 858b7503462e190c7a69490b1a62859f1cf6d859 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 5 Mar 2025 09:26:16 +0000 Subject: [PATCH] Document the magic number for future generations --- public/scripts/RossAscends-mods.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index fc845fcbc..0a2581e5f 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -316,7 +316,10 @@ export async function favsToHotswap() { const entities = getEntitiesList({ doFilter: false }); const container = $('#right-nav-panel .hotswap'); - const favs = entities.filter(x => x.item.fav || x.item.fav == 'true').slice(0, 25); + // Hard limit is required because even if all hotswaps don't fit the screen, their images would still be loaded + // 25 is roughly calculated as the maximum number of favs that can fit an ultrawide monitor with the default theme + const FAVS_LIMIT = 25; + const favs = entities.filter(x => x.item.fav || x.item.fav == 'true').slice(0, FAVS_LIMIT); //helpful instruction message if no characters are favorited if (favs.length == 0) {