From 45c0b609c4ab7b27fc090440c32fc8e9961e230c Mon Sep 17 00:00:00 2001 From: Michiel Sikma Date: Fri, 16 Dec 2016 15:01:27 +0100 Subject: [PATCH] Add option to exclude the special icons --- includes/defaults.php | 2 ++ includes/iconstack.php | 6 ++++-- includes/usage.php | 5 ++++- resources/usage.tpl | 3 +++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/includes/defaults.php b/includes/defaults.php index d737060c..cf426601 100644 --- a/includes/defaults.php +++ b/includes/defaults.php @@ -22,6 +22,8 @@ $s['include_pkmn_forms'] = true; $s['include_pkmn_right'] = 1; // Include the icon sets $s['include_icon_sets'] = true; +// Include the special icons (egg, unknown Pokémon) +$s['include_special_icons'] = true; // Language used for Pokémon names $s['pkmn_language'] = 'eng'; diff --git a/includes/iconstack.php b/includes/iconstack.php index e9719f6c..c18bd82f 100644 --- a/includes/iconstack.php +++ b/includes/iconstack.php @@ -575,8 +575,10 @@ class IconStack } // Add the special items (e.g. egg, unknown). - $special_items = $this->get_special_stack_items(); - $this->pkmn_stack = array_merge($this->pkmn_stack, $special_items); + if (Settings::get('include_special_icons')) { + $special_items = $this->get_special_stack_items(); + $this->pkmn_stack = array_merge($this->pkmn_stack, $special_items); + } } /** diff --git a/includes/usage.php b/includes/usage.php index 25196be1..7927c6f4 100644 --- a/includes/usage.php +++ b/includes/usage.php @@ -36,7 +36,7 @@ class Usage extends TemplateFormatter public static $ARG_NONE = array( 'exclude-pkmn', 'exclude-shiny', 'exclude-regular', 'exclude-forms', 'exclude-icon-sets', 'verbose', 'monochrome', 'help', 'no-pngcrush', - 'generate-markdown', 'no-padding', + 'generate-markdown', 'no-padding', 'exclude-special-icons', // Undocumented (debugging only): 'html-no-slugs', ); @@ -99,6 +99,9 @@ class Usage extends TemplateFormatter if ($arg == 'exclude-icon-sets') { $s['include_icon_sets'] = false; } + if ($arg == 'exclude-special-icons') { + $s['include_special_icons'] = false; + } if ($arg == 'exclude-forms') { $s['include_pkmn_forms'] = false; } diff --git a/resources/usage.tpl b/resources/usage.tpl index 2bd35fdb..33b28786 100644 --- a/resources/usage.tpl +++ b/resources/usage.tpl @@ -83,6 +83,9 @@ Options: --exclude-icon-sets Excludes icon sets (other than the Pokémon icons). + --exclude-special-icons + Excludes special icons (egg, and "unknown Pokémon"). + --no-pngcrush Skips the pngcrush step.