Search/Tabs

* switch between single and multi-class display as necessary
This commit is contained in:
Sarjuuk
2021-10-24 21:20:46 +02:00
parent 4755058fd0
commit 8acc93c325

View File

@@ -629,10 +629,24 @@ class SearchPage extends GenericPage
if ($this->searchMask & SEARCH_TYPE_REGULAR)
$this->extendGlobalData($abilities->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
$vis = ['level', 'singleclass', 'schools'];
$multiClass = 0;
foreach ($data as $d)
{
$multiClass = 0;
for ($i = 1; $i <= 10; $i++)
if ($d['reqclass'] & (1 << ($i - 1)))
$multiClass++;
if ($multiClass > 1)
break;
}
$vis = ['level', 'schools'];
if ($abilities->hasSetFields(['reagent1']))
$vis[] = 'reagents';
$vis[] = $multiClass > 1 ? 'classes' : 'singleclass';
$osInfo = [TYPE_SPELL, ' (Ability)', $abilities->getMatches(), [], []];
$result = array(
'data' => array_values($data),