Update sj_browser_i.nss

Updated to allow this to work with the PRC8 visual effect content.
This commit is contained in:
Jaysyn904
2025-12-18 12:55:02 -05:00
parent d3004de2ab
commit 902f7d4910

View File

@@ -112,7 +112,8 @@ void SJ_Browser_DisplayAgain(object oPC);
void SJ_Browser_ForcedCache(object oPC); void SJ_Browser_ForcedCache(object oPC);
// Forces sColumn in s2DA to be cached. // 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. // Returns TRUE if the VFX in nRow of sSource matches the filter critera.
int SJ_Browser_GetIsMatch(string sSource, string sFilter, int nRow); 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) void SJ_Browser_ForcedCache(object oPC)
{ {
// AOE: label only // AOE: cache SHAPE for counting validity
AssignCommand(OBJECT_SELF, AssignCommand(OBJECT_SELF,
SJ_Browser_ForcedCacheColumn(oPC, SJ_2DA_AOE, "LABEL")); SJ_Browser_ForcedCacheColumn(oPC, SJ_2DA_AOE, "SHAPE", TRUE));
// VFX: label only // VFX: cache Type_FD for counting validity
AssignCommand(OBJECT_SELF, AssignCommand(OBJECT_SELF,
SJ_Browser_ForcedCacheColumn(oPC, SJ_2DA_VFX, "Label")); SJ_Browser_ForcedCacheColumn(oPC, SJ_2DA_VFX, "Type_FD", TRUE));
} }
@@ -387,18 +388,43 @@ void SJ_Browser_ForcedCache(object oPC)
AssignCommand(OBJECT_SELF, SJ_Browser_ForcedCacheColumn(oPC, SJ_2DA_VFX, "Type_FD")); 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; string sCell;
int nValidCount = 0;
int nMaxRow = (s2DA == SJ_2DA_VFX) ? 1335 : 10000; // Cap VFX at 1335 for PRC8
while(TRUE) if(bValidityCheck)
{ {
sCell = Get2DAString(s2DA, sColumn, ++nRow); // Count ALL rows with valid data in validity column
string sValidityCol = (s2DA == SJ_2DA_VFX) ? "Type_FD" : "SHAPE";
if(sCell == "") 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;
}
} }
} }
@@ -411,7 +437,6 @@ 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)
{ {
string sCell; string sCell;