From 902f7d4910749425a1ddbd2742ba0d200714fe7f Mon Sep 17 00:00:00 2001 From: Jaysyn904 <68194417+Jaysyn904@users.noreply.github.com> Date: Thu, 18 Dec 2025 12:55:02 -0500 Subject: [PATCH] Update sj_browser_i.nss Updated to allow this to work with the PRC8 visual effect content. --- src/module/nss/sj_browser_i.nss | 59 +++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/src/module/nss/sj_browser_i.nss b/src/module/nss/sj_browser_i.nss index 868e306..f857892 100644 --- a/src/module/nss/sj_browser_i.nss +++ b/src/module/nss/sj_browser_i.nss @@ -112,7 +112,8 @@ void SJ_Browser_DisplayAgain(object oPC); void SJ_Browser_ForcedCache(object oPC); // Forces sColumn in s2DA to be cached. -void SJ_Browser_ForcedCacheColumn(object oPC, string s2DA, string sColumn); +//void SJ_Browser_ForcedCacheColumn(object oPC, string s2DA, string sColumn); +void SJ_Browser_ForcedCacheColumn(object oPC, string s2DA, string sColumn, int bValidityCheck = FALSE); // Returns TRUE if the VFX in nRow of sSource matches the filter critera. int SJ_Browser_GetIsMatch(string sSource, string sFilter, int nRow); @@ -367,13 +368,13 @@ void SJ_Browser_DisplayAgain(object oPC) void SJ_Browser_ForcedCache(object oPC) { - // AOE: label only + // AOE: cache SHAPE for counting validity AssignCommand(OBJECT_SELF, - SJ_Browser_ForcedCacheColumn(oPC, SJ_2DA_AOE, "LABEL")); - - // VFX: label only + SJ_Browser_ForcedCacheColumn(oPC, SJ_2DA_AOE, "SHAPE", TRUE)); + + // VFX: cache Type_FD for counting validity AssignCommand(OBJECT_SELF, - SJ_Browser_ForcedCacheColumn(oPC, SJ_2DA_VFX, "Label")); + SJ_Browser_ForcedCacheColumn(oPC, SJ_2DA_VFX, "Type_FD", TRUE)); } @@ -387,31 +388,55 @@ void SJ_Browser_ForcedCache(object oPC) AssignCommand(OBJECT_SELF, SJ_Browser_ForcedCacheColumn(oPC, SJ_2DA_VFX, "Type_FD")); } */ -void SJ_Browser_ForcedCacheColumn(object oPC, string s2DA, string sColumn) +void SJ_Browser_ForcedCacheColumn(object oPC, string s2DA, string sColumn, int bValidityCheck = FALSE) { - int nRow = -1; + int nRow; string sCell; - - while(TRUE) + int nValidCount = 0; + int nMaxRow = (s2DA == SJ_2DA_VFX) ? 1335 : 10000; // Cap VFX at 1335 for PRC8 + + if(bValidityCheck) { - sCell = Get2DAString(s2DA, sColumn, ++nRow); - - if(sCell == "") + // Count ALL rows with valid data in validity column + string sValidityCol = (s2DA == SJ_2DA_VFX) ? "Type_FD" : "SHAPE"; + + for(nRow = 0; nRow <= nMaxRow; nRow++) { - break; + string sValidityCell = Get2DAString(s2DA, sValidityCol, nRow); + + if(sValidityCell != "") + { + nValidCount = nRow + 1; // Track highest valid row (1-based) + } + } + + nRow = nValidCount; // Use this as our count + } + else + { + // Regular caching - stop at blank in specified column + nRow = -1; + while(TRUE) + { + nRow++; + sCell = Get2DAString(s2DA, sColumn, nRow); + + if(sCell == "") + { + break; + } } } - + if(GetLocalInt(oPC, SJ_VAR_BROWSER_COUNT + s2DA) == 0) { SetLocalInt(oPC, SJ_VAR_BROWSER_COUNT + s2DA, nRow); - + string sSource = (s2DA == SJ_2DA_AOE) ? "AOE" : "VFX"; SendMessageToPC(oPC, sSource + " Count: " + IntToString(nRow)); } } - /* void SJ_Browser_ForcedCacheColumn(object oPC, string s2DA, string sColumn) { string sCell;