Items/Icon

* set a default icon for items so they don't break listviews
This commit is contained in:
Sarjuuk
2024-04-03 01:27:53 +02:00
parent e01c3ac205
commit e5e4446366
6 changed files with 11 additions and 7 deletions

View File

@@ -264,6 +264,8 @@ define('GUIDE_STATUS_APPROVED', 3);
define('GUIDE_STATUS_REJECTED', 4);
define('GUIDE_STATUS_ARCHIVED', 5);
define('DEFAULT_ICON', 'inv_misc_questionmark');
/*
* Game
*/

View File

@@ -21,8 +21,7 @@ class CurrencyList extends BaseType
parent::__construct($conditions);
foreach ($this->iterate() as &$_curTpl)
if (!$_curTpl['iconString'])
$_curTpl['iconString'] = 'inv_misc_questionmark';
$_curTpl['iconString'] = $_curTpl['iconString'] ?: DEFAULT_ICON;
}

View File

@@ -45,6 +45,9 @@ class ItemList extends BaseType
if ($_curTpl['scalingStatDistribution'] > 0 && $_curTpl['scalingStatValue'] > 0)
$this->initScalingStats();
// fix missing icons
$_curTpl['iconString'] = $_curTpl['iconString'] ?: DEFAULT_ICON;
$this->initJsonStats();
if ($miscData)

View File

@@ -34,7 +34,7 @@ class SkillList extends BaseType
}
if (!$_curTpl['iconId'])
$_curTpl['iconString'] = 'inv_misc_questionmark';
$_curTpl['iconString'] = DEFAULT_ICON;
}
}

View File

@@ -171,8 +171,8 @@ class SpellList extends BaseType
unset($_curTpl['skillLine1']);
unset($_curTpl['skillLine2OrMask']);
if (!$_curTpl['iconString'])
$_curTpl['iconString'] = 'inv_misc_questionmark';
// fix missing icons
$_curTpl['iconString'] = $_curTpl['iconString'] ?: DEFAULT_ICON;
$this->scaling[$this->id] = false;
}

View File

@@ -65,7 +65,7 @@ if (!CLI)
effect1MiscValue,
equippedItemClass, equippedItemInventoryTypeMask, equippedItemSubClassMask,
skillLine1,
IFNULL(i.name, "inv_misc_questionmark") AS iconString,
IFNULL(i.name, ?) AS iconString,
name_loc0, name_loc2, name_loc3, name_loc4, name_loc6, name_loc8
FROM
?_spell s
@@ -74,7 +74,7 @@ if (!CLI)
WHERE
effect1Id = ?d AND
name_loc0 NOT LIKE "QA%"'
, 53); // enchantItemPermanent && !qualityAssurance
,DEFAULT_ICON, SPELL_EFFECT_ENCHANT_ITEM);
// check directory-structure
foreach (Util::$localeStrings as $dir)