From 27f358a8b3cc80c56abc42edda5f12f41f3191bb Mon Sep 17 00:00:00 2001 From: virtuamon Date: Sat, 17 Mar 2018 06:37:36 +0100 Subject: [PATCH] refactor: code changes to support renamed icons --- README.md | 2 +- data/pkmn.json | 289 +++++++++++++++++++++++++++++++++++------- includes/defaults.php | 4 +- includes/i18n.php | 4 +- 4 files changed, 250 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 03b96d75..055831ed 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ The item icons have been organized in a set of collections. To display an icon, - + ``` diff --git a/data/pkmn.json b/data/pkmn.json index f9e76b09..9b16e650 100644 --- a/data/pkmn.json +++ b/data/pkmn.json @@ -299,7 +299,15 @@ }, "icons": { ".": {}, - "alola": {} + "alola": {}, + "totem": { + "is_duplicate": true, + "is_duplicate_from": "alola" + }, + "totem-alola": { + "is_duplicate": true, + "is_duplicate_from": "alola" + } }, "name": { "eng": "Raticate", @@ -375,16 +383,16 @@ }, "icons": { ".": {}, - "beautiful": { + "belle": { "has_right": true }, - "clever": {}, - "cool": {}, + "phd": {}, + "rock-star": {}, "cosplay": {}, - "cute": { + "pop-star": { "has_right": true }, - "tough": {}, + "libre": {}, "original-cap": { "has_right": true }, @@ -1628,7 +1636,15 @@ }, "icons": { ".": {}, - "alola": {} + "alola": {}, + "totem": { + "is_duplicate": true, + "is_duplicate_from": "alola" + }, + "totem-alola": { + "is_duplicate": true, + "is_duplicate_from": "alola" + } }, "name": { "eng": "Marowak", @@ -6419,7 +6435,16 @@ "jpn": "gameiru" }, "icons": { - ".": {} + ".": {}, + "plant": { + "is_duplicate": true + }, + "sandy": { + "is_duplicate": true + }, + "trash": { + "is_duplicate": true + } }, "name": { "eng": "Mothim", @@ -7666,6 +7691,9 @@ "psychic": {}, "rock": {}, "steel": {}, + "unkown": { + "is_duplicate": true + }, "water": {} }, "name": { @@ -10101,11 +10129,11 @@ }, "icons": { ".": {}, - "normal": {}, - "fire": {}, - "ice": {}, - "water": {}, - "electric": {} + "standard": {}, + "burn": {}, + "chill": {}, + "douse": {}, + "shock": {} }, "name": { "eng": "Genesect", @@ -10245,6 +10273,10 @@ }, "ash": { "has_right": true + }, + "battle-bond": { + "is_duplicate": true, + "is_duplicate_from": "ash" } }, "name": { @@ -10335,7 +10367,67 @@ "jpn": "kofukimushi" }, "icons": { - ".": {} + ".": {}, + "archipelago": { + "is_duplicate": true + }, + "continental": { + "is_duplicate": true + }, + "elegant": { + "is_duplicate": true + }, + "fancy": { + "is_duplicate": true + }, + "garden": { + "is_duplicate": true + }, + "high-plains": { + "is_duplicate": true + }, + "icy-snow": { + "is_duplicate": true + }, + "jungle": { + "is_duplicate": true + }, + "marine": { + "is_duplicate": true + }, + "meadow": { + "is_duplicate": true + }, + "modern": { + "is_duplicate": true + }, + "monsoon": { + "is_duplicate": true + }, + "ocean": { + "is_duplicate": true + }, + "poke-ball": { + "is_duplicate": true + }, + "polar": { + "is_duplicate": true + }, + "river": { + "is_duplicate": true + }, + "sandstorm": { + "is_duplicate": true + }, + "savanna": { + "is_duplicate": true + }, + "sun": { + "is_duplicate": true + }, + "tundra": { + "is_duplicate": true + } }, "name": { "eng": "Scatterbug", @@ -10350,7 +10442,67 @@ "jpn": "kofuurai" }, "icons": { - ".": {} + ".": {}, + "archipelago": { + "is_duplicate": true + }, + "continental": { + "is_duplicate": true + }, + "elegant": { + "is_duplicate": true + }, + "fancy": { + "is_duplicate": true + }, + "garden": { + "is_duplicate": true + }, + "high-plains": { + "is_duplicate": true + }, + "icy-snow": { + "is_duplicate": true + }, + "jungle": { + "is_duplicate": true + }, + "marine": { + "is_duplicate": true + }, + "meadow": { + "is_duplicate": true + }, + "modern": { + "is_duplicate": true + }, + "monsoon": { + "is_duplicate": true + }, + "ocean": { + "is_duplicate": true + }, + "poke-ball": { + "is_duplicate": true + }, + "polar": { + "is_duplicate": true + }, + "river": { + "is_duplicate": true + }, + "sandstorm": { + "is_duplicate": true + }, + "savanna": { + "is_duplicate": true + }, + "sun": { + "is_duplicate": true + }, + "tundra": { + "is_duplicate": true + } }, "name": { "eng": "Spewpa", @@ -10571,6 +10723,9 @@ "kabuki": {}, "la-reine": {}, "matron": {}, + "natural": { + "is_duplicate": true + }, "pharaoh": {}, "star": {} }, @@ -10604,6 +10759,10 @@ "icons": { ".": { "has_female": true + }, + "male": { + "is_duplicated": true, + "has_female": false } }, "name": { @@ -11237,10 +11396,10 @@ ".": { "has_right": true }, - "10-percent": { + "10": { "has_right": true }, - "50-percent": { + "50": { "is_duplicate": true, "has_right": true }, @@ -11505,7 +11664,10 @@ "jpn": "dekagusu" }, "icons": { - ".": {} + ".": {}, + "totem": { + "is_duplicate": true + } }, "name": { "eng": "Gumshoos", @@ -11550,7 +11712,10 @@ "jpn": "kuwaganon" }, "icons": { - ".": {} + ".": {}, + "totem": { + "is_duplicate": true + } }, "name": { "eng": "Vikavolt", @@ -11600,7 +11765,7 @@ "is_duplicate": true }, "pom-pom": {}, - "pa-u": {}, + "pau": {}, "sensu": {} }, "name": { @@ -11631,7 +11796,10 @@ "jpn": "aburibon" }, "icons": { - ".": {} + ".": {}, + "totem": { + "is_duplicate": true + } }, "name": { "eng": "Ribombee", @@ -11646,7 +11814,10 @@ "jpn": "iwanko" }, "icons": { - ".": {} + ".": {}, + "own-tempo": { + "is_duplicate": true + } }, "name": { "eng": "Rockruff", @@ -11775,7 +11946,10 @@ "jpn": "onishizukumo" }, "icons": { - ".": {} + ".": {}, + "totem": { + "is_duplicate": true + } }, "name": { "eng": "Araquanid", @@ -11805,7 +11979,10 @@ "jpn": "rarantesu" }, "icons": { - ".": {} + ".": {}, + "totem": { + "is_duplicate": true + } }, "name": { "eng": "Lurantis", @@ -11865,7 +12042,10 @@ "jpn": "ennyuto" }, "icons": { - ".": {} + ".": {}, + "totem": { + "is_duplicate": true + } }, "name": { "eng": "Salazzle", @@ -12134,46 +12314,46 @@ ".": { "has_right": true }, - "meteor-red": { + "red-meteor": { "is_duplicate": true }, - "meteor-orange": { + "orange-meteor": { "is_duplicate": true }, - "meteor-yellow": { + "yellow-meteor": { "is_duplicate": true }, - "meteor-green": { + "green-meteor": { "is_duplicate": true }, - "meteor-blue": { + "blue-meteor": { "is_duplicate": true }, - "meteor-indigo": { + "indigo-meteor": { "is_duplicate": true }, - "meteor-violet": { + "violet-meteor": { "is_duplicate": true }, - "core-red": { + "red": { "has_right": true }, - "core-orange": { + "orange": { "has_right": true }, - "core-yellow": { + "yellow": { "has_right": true }, - "core-green": { + "green": { "has_right": true }, - "core-blue": { + "blue": { "has_right": true }, - "core-indigo": { + "indigo": { "has_right": true }, - "core-violet": { + "violet": { "has_right": true } }, @@ -12220,7 +12400,10 @@ "jpn": "togedemaru" }, "icons": { - ".": {} + ".": {}, + "totem": { + "is_duplicate": true + } }, "name": { "eng": "Togedemaru", @@ -12235,7 +12418,22 @@ "jpn": "mimikkyu" }, "icons": { - ".": {} + ".": {}, + "busted": { + "is_duplicated": true + }, + "disguised": { + "is_duplicated": true + }, + "totem": { + "is_duplicated": true + }, + "totem-busted": { + "is_duplicated": true + }, + "totem-disguised": { + "is_duplicated": true + } }, "name": { "eng": "Mimikyu", @@ -12327,7 +12525,10 @@ "jpn": "jararanga" }, "icons": { - ".": {} + ".": {}, + "totem": { + "is_duplicate": true + } }, "name": { "eng": "Kommo-o", @@ -12570,10 +12771,10 @@ ".": { "has_right": true }, - "dusk-mane": { + "dusk": { "has_right": true }, - "dawn-wings": { + "dawn": { "has_right": true }, "ultra": { diff --git a/includes/defaults.php b/includes/defaults.php index 24962a45..95536674 100644 --- a/includes/defaults.php +++ b/includes/defaults.php @@ -89,10 +89,10 @@ $s['github_base_dir'] = 'https://raw.github.com/msikma/pokesprite/master/'; // If all images have the same size, their width and height is set only // once in the SCSS code for efficiency. $s['etc_icon_sets'] = array( - 'apricorn', 'battle-item', 'berry', 'body-style', 'etc', 'ev-item', + 'apricorn', 'ball', 'battle-item', 'berry', 'body-style', 'etc', 'ev-item', 'evo-item', 'flute', 'fossil', 'gem', 'hm', 'hold-item', 'incense', 'other-item', 'key-item', 'mail', 'medicine', 'mega-stone', 'mulch', - 'plate', 'pokeball', 'scarf', 'shard', 'tm', 'valuable-item', + 'plate', 'scarf', 'shard', 'tm', 'valuable-item', 'wonder-launcher', 'z-crystals', 'memory', 'roto', 'petal' ); diff --git a/includes/i18n.php b/includes/i18n.php index 17c1e283..ab595e9e 100644 --- a/includes/i18n.php +++ b/includes/i18n.php @@ -66,7 +66,7 @@ class I18n 'entry_added' => " Added file %s for entry %s.\n", 'arg_error_unknown' => 'unknown error', 'arg_error_include_right' => '--include-right must be 0, 1 or 2, e.g. --include-right=1', - 'arg_error_icon_sets' => '--icon-sets must be a comma-separated list, e.g. --icon-sets=apricorn,pokeball', + 'arg_error_icon_sets' => '--icon-sets must be a comma-separated list, e.g. --icon-sets=apricorn,ball', 'arg_error_file_exts' => '--file-exts must be a comma-separated list, e.g. --file-exts=png,jpg', 'arg_error_tpl' => "\nError: %s\n", 'tasks_overview' => "List of tasks to perform:\n", @@ -117,7 +117,7 @@ class I18n 'entry_added' => " Added file %s for entry %s.\n", 'arg_error_unknown' => 'unknown error', 'arg_error_include_right' => '--include-right must be 0, 1 or 2, e.g. --include-right=1', - 'arg_error_icon_sets' => '--icon-sets must be a comma-separated list, e.g. --icon-sets=apricorn,pokeball', + 'arg_error_icon_sets' => '--icon-sets must be a comma-separated list, e.g. --icon-sets=apricorn,ball', 'arg_error_file_exts' => '--file-exts must be a comma-separated list, e.g. --file-exts=png,jpg', 'arg_error_tpl' => "\nError: %s\n", 'tasks_overview' => "List of tasks to perform:\n",