mirror of
https://github.com/msikma/pokesprite.git
synced 2026-04-25 08:07:20 -05:00
Don't add empty values to the icons json file
This commit is contained in:
parent
68d21b9cb2
commit
7f44330451
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"items": {
|
||||
"": null,
|
||||
"17": [
|
||||
"medicine",
|
||||
"potion.png"
|
||||
|
|
@ -213,9 +212,6 @@
|
|||
"791": null
|
||||
},
|
||||
"icons": {
|
||||
"": {
|
||||
"": null
|
||||
},
|
||||
"medicine": {
|
||||
"potion.png": {
|
||||
"item": {
|
||||
|
|
|
|||
|
|
@ -107,11 +107,15 @@ foreach ($items as $item) {
|
|||
// Save the object to the item/icon database.
|
||||
// If this item does not have an associated icon, the value will be null instead of a string.
|
||||
// If it does have an icon, the string is a reference to an icon ID in 'icons'.
|
||||
$item_icon_database[$obj['item']['id']] = !empty($obj['icon']['set']) ? array($obj['icon']['set'], $obj['icon']['filename']) : null;
|
||||
if (!isset($icon_database[$obj['icon']['set']])) {
|
||||
$icon_database[$obj['icon']['set']] = array();
|
||||
if ($obj['item']['id']) {
|
||||
$item_icon_database[$obj['item']['id']] = !empty($obj['icon']['set']) ? array($obj['icon']['set'], $obj['icon']['filename']) : null;
|
||||
}
|
||||
if ($obj['icon']['set']) {
|
||||
if (!isset($icon_database[$obj['icon']['set']])) {
|
||||
$icon_database[$obj['icon']['set']] = array();
|
||||
}
|
||||
$icon_database[$obj['icon']['set']][$obj['icon']['filename']] = $obj;
|
||||
}
|
||||
$icon_database[$obj['icon']['set']][$obj['icon']['filename']] = $obj;
|
||||
}
|
||||
|
||||
// Now we need to run through all existing physical icons to see which ones were not linked to an item.
|
||||
|
|
@ -202,7 +206,6 @@ function find_item_icon($item, $sets) {
|
|||
}
|
||||
}
|
||||
return $matches[0];
|
||||
//if (strpos($obj['icon']['slug'], 'revive') > -1) {
|
||||
|
||||
// NOTE: we're quitting the script here on error because all items should be accounted for.
|
||||
// If one isn't, we need to add it to ignored/aliased/typoed items.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user