diff --git a/Source/Android/jni/SkylanderConfig.cpp b/Source/Android/jni/SkylanderConfig.cpp index 306b574938..76a0718624 100644 --- a/Source/Android/jni/SkylanderConfig.cpp +++ b/Source/Android/jni/SkylanderConfig.cpp @@ -26,7 +26,7 @@ Java_org_dolphinemu_dolphinemu_features_skylanders_SkylanderConfig_getSkylanderM for (const auto& it : IOS::HLE::USB::list_skylanders) { - const std::string& name = it.second; + const std::string& name = it.second.name; jobject skylander_obj = env->NewObject(skylander_class, skylander_init, it.first.first, it.first.second); env->CallObjectMethod(hash_map_obj, IDCache::GetHashMapPut(), skylander_obj, @@ -51,7 +51,7 @@ Java_org_dolphinemu_dolphinemu_features_skylanders_SkylanderConfig_getInverseSky for (const auto& it : IOS::HLE::USB::list_skylanders) { - const std::string& name = it.second; + const std::string& name = it.second.name; jobject skylander_obj = env->NewObject(skylander_class, skylander_init, it.first.first, it.first.second); env->CallObjectMethod(hash_map_obj, IDCache::GetHashMapPut(), ToJString(env, name), @@ -104,7 +104,7 @@ Java_org_dolphinemu_dolphinemu_features_skylanders_SkylanderConfig_loadSkylander if (it != IOS::HLE::USB::list_skylanders.end()) { - name = it->second; + name = it->second.name; } return env->NewObject(pair_class, pair_init, @@ -151,7 +151,7 @@ Java_org_dolphinemu_dolphinemu_features_skylanders_SkylanderConfig_createSkyland if (it != IOS::HLE::USB::list_skylanders.end()) { - name = it->second; + name = it->second.name; } return env->NewObject(pair_class, pair_init, diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h index f6dc396966..2a2e112039 100644 --- a/Source/Core/Common/FileUtil.h +++ b/Source/Core/Common/FileUtil.h @@ -33,6 +33,8 @@ enum D_CONFIG_IDX, // global settings D_GAMESETTINGS_IDX, // user-specified settings which override both the global and the default // settings (per game) + D_SKYLANDERS_IDX, + D_MAPS_IDX, D_CACHE_IDX, D_COVERCACHE_IDX, diff --git a/Source/Core/Core/Config/MainSettings.cpp b/Source/Core/Core/Config/MainSettings.cpp index 3da8b874c6..e4eab66f4d 100644 --- a/Source/Core/Core/Config/MainSettings.cpp +++ b/Source/Core/Core/Config/MainSettings.cpp @@ -295,6 +295,8 @@ const Info MAIN_WIRELESS_MAC{{System::Main, "General", "WirelessMac const Info MAIN_GDB_SOCKET{{System::Main, "General", "GDBSocket"}, ""}; const Info MAIN_GDB_PORT{{System::Main, "General", "GDBPort"}, -1}; const Info MAIN_ISO_PATH_COUNT{{System::Main, "General", "ISOPaths"}, 0}; +const Info MAIN_SKYLANDERS_PATH{{System::Main, "General", "SkylandersCollectionPath"}, + ""}; static Info MakeISOPathConfigInfo(size_t idx) { diff --git a/Source/Core/Core/Config/MainSettings.h b/Source/Core/Core/Config/MainSettings.h index 7caba3f581..fe083c7248 100644 --- a/Source/Core/Core/Config/MainSettings.h +++ b/Source/Core/Core/Config/MainSettings.h @@ -194,6 +194,7 @@ extern const Info MAIN_WIRELESS_MAC; extern const Info MAIN_GDB_SOCKET; extern const Info MAIN_GDB_PORT; extern const Info MAIN_ISO_PATH_COUNT; +extern const Info MAIN_SKYLANDERS_PATH; std::vector GetIsoPaths(); void SetIsoPaths(const std::vector& paths); diff --git a/Source/Core/Core/IOS/USB/Emulated/Skylander.cpp b/Source/Core/Core/IOS/USB/Emulated/Skylander.cpp index 55a59d0bf4..f701ad4fe1 100644 --- a/Source/Core/Core/IOS/USB/Emulated/Skylander.cpp +++ b/Source/Core/Core/IOS/USB/Emulated/Skylander.cpp @@ -18,458 +18,460 @@ namespace IOS::HLE::USB { -const std::map, const char*> list_skylanders = { - {{0, 0x0000}, "Whirlwind"}, - {{0, 0x1801}, "Series 2 Whirlwind"}, - {{0, 0x1C02}, "Polar Whirlwind"}, - {{0, 0x2805}, "Horn Blast Whirlwind"}, - {{0, 0x3810}, "Eon's Elite Whirlwind"}, - {{1, 0x0000}, "Sonic Boom"}, - {{1, 0x1801}, "Series 2 Sonic Boom"}, - {{2, 0x0000}, "Warnado"}, - {{2, 0x2206}, "LightCore Warnado"}, - {{3, 0x0000}, "Lightning Rod"}, - {{3, 0x1801}, "Series 2 Lightning Rod"}, - {{4, 0x0000}, "Bash"}, - {{4, 0x1801}, "Series 2 Bash"}, - {{5, 0x0000}, "Terrafin"}, - {{5, 0x1801}, "Series 2 Terrafin"}, - {{5, 0x2805}, "Knockout Terrafin"}, - {{5, 0x3810}, "Eon's Elite Terrafin"}, - {{6, 0x0000}, "Dino Rang"}, - {{6, 0x4810}, "Eon's Elite Dino Rang"}, - {{7, 0x0000}, "Prism Break"}, - {{7, 0x1801}, "Series 2 Prism Break"}, - {{7, 0x2805}, "Hyper Beam Prism Break"}, - {{7, 0x1206}, "LightCore Prism Break"}, - {{8, 0x0000}, "Sunburn"}, - {{9, 0x0000}, "Eruptor"}, - {{9, 0x1801}, "Series 2 Eruptor"}, - {{9, 0x2C02}, "Volcanic Eruptor"}, - {{9, 0x2805}, "Lava Barf Eruptor"}, - {{9, 0x1206}, "LightCore Eruptor"}, - {{9, 0x3810}, "Eon's Elite Eruptor"}, - {{10, 0x0000}, "Ignitor"}, - {{10, 0x1801}, "Series 2 Ignitor"}, - {{10, 0x1C03}, "Legendary Ignitor"}, - {{11, 0x0000}, "Flameslinger"}, - {{11, 0x1801}, "Series 2 Flameslinger"}, - {{12, 0x0000}, "Zap"}, - {{12, 0x1801}, "Series 2 Zap"}, - {{13, 0x0000}, "Wham Shell"}, - {{13, 0x2206}, "LightCore Wham Shell"}, - {{14, 0x0000}, "Gill Grunt"}, - {{14, 0x1801}, "Series 2 Gill Grunt"}, - {{14, 0x2805}, "Anchors Away Gill Grunt"}, - {{14, 0x3805}, "Tidal Wave Gill Grunt"}, - {{14, 0x3810}, "Eon's Elite Gill Grunt"}, - {{15, 0x0000}, "Slam Bam"}, - {{15, 0x1801}, "Series 2 Slam Bam"}, - {{15, 0x1C03}, "Legendary Slam Bam"}, - {{15, 0x4810}, "Eon's Elite Slam Bam"}, - {{16, 0x0000}, "Spyro"}, - {{16, 0x1801}, "Series 2 Spyro"}, - {{16, 0x2C02}, "Dark Mega Ram Spyro"}, - {{16, 0x2805}, "Mega Ram Spyro"}, - {{16, 0x3810}, "Eon's Elite Spyro"}, - {{17, 0x0000}, "Voodood"}, - {{17, 0x4810}, "Eon's Elite Voodood"}, - {{18, 0x0000}, "Double Trouble"}, - {{18, 0x1801}, "Series 2 Double Trouble"}, - {{18, 0x1C02}, "Royal Double Trouble"}, - {{19, 0x0000}, "Trigger Happy"}, - {{19, 0x1801}, "Series 2 Trigger Happy"}, - {{19, 0x2C02}, "Springtime Trigger Happy"}, - {{19, 0x2805}, "Big Bang Trigger Happy"}, - {{19, 0x3810}, "Eon's Elite Trigger Happy"}, - {{20, 0x0000}, "Drobot"}, - {{20, 0x1801}, "Series 2 Drobot"}, - {{20, 0x1206}, "LightCore Drobot"}, - {{21, 0x0000}, "Drill Seargeant"}, - {{21, 0x1801}, "Series 2 Drill Seargeant"}, - {{22, 0x0000}, "Boomer"}, - {{22, 0x4810}, "Eon's Elite Boomer"}, - {{23, 0x0000}, "Wrecking Ball"}, - {{23, 0x1801}, "Series 2 Wrecking Ball"}, - {{24, 0x0000}, "Camo"}, - {{24, 0x2805}, "Thorn Horn Camo"}, - {{25, 0x0000}, "Zook"}, - {{25, 0x1801}, "Series 2 Zook"}, - {{25, 0x4810}, "Eon's Elite Zook"}, - {{26, 0x0000}, "Stealth Elf"}, - {{26, 0x1801}, "Series 2 Stealth Elf"}, - {{26, 0x2C02}, "Dark Stealth Elf"}, - {{26, 0x1C03}, "Legendary Stealth Elf"}, - {{26, 0x2805}, "Ninja Stealth Elf"}, - {{26, 0x3810}, "Eon's Elite Stealth Elf"}, - {{27, 0x0000}, "Stump Smash"}, - {{27, 0x1801}, "Series 2 Stump Smash"}, - {{28, 0x0000}, "Dark Spyro"}, - {{29, 0x0000}, "Hex"}, - {{29, 0x1801}, "Series 2 Hex"}, - {{29, 0x1206}, "LightCore Hex"}, - {{30, 0x0000}, "Chop Chop"}, - {{30, 0x1801}, "Series 2 Chop Chop"}, - {{30, 0x2805}, "Twin Blade Chop Chop"}, - {{30, 0x3810}, "Eon's Elite Chop Chop"}, - {{31, 0x0000}, "Ghost Roaster"}, - {{31, 0x4810}, "Eon's Elite Ghost Roaster"}, - {{32, 0x0000}, "Cynder"}, - {{32, 0x1801}, "Series 2 Cynder"}, - {{32, 0x2805}, "Phantom Cynder"}, - {{100, 0x0000}, "Jet Vac"}, - {{100, 0x1403}, "Legendary Jet Vac"}, - {{100, 0x2805}, "Turbo Jet Vac"}, - {{100, 0x3805}, "Full Blast Jet Vac"}, - {{100, 0x1206}, "LightCore Jet Vac"}, - {{101, 0x0000}, "Swarm"}, - {{102, 0x0000}, "Crusher"}, - {{102, 0x1602}, "Granite Crusher"}, - {{103, 0x0000}, "Flashwing"}, - {{103, 0x1402}, "Jade Flash Wing"}, - {{103, 0x2206}, "LightCore Flashwing"}, - {{104, 0x0000}, "Hot Head"}, - {{105, 0x0000}, "Hot Dog"}, - {{105, 0x1402}, "Molten Hot Dog"}, - {{105, 0x2805}, "Fire Bone Hot Dog"}, - {{106, 0x0000}, "Chill"}, - {{106, 0x1603}, "Legendary Chill"}, - {{106, 0x2805}, "Blizzard Chill"}, - {{106, 0x1206}, "LightCore Chill"}, - {{107, 0x0000}, "Thumpback"}, - {{108, 0x0000}, "Pop Fizz"}, - {{108, 0x1402}, "Punch Pop Fizz"}, - {{108, 0x3C02}, "Love Potion Pop Fizz"}, - {{108, 0x2805}, "Super Gulp Pop Fizz"}, - {{108, 0x3805}, "Fizzy Frenzy Pop Fizz"}, - {{108, 0x1206}, "LightCore Pop Fizz"}, - {{109, 0x0000}, "Ninjini"}, - {{109, 0x1602}, "Scarlet Ninjini"}, - {{110, 0x0000}, "Bouncer"}, - {{110, 0x1603}, "Legendary Bouncer"}, - {{111, 0x0000}, "Sprocket"}, - {{111, 0x2805}, "Heavy Duty Sprocket"}, - {{112, 0x0000}, "Tree Rex"}, - {{112, 0x1602}, "Gnarly Tree Rex"}, - {{113, 0x0000}, "Shroomboom"}, - {{113, 0x3805}, "Sure Shot Shroomboom"}, - {{113, 0x1206}, "LightCore Shroomboom"}, - {{114, 0x0000}, "Eye Brawl"}, - {{115, 0x0000}, "Fright Rider"}, - {{200, 0x0000}, "Anvil Rain"}, - {{201, 0x0000}, "Hidden Treasure"}, - {{201, 0x2000}, "Platinum Hidden Treasure"}, - {{202, 0x0000}, "Healing Elixir"}, - {{203, 0x0000}, "Ghost Pirate Swords"}, - {{204, 0x0000}, "Time Twist Hourglass"}, - {{205, 0x0000}, "Sky Iron Shield"}, - {{206, 0x0000}, "Winged Boots"}, - {{207, 0x0000}, "Sparx the Dragonfly"}, - {{208, 0x0000}, "Dragonfire Cannon"}, - {{208, 0x1602}, "Golden Dragonfire Cannon"}, - {{209, 0x0000}, "Scorpion Striker"}, - {{210, 0x3002}, "Biter's Bane"}, - {{210, 0x3008}, "Sorcerous Skull"}, - {{210, 0x300B}, "Axe of Illusion"}, - {{210, 0x300E}, "Arcane Hourglass"}, - {{210, 0x3012}, "Spell Slapper"}, - {{210, 0x3014}, "Rune Rocket"}, - {{211, 0x3001}, "Tidal Tiki"}, - {{211, 0x3002}, "Wet Walter"}, - {{211, 0x3006}, "Flood Flask"}, - {{211, 0x3406}, "Legendary Flood Flask"}, - {{211, 0x3007}, "Soaking Staff"}, - {{211, 0x300B}, "Aqua Axe"}, - {{211, 0x3016}, "Frost Helm"}, - {{212, 0x3003}, "Breezy Bird"}, - {{212, 0x3006}, "Drafty Decanter"}, - {{212, 0x300D}, "Tempest Timer"}, - {{212, 0x3010}, "Cloudy Cobra"}, - {{212, 0x3011}, "Storm Warning"}, - {{212, 0x3018}, "Cyclone Saber"}, - {{213, 0x3004}, "Spirit Sphere"}, - {{213, 0x3404}, "Legendary Spirit Sphere"}, - {{213, 0x3008}, "Spectral Skull"}, - {{213, 0x3408}, "Legendary Spectral Skull"}, - {{213, 0x300B}, "Haunted Hatchet"}, - {{213, 0x300C}, "Grim Gripper"}, - {{213, 0x3010}, "Spooky Snake"}, - {{213, 0x3017}, "Dream Piercer"}, - {{214, 0x3000}, "Tech Totem"}, - {{214, 0x3007}, "Automatic Angel"}, - {{214, 0x3009}, "Factory Flower"}, - {{214, 0x300C}, "Grabbing Gadget"}, - {{214, 0x3016}, "Makers Mana"}, - {{214, 0x301A}, "Topsy Techy"}, - {{215, 0x3005}, "Eternal Flame"}, - {{215, 0x3009}, "Fire Flower"}, - {{215, 0x3011}, "Scorching Stopper"}, - {{215, 0x3012}, "Searing Spinner"}, - {{215, 0x3017}, "Spark Spear"}, - {{215, 0x301B}, "Blazing Belch"}, - {{216, 0x3000}, "Banded Boulder"}, - {{216, 0x3003}, "Rock Hawk"}, - {{216, 0x300A}, "Slag Hammer"}, - {{216, 0x300E}, "Dust Of Time"}, - {{216, 0x3013}, "Spinning Sandstorm"}, - {{216, 0x301A}, "Rubble Trouble"}, - {{217, 0x3003}, "Oak Eagle"}, - {{217, 0x3005}, "Emerald Energy"}, - {{217, 0x300A}, "Weed Whacker"}, - {{217, 0x3010}, "Seed Serpent"}, - {{217, 0x3018}, "Jade Blade"}, - {{217, 0x301B}, "Shrub Shrieker"}, - {{218, 0x3000}, "Dark Dagger"}, - {{218, 0x3014}, "Shadow Spider"}, - {{218, 0x301A}, "Ghastly Grimace"}, - {{219, 0x3000}, "Shining Ship"}, - {{219, 0x300F}, "Heavenly Hawk"}, - {{219, 0x301B}, "Beam Scream"}, - {{220, 0x301E}, "Kaos Trap"}, - {{220, 0x351F}, "Ultimate Kaos Trap"}, - {{230, 0x0000}, "Hand of Fate"}, - {{230, 0x3403}, "Legendary Hand of Fate"}, - {{231, 0x0000}, "Piggy Bank"}, - {{232, 0x0000}, "Rocket Ram"}, - {{233, 0x0000}, "Tiki Speaky"}, - {{300, 0x0000}, "Dragon’s Peak"}, - {{301, 0x0000}, "Empire of Ice"}, - {{302, 0x0000}, "Pirate Seas"}, - {{303, 0x0000}, "Darklight Crypt"}, - {{304, 0x0000}, "Volcanic Vault"}, - {{305, 0x0000}, "Mirror of Mystery"}, - {{306, 0x0000}, "Nightmare Express"}, - {{307, 0x0000}, "Sunscraper Spire"}, - {{308, 0x0000}, "Midnight Museum"}, - {{404, 0x0000}, "Legendary Bash"}, - {{416, 0x0000}, "Legendary Spyro"}, - {{419, 0x0000}, "Legendary Trigger Happy"}, - {{430, 0x0000}, "Legendary Chop Chop"}, - {{450, 0x0000}, "Gusto"}, - {{451, 0x0000}, "Thunderbolt"}, - {{452, 0x0000}, "Fling Kong"}, - {{453, 0x0000}, "Blades"}, - {{453, 0x3403}, "Legendary Blades"}, - {{454, 0x0000}, "Wallop"}, - {{455, 0x0000}, "Head Rush"}, - {{455, 0x3402}, "Nitro Head Rush"}, - {{456, 0x0000}, "Fist Bump"}, - {{457, 0x0000}, "Rocky Roll"}, - {{458, 0x0000}, "Wildfire"}, - {{458, 0x3402}, "Dark Wildfire"}, - {{459, 0x0000}, "Ka Boom"}, - {{460, 0x0000}, "Trail Blazer"}, - {{461, 0x0000}, "Torch"}, - {{462, 0x0000}, "Snap Shot"}, - {{462, 0x3402}, "Dark Snap Shot"}, - {{463, 0x0000}, "Lob Star"}, - {{463, 0x3402}, "Winterfest Lob-Star"}, - {{464, 0x0000}, "Flip Wreck"}, - {{465, 0x0000}, "Echo"}, - {{466, 0x0000}, "Blastermind"}, - {{467, 0x0000}, "Enigma"}, - {{468, 0x0000}, "Deja Vu"}, - {{468, 0x3403}, "Legendary Deja Vu"}, - {{469, 0x0000}, "Cobra Candabra"}, - {{469, 0x3402}, "King Cobra Cadabra"}, - {{470, 0x0000}, "Jawbreaker"}, - {{470, 0x3403}, "Legendary Jawbreaker"}, - {{471, 0x0000}, "Gearshift"}, - {{472, 0x0000}, "Chopper"}, - {{473, 0x0000}, "Tread Head"}, - {{474, 0x0000}, "Bushwack"}, - {{474, 0x3403}, "Legendary Bushwack"}, - {{475, 0x0000}, "Tuff Luck"}, - {{476, 0x0000}, "Food Fight"}, - {{476, 0x3402}, "Dark Food Fight"}, - {{477, 0x0000}, "High Five"}, - {{478, 0x0000}, "Krypt King"}, - {{478, 0x3402}, "Nitro Krypt King"}, - {{479, 0x0000}, "Short Cut"}, - {{480, 0x0000}, "Bat Spin"}, - {{481, 0x0000}, "Funny Bone"}, - {{482, 0x0000}, "Knight Light"}, - {{483, 0x0000}, "Spotlight"}, - {{484, 0x0000}, "Knight Mare"}, - {{485, 0x0000}, "Blackout"}, - {{502, 0x0000}, "Bop"}, - {{505, 0x0000}, "Terrabite"}, - {{506, 0x0000}, "Breeze"}, - {{508, 0x0000}, "Pet Vac"}, - {{508, 0x3402}, "Power Punch Pet Vac"}, - {{507, 0x0000}, "Weeruptor"}, - {{507, 0x3402}, "Eggcellent Weeruptor"}, - {{509, 0x0000}, "Small Fry"}, - {{510, 0x0000}, "Drobit"}, - {{519, 0x0000}, "Trigger Snappy"}, - {{526, 0x0000}, "Whisper Elf"}, - {{540, 0x0000}, "Barkley"}, - {{540, 0x3402}, "Gnarly Barkley"}, - {{541, 0x0000}, "Thumpling"}, - {{514, 0x0000}, "Gill Runt"}, - {{542, 0x0000}, "Mini-Jini"}, - {{503, 0x0000}, "Spry"}, - {{504, 0x0000}, "Hijinx"}, - {{543, 0x0000}, "Eye Small"}, - {{1000, 0x0000}, "Boom Jet (Bottom)"}, - {{1001, 0x0000}, "Free Ranger (Bottom)"}, - {{1001, 0x2403}, "Legendary Free Ranger (Bottom)"}, - {{1002, 0x0000}, "Rubble Rouser (Bottom)"}, - {{1003, 0x0000}, "Doom Stone (Bottom)"}, - {{1004, 0x0000}, "Blast Zone (Bottom)"}, - {{1004, 0x2402}, "Dark Blast Zone (Bottom)"}, - {{1005, 0x0000}, "Fire Kraken (Bottom)"}, - {{1005, 0x2402}, "Jade Fire Kraken (Bottom)"}, - {{1006, 0x0000}, "Stink Bomb (Bottom)"}, - {{1007, 0x0000}, "Grilla Drilla (Bottom)"}, - {{1008, 0x0000}, "Hoot Loop (Bottom)"}, - {{1008, 0x2402}, "Enchanted Hoot Loop (Bottom)"}, - {{1009, 0x0000}, "Trap Shadow (Bottom)"}, - {{1010, 0x0000}, "Magna Charge (Bottom)"}, - {{1010, 0x2402}, "Nitro Magna Charge (Bottom)"}, - {{1011, 0x0000}, "Spy Rise (Bottom)"}, - {{1012, 0x0000}, "Night Shift (Bottom)"}, - {{1012, 0x2403}, "Legendary Night Shift (Bottom)"}, - {{1013, 0x0000}, "Rattle Shake (Bottom)"}, - {{1013, 0x2402}, "Quick Draw Rattle Shake (Bottom)"}, - {{1014, 0x0000}, "Freeze Blade (Bottom)"}, - {{1014, 0x2402}, "Nitro Freeze Blade (Bottom)"}, - {{1015, 0x0000}, "Wash Buckler (Bottom)"}, - {{1015, 0x2402}, "Dark Wash Buckler (Bottom)"}, - {{2000, 0x0000}, "Boom Jet (Top)"}, - {{2001, 0x0000}, "Free Ranger (Top)"}, - {{2001, 0x2403}, "Legendary Free Ranger (Top)"}, - {{2002, 0x0000}, "Rubble Rouser (Top)"}, - {{2003, 0x0000}, "Doom Stone (Top)"}, - {{2004, 0x0000}, "Blast Zone (Top)"}, - {{2004, 0x2402}, "Dark Blast Zone (Top)"}, - {{2005, 0x0000}, "Fire Kraken (Top)"}, - {{2005, 0x2402}, "Jade Fire Kraken (Top)"}, - {{2006, 0x0000}, "Stink Bomb (Top)"}, - {{2007, 0x0000}, "Grilla Drilla (Top)"}, - {{2008, 0x0000}, "Hoot Loop (Top)"}, - {{2008, 0x2402}, "Enchanted Hoot Loop (Top)"}, - {{2009, 0x0000}, "Trap Shadow (Top)"}, - {{2010, 0x0000}, "Magna Charge (Top)"}, - {{2010, 0x2402}, "Nitro Magna Charge (Top)"}, - {{2011, 0x0000}, "Spy Rise (Top)"}, - {{2012, 0x0000}, "Night Shift (Top)"}, - {{2012, 0x2403}, "Legendary Night Shift (Top)"}, - {{2013, 0x0000}, "Rattle Shake (Top)"}, - {{2013, 0x2402}, "Quick Draw Rattle Shake (Top)"}, - {{2014, 0x0000}, "Freeze Blade (Top)"}, - {{2014, 0x2402}, "Nitro Freeze Blade (Top)"}, - {{2015, 0x0000}, "Wash Buckler (Top)"}, - {{2015, 0x2402}, "Dark Wash Buckler (Top)"}, - {{3000, 0x0000}, "Scratch"}, - {{3001, 0x0000}, "Pop Thorn"}, - {{3002, 0x0000}, "Slobber Tooth"}, - {{3002, 0x2402}, "Dark Slobber Tooth"}, - {{3003, 0x0000}, "Scorp"}, - {{3004, 0x0000}, "Fryno"}, - {{3004, 0x3805}, "Hog Wild Fryno"}, - {{3005, 0x0000}, "Smolderdash"}, - {{3005, 0x2206}, "LightCore Smolderdash"}, - {{3006, 0x0000}, "Bumble Blast"}, - {{3006, 0x2402}, "Jolly Bumble Blast"}, - {{3006, 0x2206}, "LightCore Bumble Blast"}, - {{3007, 0x0000}, "Zoo Lou"}, - {{3007, 0x2403}, "Legendary Zoo Lou"}, - {{3008, 0x0000}, "Dune Bug"}, - {{3009, 0x0000}, "Star Strike"}, - {{3009, 0x2602}, "Enchanted Star Strike"}, - {{3009, 0x2206}, "LightCore Star Strike"}, - {{3010, 0x0000}, "Countdown"}, - {{3010, 0x2402}, "Kickoff Countdown"}, - {{3010, 0x2206}, "LightCore Countdown"}, - {{3011, 0x0000}, "Wind Up"}, - {{3011, 0x2404}, "Gear Head VVind Up"}, - {{3012, 0x0000}, "Roller Brawl"}, - {{3013, 0x0000}, "Grim Creeper"}, - {{3013, 0x2603}, "Legendary Grim Creeper"}, - {{3013, 0x2206}, "LightCore Grim Creeper"}, - {{3014, 0x0000}, "Rip Tide"}, - {{3015, 0x0000}, "Punk Shock"}, - {{3200, 0x0000}, "Battle Hammer"}, - {{3201, 0x0000}, "Sky Diamond"}, - {{3202, 0x0000}, "Platinum Sheep"}, - {{3203, 0x0000}, "Groove Machine"}, - {{3204, 0x0000}, "UFO Hat"}, - {{3300, 0x0000}, "Sheep Wreck Island"}, - {{3301, 0x0000}, "Tower of Time"}, - {{3302, 0x0000}, "Fiery Forge"}, - {{3303, 0x0000}, "Arkeyan Crossbow"}, - {{3220, 0x0000}, "Jet Stream"}, - {{3221, 0x0000}, "Tomb Buggy"}, - {{3222, 0x0000}, "Reef Ripper"}, - {{3223, 0x0000}, "Burn Cycle"}, - {{3224, 0x0000}, "Hot Streak"}, - {{3224, 0x4402}, "Dark Hot Streak"}, - {{3224, 0x4004}, "E3 Hot Streak"}, - {{3224, 0x441E}, "Golden Hot Streak"}, - {{3225, 0x0000}, "Shark Tank"}, - {{3226, 0x0000}, "Thump Truck"}, - {{3227, 0x0000}, "Crypt Crusher"}, - {{3228, 0x0000}, "Stealth Stinger"}, - {{3228, 0x4402}, "Nitro Stealth Stinger"}, - {{3231, 0x0000}, "Dive Bomber"}, - {{3231, 0x4402}, "Spring Ahead Dive Bomber"}, - {{3232, 0x0000}, "Sky Slicer"}, - {{3233, 0x0000}, "Clown Cruiser (Nintendo Only)"}, - {{3233, 0x4402}, "Dark Clown Cruiser (Nintendo Only)"}, - {{3234, 0x0000}, "Gold Rusher"}, - {{3234, 0x4402}, "Power Blue Gold Rusher"}, - {{3235, 0x0000}, "Shield Striker"}, - {{3236, 0x0000}, "Sun Runner"}, - {{3236, 0x4403}, "Legendary Sun Runner"}, - {{3237, 0x0000}, "Sea Shadow"}, - {{3237, 0x4402}, "Dark Sea Shadow"}, - {{3238, 0x0000}, "Splatter Splasher"}, - {{3238, 0x4402}, "Power Blue Splatter Splasher"}, - {{3239, 0x0000}, "Soda Skimmer"}, - {{3240, 0x0000}, "Barrel Blaster (Nintendo Only)"}, - {{3240, 0x4402}, "Dark Barrel Blaster (Nintendo Only)"}, - {{3239, 0x4402}, "Nitro Soda Skimmer"}, - {{3241, 0x0000}, "Buzz Wing"}, - {{3400, 0x0000}, "Fiesta"}, - {{3400, 0x4515}, "Frightful Fiesta"}, - {{3401, 0x0000}, "High Volt"}, - {{3402, 0x0000}, "Splat"}, - {{3402, 0x4502}, "Power Blue Splat"}, - {{3406, 0x0000}, "Stormblade"}, - {{3411, 0x0000}, "Smash Hit"}, - {{3411, 0x4502}, "Steel Plated Smash Hit"}, - {{3412, 0x0000}, "Spitfire"}, - {{3412, 0x4502}, "Dark Spitfire"}, - {{3413, 0x0000}, "Hurricane Jet Vac"}, - {{3413, 0x4503}, "Legendary Hurricane Jet Vac"}, - {{3414, 0x0000}, "Double Dare Trigger Happy"}, - {{3414, 0x4502}, "Power Blue Double Dare Trigger Happy"}, - {{3415, 0x0000}, "Super Shot Stealth Elf"}, - {{3415, 0x4502}, "Dark Super Shot Stealth Elf"}, - {{3416, 0x0000}, "Shark Shooter Terrafin"}, - {{3417, 0x0000}, "Bone Bash Roller Brawl"}, - {{3417, 0x4503}, "Legendary Bone Bash Roller Brawl"}, - {{3420, 0x0000}, "Big Bubble Pop Fizz"}, - {{3420, 0x450E}, "Birthday Bash Big Bubble Pop Fizz"}, - {{3421, 0x0000}, "Lava Lance Eruptor"}, - {{3422, 0x0000}, "Deep Dive Gill Grunt"}, - {{3423, 0x0000}, "Turbo Charge Donkey Kong (Nintendo Only)"}, - {{3423, 0x4502}, "Dark Turbo Charge Donkey Kong (Nintendo Only)"}, - {{3424, 0x0000}, "Hammer Slam Bowser (Nintendo Only)"}, - {{3424, 0x4502}, "Dark Hammer Slam Bowser (Nintendo Only)"}, - {{3425, 0x0000}, "Dive-Clops"}, - {{3425, 0x450E}, "Missile-Tow Dive-Clops"}, - {{3426, 0x0000}, "Astroblast"}, - {{3426, 0x4503}, "Legendary Astroblast"}, - {{3427, 0x0000}, "Nightfall"}, - {{3428, 0x0000}, "Thrillipede"}, - {{3428, 0x450D}, "Eggcited Thrillipede"}, - {{3500, 0x0000}, "Sky Trophy"}, - {{3501, 0x0000}, "Land Trophy"}, - {{3502, 0x0000}, "Sea Trophy"}, - {{3503, 0x0000}, "Kaos Trophy"}, -}; +const std::map, SkyData> list_skylanders = { + {{0, 0x0000}, {"Whirlwind", Game::SpyrosAdv, Element::Air}}, + {{0, 0x1801}, {"Series 2 Whirlwind", Game::Giants, Element::Air}}, + {{0, 0x1C02}, {"Polar Whirlwind", Game::Giants, Element::Air}}, + {{0, 0x2805}, {"Horn Blast Whirlwind", Game::SwapForce, Element::Air}}, + {{0, 0x3810}, {"Eon's Elite Whirlwind", Game::TrapTeam, Element::Air}}, + {{1, 0x0000}, {"Sonic Boom", Game::SpyrosAdv, Element::Air}}, + {{1, 0x1801}, {"Series 2 Sonic Boom", Game::Giants, Element::Air}}, + {{2, 0x0000}, {"Warnado", Game::SpyrosAdv, Element::Air}}, + {{2, 0x2206}, {"LightCore Warnado", Game::SwapForce, Element::Air}}, + {{3, 0x0000}, {"Lightning Rod", Game::SpyrosAdv, Element::Air}}, + {{3, 0x1801}, {"Series 2 Lightning Rod", Game::Giants, Element::Air}}, + {{4, 0x0000}, {"Bash", Game::SpyrosAdv, Element::Earth}}, + {{4, 0x1801}, {"Series 2 Bash", Game::Giants, Element::Earth}}, + {{5, 0x0000}, {"Terrafin", Game::SpyrosAdv, Element::Earth}}, + {{5, 0x1801}, {"Series 2 Terrafin", Game::Giants, Element::Earth}}, + {{5, 0x2805}, {"Knockout Terrafin", Game::SwapForce, Element::Earth}}, + {{5, 0x3810}, {"Eon's Elite Terrafin", Game::TrapTeam, Element::Earth}}, + {{6, 0x0000}, {"Dino Rang", Game::SpyrosAdv, Element::Earth}}, + {{6, 0x4810}, {"Eon's Elite Dino Rang", Game::Superchargers, Element::Earth}}, + {{7, 0x0000}, {"Prism Break", Game::SpyrosAdv, Element::Earth}}, + {{7, 0x1801}, {"Series 2 Prism Break", Game::Giants, Element::Earth}}, + {{7, 0x2805}, {"Hyper Beam Prism Break", Game::SwapForce, Element::Earth}}, + {{7, 0x1206}, {"LightCore Prism Break", Game::Giants, Element::Earth}}, + {{8, 0x0000}, {"Sunburn", Game::SpyrosAdv, Element::Fire}}, + {{9, 0x0000}, {"Eruptor", Game::SpyrosAdv, Element::Fire}}, + {{9, 0x1801}, {"Series 2 Eruptor", Game::Giants, Element::Fire}}, + {{9, 0x2C02}, {"Volcanic Eruptor", Game::SwapForce, Element::Fire}}, + {{9, 0x2805}, {"Lava Barf Eruptor", Game::SwapForce, Element::Fire}}, + {{9, 0x1206}, {"LightCore Eruptor", Game::Giants, Element::Fire}}, + {{9, 0x3810}, {"Eon's Elite Eruptor", Game::TrapTeam, Element::Fire}}, + {{10, 0x0000}, {"Ignitor", Game::SpyrosAdv, Element::Fire}}, + {{10, 0x1801}, {"Series 2 Ignitor", Game::Giants, Element::Fire}}, + {{10, 0x1C03}, {"Legendary Ignitor", Game::Giants, Element::Fire}}, + {{11, 0x0000}, {"Flameslinger", Game::SpyrosAdv, Element::Fire}}, + {{11, 0x1801}, {"Series 2 Flameslinger", Game::Giants, Element::Fire}}, + {{12, 0x0000}, {"Zap", Game::SpyrosAdv, Element::Water}}, + {{12, 0x1801}, {"Series 2 Zap", Game::Giants, Element::Water}}, + {{13, 0x0000}, {"Wham Shell", Game::SpyrosAdv, Element::Water}}, + {{13, 0x2206}, {"LightCore Wham Shell", Game::SwapForce, Element::Water}}, + {{14, 0x0000}, {"Gill Grunt", Game::SpyrosAdv, Element::Water}}, + {{14, 0x1801}, {"Series 2 Gill Grunt", Game::Giants, Element::Water}}, + {{14, 0x2805}, {"Anchors Away Gill Grunt", Game::SwapForce, Element::Water}}, + {{14, 0x3805}, {"Tidal Wave Gill Grunt", Game::TrapTeam, Element::Water}}, + {{14, 0x3810}, {"Eon's Elite Gill Grunt", Game::TrapTeam, Element::Water}}, + {{15, 0x0000}, {"Slam Bam", Game::SpyrosAdv, Element::Water}}, + {{15, 0x1801}, {"Series 2 Slam Bam", Game::Giants, Element::Water}}, + {{15, 0x1C03}, {"Legendary Slam Bam", Game::Giants, Element::Water}}, + {{15, 0x4810}, {"Eon's Elite Slam Bam", Game::Superchargers, Element::Water}}, + {{16, 0x0000}, {"Spyro", Game::SpyrosAdv, Element::Magic}}, + {{16, 0x1801}, {"Series 2 Spyro", Game::Giants, Element::Magic}}, + {{16, 0x2C02}, {"Dark Mega Ram Spyro", Game::SwapForce, Element::Magic}}, + {{16, 0x2805}, {"Mega Ram Spyro", Game::SwapForce, Element::Magic}}, + {{16, 0x3810}, {"Eon's Elite Spyro", Game::TrapTeam, Element::Magic}}, + {{17, 0x0000}, {"Voodood", Game::SpyrosAdv, Element::Magic}}, + {{17, 0x4810}, {"Eon's Elite Voodood", Game::Superchargers, Element::Magic}}, + {{18, 0x0000}, {"Double Trouble", Game::SpyrosAdv, Element::Magic}}, + {{18, 0x1801}, {"Series 2 Double Trouble", Game::Giants, Element::Magic}}, + {{18, 0x1C02}, {"Royal Double Trouble", Game::Giants, Element::Magic}}, + {{19, 0x0000}, {"Trigger Happy", Game::SpyrosAdv, Element::Tech}}, + {{19, 0x1801}, {"Series 2 Trigger Happy", Game::Giants, Element::Tech}}, + {{19, 0x2C02}, {"Springtime Trigger Happy", Game::SwapForce, Element::Tech}}, + {{19, 0x2805}, {"Big Bang Trigger Happy", Game::SwapForce, Element::Tech}}, + {{19, 0x3810}, {"Eon's Elite Trigger Happy", Game::TrapTeam, Element::Tech}}, + {{20, 0x0000}, {"Drobot", Game::SpyrosAdv, Element::Tech}}, + {{20, 0x1801}, {"Series 2 Drobot", Game::Giants, Element::Tech}}, + {{20, 0x1206}, {"LightCore Drobot", Game::Giants, Element::Tech}}, + {{21, 0x0000}, {"Drill Seargeant", Game::SpyrosAdv, Element::Tech}}, + {{21, 0x1801}, {"Series 2 Drill Seargeant", Game::Giants, Element::Tech}}, + {{22, 0x0000}, {"Boomer", Game::SpyrosAdv, Element::Tech}}, + {{22, 0x4810}, {"Eon's Elite Boomer", Game::Superchargers, Element::Tech}}, + {{23, 0x0000}, {"Wrecking Ball", Game::SpyrosAdv, Element::Magic}}, + {{23, 0x1801}, {"Series 2 Wrecking Ball", Game::Giants, Element::Magic}}, + {{24, 0x0000}, {"Camo", Game::SpyrosAdv, Element::Life}}, + {{24, 0x2805}, {"Thorn Horn Camo", Game::SwapForce, Element::Life}}, + {{25, 0x0000}, {"Zook", Game::SpyrosAdv, Element::Life}}, + {{25, 0x1801}, {"Series 2 Zook", Game::Giants, Element::Life}}, + {{25, 0x4810}, {"Eon's Elite Zook", Game::Superchargers, Element::Life}}, + {{26, 0x0000}, {"Stealth Elf", Game::SpyrosAdv, Element::Life}}, + {{26, 0x1801}, {"Series 2 Stealth Elf", Game::Giants, Element::Life}}, + {{26, 0x2C02}, {"Dark Stealth Elf", Game::SwapForce, Element::Life}}, + {{26, 0x1C03}, {"Legendary Stealth Elf", Game::Giants, Element::Life}}, + {{26, 0x2805}, {"Ninja Stealth Elf", Game::SwapForce, Element::Life}}, + {{26, 0x3810}, {"Eon's Elite Stealth Elf", Game::TrapTeam, Element::Life}}, + {{27, 0x0000}, {"Stump Smash", Game::SpyrosAdv, Element::Life}}, + {{27, 0x1801}, {"Series 2 Stump Smash", Game::Giants, Element::Life}}, + {{28, 0x0000}, {"Dark Spyro", Game::SpyrosAdv, Element::Magic}}, + {{29, 0x0000}, {"Hex", Game::SpyrosAdv, Element::Undead}}, + {{29, 0x1801}, {"Series 2 Hex", Game::Giants, Element::Undead}}, + {{29, 0x1206}, {"LightCore Hex", Game::Giants, Element::Undead}}, + {{30, 0x0000}, {"Chop Chop", Game::SpyrosAdv, Element::Undead}}, + {{30, 0x1801}, {"Series 2 Chop Chop", Game::Giants, Element::Undead}}, + {{30, 0x2805}, {"Twin Blade Chop Chop", Game::SwapForce, Element::Undead}}, + {{30, 0x3810}, {"Eon's Elite Chop Chop"}}, + {{31, 0x0000}, {"Ghost Roaster", Game::SpyrosAdv, Element::Undead}}, + {{31, 0x4810}, {"Eon's Elite Ghost Roaster"}}, + {{32, 0x0000}, {"Cynder", Game::SpyrosAdv, Element::Undead}}, + {{32, 0x1801}, {"Series 2 Cynder", Game::Giants, Element::Undead}}, + {{32, 0x2805}, {"Phantom Cynder", Game::SwapForce, Element::Undead}}, + {{100, 0x0000}, {"Jet Vac", Game::Giants, Element::Air}}, + {{100, 0x1403}, {"Legendary Jet Vac", Game::Giants, Element::Air}}, + {{100, 0x2805}, {"Turbo Jet Vac", Game::SwapForce, Element::Air}}, + {{100, 0x3805}, {"Full Blast Jet Vac", Game::TrapTeam, Element::Air}}, + {{100, 0x1206}, {"LightCore Jet Vac", Game::Giants, Element::Air}}, + {{101, 0x0000}, {"Swarm", Game::Giants, Element::Air}}, + {{102, 0x0000}, {"Crusher", Game::Giants, Element::Earth}}, + {{102, 0x1602}, {"Granite Crusher", Game::Giants, Element::Earth}}, + {{103, 0x0000}, {"Flashwing", Game::Giants, Element::Earth}}, + {{103, 0x1402}, {"Jade Flash Wing", Game::Giants, Element::Earth}}, + {{103, 0x2206}, {"LightCore Flashwing", Game::SwapForce, Element::Earth}}, + {{104, 0x0000}, {"Hot Head", Game::Giants, Element::Fire}}, + {{105, 0x0000}, {"Hot Dog", Game::Giants, Element::Fire}}, + {{105, 0x1402}, {"Molten Hot Dog", Game::Giants, Element::Fire}}, + {{105, 0x2805}, {"Fire Bone Hot Dog", Game::SwapForce, Element::Fire}}, + {{106, 0x0000}, {"Chill", Game::Giants, Element::Water}}, + {{106, 0x1603}, {"Legendary Chill", Game::Giants, Element::Water}}, + {{106, 0x2805}, {"Blizzard Chill", Game::SwapForce, Element::Water}}, + {{106, 0x1206}, {"LightCore Chill", Game::Giants, Element::Water}}, + {{107, 0x0000}, {"Thumpback", Game::Giants, Element::Water}}, + {{108, 0x0000}, {"Pop Fizz", Game::Giants, Element::Magic}}, + {{108, 0x1402}, {"Punch Pop Fizz", Game::Giants, Element::Magic}}, + {{108, 0x3C02}, {"Love Potion Pop Fizz", Game::TrapTeam, Element::Magic}}, + {{108, 0x2805}, {"Super Gulp Pop Fizz", Game::SwapForce, Element::Magic}}, + {{108, 0x3805}, {"Fizzy Frenzy Pop Fizz", Game::TrapTeam, Element::Magic}}, + {{108, 0x1206}, {"LightCore Pop Fizz", Game::Giants, Element::Magic}}, + {{109, 0x0000}, {"Ninjini", Game::Giants, Element::Magic}}, + {{109, 0x1602}, {"Scarlet Ninjini", Game::Giants, Element::Magic}}, + {{110, 0x0000}, {"Bouncer", Game::Giants, Element::Tech}}, + {{110, 0x1603}, {"Legendary Bouncer", Game::Giants, Element::Tech}}, + {{111, 0x0000}, {"Sprocket", Game::Giants, Element::Tech}}, + {{111, 0x2805}, {"Heavy Duty Sprocket", Game::SwapForce, Element::Tech}}, + {{112, 0x0000}, {"Tree Rex", Game::Giants, Element::Life}}, + {{112, 0x1602}, {"Gnarly Tree Rex", Game::Giants, Element::Life}}, + {{113, 0x0000}, {"Shroomboom", Game::Giants, Element::Life}}, + {{113, 0x3805}, {"Sure Shot Shroomboom", Game::TrapTeam, Element::Life}}, + {{113, 0x1206}, {"LightCore Shroomboom", Game::Giants, Element::Life}}, + {{114, 0x0000}, {"Eye Brawl", Game::Giants, Element::Undead}}, + {{115, 0x0000}, {"Fright Rider", Game::Giants, Element::Undead}}, + {{200, 0x0000}, {"Anvil Rain", Game::SpyrosAdv}}, + {{201, 0x0000}, {"Hidden Treasure", Game::SpyrosAdv}}, + {{201, 0x2000}, {"Platinum Hidden Treasure", Game::Giants}}, + {{202, 0x0000}, {"Healing Elixir", Game::SpyrosAdv}}, + {{203, 0x0000}, {"Ghost Pirate Swords", Game::SpyrosAdv}}, + {{204, 0x0000}, {"Time Twist Hourglass", Game::SpyrosAdv}}, + {{205, 0x0000}, {"Sky Iron Shield", Game::SpyrosAdv}}, + {{206, 0x0000}, {"Winged Boots", Game::SpyrosAdv}}, + {{207, 0x0000}, {"Sparx the Dragonfly", Game::SpyrosAdv}}, + {{208, 0x0000}, {"Dragonfire Cannon", Game::SpyrosAdv}}, + {{208, 0x1602}, {"Golden Dragonfire Cannon", Game::SpyrosAdv}}, + {{209, 0x0000}, {"Scorpion Striker", Game::Giants}}, + {{210, 0x3002}, {"Biter's Bane", Game::TrapTeam}}, + {{210, 0x3008}, {"Sorcerous Skull", Game::TrapTeam}}, + {{210, 0x300B}, {"Axe of Illusion", Game::TrapTeam}}, + {{210, 0x300E}, {"Arcane Hourglass", Game::TrapTeam}}, + {{210, 0x3012}, {"Spell Slapper", Game::TrapTeam}}, + {{210, 0x3014}, {"Rune Rocket", Game::TrapTeam}}, + {{211, 0x3001}, {"Tidal Tiki", Game::TrapTeam}}, + {{211, 0x3002}, {"Wet Walter", Game::TrapTeam}}, + {{211, 0x3006}, {"Flood Flask", Game::TrapTeam}}, + {{211, 0x3406}, {"Legendary Flood Flask", Game::TrapTeam}}, + {{211, 0x3007}, {"Soaking Staff", Game::TrapTeam}}, + {{211, 0x300B}, {"Aqua Axe", Game::TrapTeam}}, + {{211, 0x3016}, {"Frost Helm", Game::TrapTeam}}, + {{212, 0x3003}, {"Breezy Bird", Game::TrapTeam}}, + {{212, 0x3006}, {"Drafty Decanter", Game::TrapTeam}}, + {{212, 0x300D}, {"Tempest Timer", Game::TrapTeam}}, + {{212, 0x3010}, {"Cloudy Cobra", Game::TrapTeam}}, + {{212, 0x3011}, {"Storm Warning", Game::TrapTeam}}, + {{212, 0x3018}, {"Cyclone Saber", Game::TrapTeam}}, + {{213, 0x3004}, {"Spirit Sphere", Game::TrapTeam}}, + {{213, 0x3404}, {"Legendary Spirit Sphere", Game::TrapTeam}}, + {{213, 0x3008}, {"Spectral Skull", Game::TrapTeam}}, + {{213, 0x3408}, {"Legendary Spectral Skull", Game::TrapTeam}}, + {{213, 0x300B}, {"Haunted Hatchet", Game::TrapTeam}}, + {{213, 0x300C}, {"Grim Gripper", Game::TrapTeam}}, + {{213, 0x3010}, {"Spooky Snake", Game::TrapTeam}}, + {{213, 0x3017}, {"Dream Piercer", Game::TrapTeam}}, + {{214, 0x3000}, {"Tech Totem", Game::TrapTeam}}, + {{214, 0x3007}, {"Automatic Angel", Game::TrapTeam}}, + {{214, 0x3009}, {"Factory Flower", Game::TrapTeam}}, + {{214, 0x300C}, {"Grabbing Gadget", Game::TrapTeam}}, + {{214, 0x3016}, {"Makers Mana", Game::TrapTeam}}, + {{214, 0x301A}, {"Topsy Techy", Game::TrapTeam}}, + {{215, 0x3005}, {"Eternal Flame", Game::TrapTeam}}, + {{215, 0x3009}, {"Fire Flower", Game::TrapTeam}}, + {{215, 0x3011}, {"Scorching Stopper", Game::TrapTeam}}, + {{215, 0x3012}, {"Searing Spinner", Game::TrapTeam}}, + {{215, 0x3017}, {"Spark Spear", Game::TrapTeam}}, + {{215, 0x301B}, {"Blazing Belch", Game::TrapTeam}}, + {{216, 0x3000}, {"Banded Boulder", Game::TrapTeam}}, + {{216, 0x3003}, {"Rock Hawk", Game::TrapTeam}}, + {{216, 0x300A}, {"Slag Hammer", Game::TrapTeam}}, + {{216, 0x300E}, {"Dust Of Time", Game::TrapTeam}}, + {{216, 0x3013}, {"Spinning Sandstorm", Game::TrapTeam}}, + {{216, 0x301A}, {"Rubble Trouble", Game::TrapTeam}}, + {{217, 0x3003}, {"Oak Eagle", Game::TrapTeam}}, + {{217, 0x3005}, {"Emerald Energy", Game::TrapTeam}}, + {{217, 0x300A}, {"Weed Whacker", Game::TrapTeam}}, + {{217, 0x3010}, {"Seed Serpent", Game::TrapTeam}}, + {{217, 0x3018}, {"Jade Blade", Game::TrapTeam}}, + {{217, 0x301B}, {"Shrub Shrieker", Game::TrapTeam}}, + {{218, 0x3000}, {"Dark Dagger", Game::TrapTeam}}, + {{218, 0x3014}, {"Shadow Spider", Game::TrapTeam}}, + {{218, 0x301A}, {"Ghastly Grimace", Game::TrapTeam}}, + {{219, 0x3000}, {"Shining Ship", Game::TrapTeam}}, + {{219, 0x300F}, {"Heavenly Hawk", Game::TrapTeam}}, + {{219, 0x301B}, {"Beam Scream", Game::TrapTeam}}, + {{220, 0x301E}, {"Kaos Trap", Game::TrapTeam}}, + {{220, 0x351F}, {"Ultimate Kaos Trap", Game::TrapTeam}}, + {{230, 0x0000}, {"Hand of Fate", Game::TrapTeam}}, + {{230, 0x3403}, {"Legendary Hand of Fate", Game::TrapTeam}}, + {{231, 0x0000}, {"Piggy Bank", Game::TrapTeam}}, + {{232, 0x0000}, {"Rocket Ram", Game::TrapTeam}}, + {{233, 0x0000}, {"Tiki Speaky", Game::TrapTeam}}, + {{300, 0x0000}, {"Dragon’s Peak", Game::TrapTeam}}, + {{301, 0x0000}, {"Empire of Ice", Game::TrapTeam}}, + {{302, 0x0000}, {"Pirate Seas", Game::TrapTeam}}, + {{303, 0x0000}, {"Darklight Crypt", Game::TrapTeam}}, + {{304, 0x0000}, {"Volcanic Vault", Game::TrapTeam}}, + {{305, 0x0000}, {"Mirror of Mystery", Game::TrapTeam}}, + {{306, 0x0000}, {"Nightmare Express", Game::TrapTeam}}, + {{307, 0x0000}, {"Sunscraper Spire", Game::TrapTeam}}, + {{308, 0x0000}, {"Midnight Museum", Game::TrapTeam}}, + {{404, 0x0000}, {"Legendary Bash", Game::SpyrosAdv, Element::Earth}}, + {{416, 0x0000}, {"Legendary Spyro", Game::SpyrosAdv, Element::Magic}}, + {{419, 0x0000}, {"Legendary Trigger Happy", Game::SpyrosAdv, Element::Tech}}, + {{430, 0x0000}, {"Legendary Chop Chop", Game::SpyrosAdv, Element::Undead}}, + {{450, 0x0000}, {"Gusto", Game::TrapTeam, Element::Air}}, + {{451, 0x0000}, {"Thunderbolt", Game::TrapTeam, Element::Air}}, + {{452, 0x0000}, {"Fling Kong", Game::TrapTeam, Element::Air}}, + {{453, 0x0000}, {"Blades", Game::TrapTeam, Element::Air}}, + {{453, 0x3403}, {"Legendary Blades", Game::TrapTeam, Element::Air}}, + {{454, 0x0000}, {"Wallop", Game::TrapTeam, Element::Earth}}, + {{455, 0x0000}, {"Head Rush", Game::TrapTeam, Element::Earth}}, + {{455, 0x3402}, {"Nitro Head Rush", Game::TrapTeam, Element::Earth}}, + {{456, 0x0000}, {"Fist Bump", Game::TrapTeam, Element::Earth}}, + {{457, 0x0000}, {"Rocky Roll", Game::TrapTeam, Element::Earth}}, + {{458, 0x0000}, {"Wildfire", Game::TrapTeam, Element::Fire}}, + {{458, 0x3402}, {"Dark Wildfire", Game::TrapTeam, Element::Fire}}, + {{459, 0x0000}, {"Ka Boom", Game::TrapTeam, Element::Fire}}, + {{460, 0x0000}, {"Trail Blazer", Game::TrapTeam, Element::Fire}}, + {{461, 0x0000}, {"Torch", Game::TrapTeam, Element::Fire}}, + {{462, 0x0000}, {"Snap Shot", Game::TrapTeam, Element::Water}}, + {{462, 0x3402}, {"Dark Snap Shot", Game::TrapTeam, Element::Water}}, + {{463, 0x0000}, {"Lob Star", Game::TrapTeam, Element::Water}}, + {{463, 0x3402}, {"Winterfest Lob-Star", Game::TrapTeam, Element::Water}}, + {{464, 0x0000}, {"Flip Wreck", Game::TrapTeam, Element::Water}}, + {{465, 0x0000}, {"Echo", Game::TrapTeam, Element::Water}}, + {{466, 0x0000}, {"Blastermind", Game::TrapTeam, Element::Magic}}, + {{467, 0x0000}, {"Enigma", Game::TrapTeam, Element::Magic}}, + {{468, 0x0000}, {"Deja Vu", Game::TrapTeam, Element::Magic}}, + {{468, 0x3403}, {"Legendary Deja Vu", Game::TrapTeam, Element::Magic}}, + {{469, 0x0000}, {"Cobra Cadabra", Game::TrapTeam, Element::Magic}}, + {{469, 0x3402}, {"King Cobra Cadabra", Game::TrapTeam, Element::Magic}}, + {{470, 0x0000}, {"Jawbreaker", Game::TrapTeam, Element::Tech}}, + {{470, 0x3403}, {"Legendary Jawbreaker", Game::TrapTeam, Element::Tech}}, + {{471, 0x0000}, {"Gearshift", Game::TrapTeam, Element::Tech}}, + {{472, 0x0000}, {"Chopper", Game::TrapTeam, Element::Tech}}, + {{473, 0x0000}, {"Tread Head", Game::TrapTeam, Element::Tech}}, + {{474, 0x0000}, {"Bushwack", Game::TrapTeam, Element::Life}}, + {{474, 0x3403}, {"Legendary Bushwack", Game::TrapTeam, Element::Life}}, + {{475, 0x0000}, {"Tuff Luck", Game::TrapTeam, Element::Life}}, + {{476, 0x0000}, {"Food Fight", Game::TrapTeam, Element::Life}}, + {{476, 0x3402}, {"Dark Food Fight", Game::TrapTeam, Element::Life}}, + {{477, 0x0000}, {"High Five", Game::TrapTeam, Element::Life}}, + {{478, 0x0000}, {"Krypt King", Game::TrapTeam, Element::Undead}}, + {{478, 0x3402}, {"Nitro Krypt King", Game::TrapTeam, Element::Undead}}, + {{479, 0x0000}, {"Short Cut", Game::TrapTeam, Element::Undead}}, + {{480, 0x0000}, {"Bat Spin", Game::TrapTeam, Element::Undead}}, + {{481, 0x0000}, {"Funny Bone", Game::TrapTeam, Element::Undead}}, + {{482, 0x0000}, {"Knight Light", Game::TrapTeam, Element::Other}}, + {{483, 0x0000}, {"Spotlight", Game::TrapTeam, Element::Other}}, + {{484, 0x0000}, {"Knight Mare", Game::TrapTeam, Element::Other}}, + {{485, 0x0000}, {"Blackout", Game::TrapTeam, Element::Other}}, + {{502, 0x0000}, {"Bop", Game::TrapTeam, Element::Earth}}, + {{505, 0x0000}, {"Terrabite", Game::SpyrosAdv, Element::Earth}}, + {{506, 0x0000}, {"Breeze", Game::TrapTeam, Element::Air}}, + {{508, 0x0000}, {"Pet Vac", Game::TrapTeam, Element::Air}}, + {{508, 0x3402}, {"Power Punch Pet Vac", Game::TrapTeam, Element::Air}}, + {{507, 0x0000}, {"Weeruptor", Game::TrapTeam, Element::Fire}}, + {{507, 0x3402}, {"Eggcellent Weeruptor", Game::TrapTeam, Element::Fire}}, + {{509, 0x0000}, {"Small Fry", Game::TrapTeam, Element::Fire}}, + {{510, 0x0000}, {"Drobit", Game::TrapTeam, Element::Fire}}, + {{519, 0x0000}, {"Trigger Snappy", Game::SpyrosAdv, Element::Tech}}, + {{526, 0x0000}, {"Whisper Elf", Game::SpyrosAdv, Element::Life}}, + {{540, 0x0000}, {"Barkley", Game::Giants, Element::Life}}, + {{540, 0x3402}, {"Gnarly Barkley", Game::Giants, Element::Life}}, + {{541, 0x0000}, {"Thumpling", Game::Giants, Element::Water}}, + {{514, 0x0000}, {"Gill Runt", Game::SpyrosAdv, Element::Water}}, + {{542, 0x0000}, {"Mini-Jini", Game::Giants, Element::Magic}}, + {{503, 0x0000}, {"Spry", Game::TrapTeam, Element::Magic}}, + {{504, 0x0000}, {"Hijinx", Game::TrapTeam, Element::Magic}}, + {{543, 0x0000}, {"Eye Small", Game::Giants, Element::Undead}}, + {{1000, 0x0000}, {"Boom Jet (Bottom)", Game::SwapForce, Element::Air}}, + {{1001, 0x0000}, {"Free Ranger (Bottom)", Game::SwapForce, Element::Air}}, + {{1001, 0x2403}, {"Legendary Free Ranger (Bottom)", Game::SwapForce, Element::Air}}, + {{1002, 0x0000}, {"Rubble Rouser (Bottom)", Game::SwapForce, Element::Earth}}, + {{1003, 0x0000}, {"Doom Stone (Bottom)", Game::SwapForce, Element::Earth}}, + {{1004, 0x0000}, {"Blast Zone (Bottom)", Game::SwapForce, Element::Fire}}, + {{1004, 0x2402}, {"Dark Blast Zone (Bottom)", Game::SwapForce, Element::Fire}}, + {{1005, 0x0000}, {"Fire Kraken (Bottom)", Game::SwapForce, Element::Fire}}, + {{1005, 0x2402}, {"Jade Fire Kraken (Bottom)", Game::SwapForce, Element::Fire}}, + {{1006, 0x0000}, {"Stink Bomb (Bottom)", Game::SwapForce, Element::Life}}, + {{1007, 0x0000}, {"Grilla Drilla (Bottom)", Game::SwapForce, Element::Earth}}, + {{1008, 0x0000}, {"Hoot Loop (Bottom)", Game::SwapForce, Element::Magic}}, + {{1008, 0x2402}, {"Enchanted Hoot Loop (Bottom)", Game::SwapForce, Element::Magic}}, + {{1009, 0x0000}, {"Trap Shadow (Bottom)", Game::SwapForce, Element::Magic}}, + {{1010, 0x0000}, {"Magna Charge (Bottom)", Game::SwapForce, Element::Tech}}, + {{1010, 0x2402}, {"Nitro Magna Charge (Bottom)", Game::SwapForce, Element::Tech}}, + {{1011, 0x0000}, {"Spy Rise (Bottom)", Game::SwapForce, Element::Tech}}, + {{1012, 0x0000}, {"Night Shift (Bottom)", Game::SwapForce, Element::Undead}}, + {{1012, 0x2403}, {"Legendary Night Shift (Bottom)", Game::SwapForce, Element::Undead}}, + {{1013, 0x0000}, {"Rattle Shake (Bottom)", Game::SwapForce, Element::Undead}}, + {{1013, 0x2402}, {"Quick Draw Rattle Shake (Bottom)", Game::SwapForce, Element::Undead}}, + {{1014, 0x0000}, {"Freeze Blade (Bottom)", Game::SwapForce, Element::Water}}, + {{1014, 0x2402}, {"Nitro Freeze Blade (Bottom)", Game::SwapForce, Element::Water}}, + {{1015, 0x0000}, {"Wash Buckler (Bottom)", Game::SwapForce, Element::Water}}, + {{1015, 0x2402}, {"Dark Wash Buckler (Bottom)", Game::SwapForce, Element::Water}}, + {{2000, 0x0000}, {"Boom Jet (Top)", Game::SwapForce, Element::Air}}, + {{2001, 0x0000}, {"Free Ranger (Top)", Game::SwapForce, Element::Air}}, + {{2001, 0x2403}, {"Legendary Free Ranger (Top)", Game::SwapForce, Element::Air}}, + {{2002, 0x0000}, {"Rubble Rouser (Top)", Game::SwapForce, Element::Air}}, + {{2003, 0x0000}, {"Doom Stone (Top)", Game::SwapForce, Element::Air}}, + {{2004, 0x0000}, {"Blast Zone (Top)", Game::SwapForce, Element::Fire}}, + {{2004, 0x2402}, {"Dark Blast Zone (Top)", Game::SwapForce, Element::Fire}}, + {{2005, 0x0000}, {"Fire Kraken (Top)", Game::SwapForce, Element::Fire}}, + {{2005, 0x2402}, {"Jade Fire Kraken (Top)", Game::SwapForce, Element::Fire}}, + {{2006, 0x0000}, {"Stink Bomb (Top)", Game::SwapForce, Element::Life}}, + {{2007, 0x0000}, {"Grilla Drilla (Top)", Game::SwapForce, Element::Life}}, + {{2008, 0x0000}, {"Hoot Loop (Top)", Game::SwapForce, Element::Magic}}, + {{2008, 0x2402}, {"Enchanted Hoot Loop (Top)", Game::SwapForce, Element::Magic}}, + {{2009, 0x0000}, {"Trap Shadow (Top)", Game::SwapForce, Element::Magic}}, + {{2010, 0x0000}, {"Magna Charge (Top)", Game::SwapForce, Element::Tech}}, + {{2010, 0x2402}, {"Nitro Magna Charge (Top)", Game::SwapForce, Element::Tech}}, + {{2011, 0x0000}, {"Spy Rise (Top)", Game::SwapForce, Element::Tech}}, + {{2012, 0x0000}, {"Night Shift (Top)", Game::SwapForce, Element::Undead}}, + {{2012, 0x2403}, {"Legendary Night Shift (Top)", Game::SwapForce, Element::Undead}}, + {{2013, 0x0000}, {"Rattle Shake (Top)", Game::SwapForce, Element::Undead}}, + {{2013, 0x2402}, {"Quick Draw Rattle Shake (Top)", Game::SwapForce, Element::Undead}}, + {{2014, 0x0000}, {"Freeze Blade (Top)", Game::SwapForce, Element::Water}}, + {{2014, 0x2402}, {"Nitro Freeze Blade (Top)", Game::SwapForce, Element::Water}}, + {{2015, 0x0000}, {"Wash Buckler (Top)", Game::SwapForce, Element::Water}}, + {{2015, 0x2402}, {"Dark Wash Buckler (Top)", Game::SwapForce, Element::Water}}, + {{3000, 0x0000}, {"Scratch", Game::SwapForce, Element::Air}}, + {{3001, 0x0000}, {"Pop Thorn", Game::SwapForce, Element::Magic}}, + {{3002, 0x0000}, {"Slobber Tooth", Game::SwapForce, Element::Earth}}, + {{3002, 0x2402}, {"Dark Slobber Tooth", Game::SwapForce, Element::Earth}}, + {{3003, 0x0000}, {"Scorp", Game::SwapForce, Element::Earth}}, + {{3004, 0x0000}, {"Fryno", Game::SwapForce, Element::Fire}}, + {{3004, 0x3805}, {"Hog Wild Fryno", Game::SwapForce, Element::Fire}}, + {{3005, 0x0000}, {"Smolderdash", Game::SwapForce, Element::Fire}}, + {{3005, 0x2206}, {"LightCore Smolderdash", Game::SwapForce, Element::Fire}}, + {{3006, 0x0000}, {"Bumble Blast", Game::SwapForce, Element::Life}}, + {{3006, 0x2402}, {"Jolly Bumble Blast", Game::SwapForce, Element::Life}}, + {{3006, 0x2206}, {"LightCore Bumble Blast", Game::SwapForce, Element::Life}}, + {{3007, 0x0000}, {"Zoo Lou", Game::SwapForce, Element::Life}}, + {{3007, 0x2403}, {"Legendary Zoo Lou", Game::SwapForce, Element::Life}}, + {{3008, 0x0000}, {"Dune Bug", Game::SwapForce, Element::Magic}}, + {{3009, 0x0000}, {"Star Strike", Game::SwapForce, Element::Magic}}, + {{3009, 0x2602}, {"Enchanted Star Strike", Game::SwapForce, Element::Magic}}, + {{3009, 0x2206}, {"LightCore Star Strike", Game::SwapForce, Element::Magic}}, + {{3010, 0x0000}, {"Countdown", Game::SwapForce, Element::Tech}}, + {{3010, 0x2402}, {"Kickoff Countdown", Game::SwapForce, Element::Tech}}, + {{3010, 0x2206}, {"LightCore Countdown", Game::SwapForce, Element::Tech}}, + {{3011, 0x0000}, {"Wind Up", Game::SwapForce, Element::Tech}}, + {{3011, 0x2404}, {"Gear Head VVind Up", Game::SwapForce, Element::Tech}}, + {{3012, 0x0000}, {"Roller Brawl", Game::SwapForce, Element::Undead}}, + {{3013, 0x0000}, {"Grim Creeper", Game::SwapForce, Element::Undead}}, + {{3013, 0x2603}, {"Legendary Grim Creeper", Game::SwapForce, Element::Undead}}, + {{3013, 0x2206}, {"LightCore Grim Creeper", Game::SwapForce, Element::Undead}}, + {{3014, 0x0000}, {"Rip Tide", Game::SwapForce, Element::Water}}, + {{3015, 0x0000}, {"Punk Shock", Game::SwapForce, Element::Water}}, + {{3200, 0x0000}, {"Battle Hammer", Game::SwapForce, Element::Other}}, + {{3201, 0x0000}, {"Sky Diamond", Game::SwapForce, Element::Other}}, + {{3202, 0x0000}, {"Platinum Sheep", Game::SwapForce, Element::Other}}, + {{3203, 0x0000}, {"Groove Machine", Game::SwapForce, Element::Other}}, + {{3204, 0x0000}, {"UFO Hat", Game::SwapForce, Element::Other}}, + {{3300, 0x0000}, {"Sheep Wreck Island", Game::SwapForce, Element::Other}}, + {{3301, 0x0000}, {"Tower of Time", Game::SwapForce, Element::Other}}, + {{3302, 0x0000}, {"Fiery Forge", Game::SwapForce, Element::Other}}, + {{3303, 0x0000}, {"Arkeyan Crossbow", Game::SwapForce, Element::Other}}, + {{3220, 0x0000}, {"Jet Stream", Game::Superchargers, Element::Other}}, + {{3221, 0x0000}, {"Tomb Buggy", Game::Superchargers, Element::Other}}, + {{3222, 0x0000}, {"Reef Ripper", Game::Superchargers, Element::Other}}, + {{3223, 0x0000}, {"Burn Cycle", Game::Superchargers, Element::Other}}, + {{3224, 0x0000}, {"Hot Streak", Game::Superchargers, Element::Other}}, + {{3224, 0x4402}, {"Dark Hot Streak", Game::Superchargers, Element::Other}}, + {{3224, 0x4004}, {"E3 Hot Streak", Game::Superchargers, Element::Other}}, + {{3224, 0x441E}, {"Golden Hot Streak", Game::Superchargers, Element::Other}}, + {{3225, 0x0000}, {"Shark Tank", Game::Superchargers, Element::Other}}, + {{3226, 0x0000}, {"Thump Truck", Game::Superchargers, Element::Other}}, + {{3227, 0x0000}, {"Crypt Crusher", Game::Superchargers, Element::Other}}, + {{3228, 0x0000}, {"Stealth Stinger", Game::Superchargers, Element::Other}}, + {{3228, 0x4402}, {"Nitro Stealth Stinger", Game::Superchargers, Element::Other}}, + {{3231, 0x0000}, {"Dive Bomber", Game::Superchargers, Element::Other}}, + {{3231, 0x4402}, {"Spring Ahead Dive Bomber", Game::Superchargers, Element::Other}}, + {{3232, 0x0000}, {"Sky Slicer", Game::Superchargers, Element::Other}}, + {{3233, 0x0000}, {"Clown Cruiser (Nintendo Only)", Game::Superchargers, Element::Other}}, + {{3233, 0x4402}, {"Dark Clown Cruiser (Nintendo Only)", Game::Superchargers, Element::Other}}, + {{3234, 0x0000}, {"Gold Rusher", Game::Superchargers, Element::Other}}, + {{3234, 0x4402}, {"Power Blue Gold Rusher", Game::Superchargers, Element::Other}}, + {{3235, 0x0000}, {"Shield Striker", Game::Superchargers, Element::Other}}, + {{3236, 0x0000}, {"Sun Runner", Game::Superchargers, Element::Other}}, + {{3236, 0x4403}, {"Legendary Sun Runner", Game::Superchargers, Element::Other}}, + {{3237, 0x0000}, {"Sea Shadow", Game::Superchargers, Element::Other}}, + {{3237, 0x4402}, {"Dark Sea Shadow", Game::Superchargers, Element::Other}}, + {{3238, 0x0000}, {"Splatter Splasher", Game::Superchargers, Element::Other}}, + {{3238, 0x4402}, {"Power Blue Splatter Splasher", Game::Superchargers, Element::Other}}, + {{3239, 0x0000}, {"Soda Skimmer", Game::Superchargers, Element::Other}}, + {{3240, 0x0000}, {"Barrel Blaster (Nintendo Only)", Game::Superchargers, Element::Other}}, + {{3240, 0x4402}, {"Dark Barrel Blaster (Nintendo Only)", Game::Superchargers, Element::Other}}, + {{3239, 0x4402}, {"Nitro Soda Skimmer", Game::Superchargers, Element::Other}}, + {{3241, 0x0000}, {"Buzz Wing", Game::Superchargers, Element::Other}}, + {{3400, 0x0000}, {"Fiesta", Game::Superchargers, Element::Undead}}, + {{3400, 0x4515}, {"Frightful Fiesta", Game::Superchargers, Element::Undead}}, + {{3401, 0x0000}, {"High Volt", Game::Superchargers, Element::Tech}}, + {{3402, 0x0000}, {"Splat", Game::Superchargers, Element::Magic}}, + {{3402, 0x4502}, {"Power Blue Splat", Game::Superchargers, Element::Other}}, + {{3406, 0x0000}, {"Stormblade", Game::Superchargers, Element::Air}}, + {{3411, 0x0000}, {"Smash Hit", Game::Superchargers, Element::Earth}}, + {{3411, 0x4502}, {"Steel Plated Smash Hit", Game::Superchargers, Element::Earth}}, + {{3412, 0x0000}, {"Spitfire", Game::Superchargers, Element::Fire}}, + {{3412, 0x4502}, {"Dark Spitfire", Game::Superchargers, Element::Fire}}, + {{3413, 0x0000}, {"Hurricane Jet Vac", Game::Superchargers, Element::Air}}, + {{3413, 0x4503}, {"Legendary Hurricane Jet Vac", Game::Superchargers, Element::Air}}, + {{3414, 0x0000}, {"Double Dare Trigger Happy", Game::Superchargers, Element::Tech}}, + {{3414, 0x4502}, {"Power Blue Double Dare Trigger Happy", Game::Superchargers, Element::Tech}}, + {{3415, 0x0000}, {"Super Shot Stealth Elf", Game::Superchargers, Element::Life}}, + {{3415, 0x4502}, {"Dark Super Shot Stealth Elf", Game::Superchargers, Element::Life}}, + {{3416, 0x0000}, {"Shark Shooter Terrafin", Game::Superchargers, Element::Earth}}, + {{3417, 0x0000}, {"Bone Bash Roller Brawl", Game::Superchargers, Element::Earth}}, + {{3417, 0x4503}, {"Legendary Bone Bash Roller Brawl", Game::Superchargers, Element::Earth}}, + {{3420, 0x0000}, {"Big Bubble Pop Fizz", Game::Superchargers, Element::Magic}}, + {{3420, 0x450E}, {"Birthday Bash Big Bubble Pop Fizz", Game::Superchargers, Element::Magic}}, + {{3421, 0x0000}, {"Lava Lance Eruptor", Game::Superchargers, Element::Fire}}, + {{3422, 0x0000}, {"Deep Dive Gill Grunt", Game::Superchargers, Element::Water}}, + {{3423, 0x0000}, + {"Turbo Charge Donkey Kong (Nintendo Only)", Game::Superchargers, Element::Life}}, + {{3423, 0x4502}, + {"Dark Turbo Charge Donkey Kong (Nintendo Only)", Game::Superchargers, Element::Life}}, + {{3424, 0x0000}, {"Hammer Slam Bowser (Nintendo Only)", Game::Superchargers, Element::Fire}}, + {{3424, 0x4502}, + {"Dark Hammer Slam Bowser (Nintendo Only)", Game::Superchargers, Element::Fire}}, + {{3425, 0x0000}, {"Dive-Clops", Game::Superchargers, Element::Water}}, + {{3425, 0x450E}, {"Missile-Tow Dive-Clops", Game::Superchargers, Element::Water}}, + {{3426, 0x0000}, {"Astroblast", Game::Superchargers, Element::Other}}, + {{3426, 0x4503}, {"Legendary Astroblast", Game::Superchargers, Element::Other}}, + {{3427, 0x0000}, {"Nightfall", Game::Superchargers, Element::Other}}, + {{3428, 0x0000}, {"Thrillipede", Game::Superchargers, Element::Life}}, + {{3428, 0x450D}, {"Eggcited Thrillipede", Game::Superchargers, Element::Life}}, + {{3500, 0x0000}, {"Sky Trophy", Game::Superchargers, Element::Other}}, + {{3501, 0x0000}, {"Land Trophy", Game::Superchargers, Element::Other}}, + {{3502, 0x0000}, {"Sea Trophy", Game::Superchargers, Element::Other}}, + {{3503, 0x0000}, {"Kaos Trophy", Game::Superchargers, Element::Other}}}; SkylanderUSB::SkylanderUSB(EmulationKernel& ios, const std::string& device_name) : m_ios(ios) { @@ -1190,7 +1192,7 @@ static u16 SkylanderCRC16(u16 init_value, const u8* buffer, u32 size) return crc; } -bool SkylanderPortal::CreateSkylander(const std::string& file_path, u16 sky_id, u16 sky_var) +bool SkylanderPortal::CreateSkylander(const std::string& file_path, u16 m_sky_id, u16 m_sky_var) { File::IOFile sky_file(file_path, "w+b"); if (!sky_file) @@ -1223,8 +1225,8 @@ bool SkylanderPortal::CreateSkylander(const std::string& file_path, u16 sky_id, file_data[7] = 0x0F; // Set the skylander info - memcpy(&file_data[0x10], &sky_id, sizeof(sky_id)); - memcpy(&file_data[0x1C], &sky_var, sizeof(sky_var)); + memcpy(&file_data[0x10], &m_sky_id, sizeof(m_sky_id)); + memcpy(&file_data[0x1C], &m_sky_var, sizeof(m_sky_var)); // Set checksum u16 checksum = SkylanderCRC16(0xFFFF, file_data, 0x1E); @@ -1320,13 +1322,13 @@ bool SkylanderPortal::IsBlockNumberValid(u8 block) std::pair SkylanderPortal::CalculateIDs(const std::array& file_data) { - u16 sky_id = file_data[0x11]; - u16 sky_var = file_data[0x1D]; - sky_id <<= 8; - sky_var <<= 8; - sky_id |= file_data[0x10]; - sky_var |= file_data[0x1C]; - return std::make_pair(sky_id, sky_var); + u16 m_sky_id = file_data[0x11]; + u16 m_sky_var = file_data[0x1D]; + m_sky_id <<= 8; + m_sky_var <<= 8; + m_sky_id |= file_data[0x10]; + m_sky_var |= file_data[0x1C]; + return std::make_pair(m_sky_id, m_sky_var); } } // namespace IOS::HLE::USB diff --git a/Source/Core/Core/IOS/USB/Emulated/Skylander.h b/Source/Core/Core/IOS/USB/Emulated/Skylander.h index f46f7c2625..a66116cc32 100644 --- a/Source/Core/Core/IOS/USB/Emulated/Skylander.h +++ b/Source/Core/Core/IOS/USB/Emulated/Skylander.h @@ -19,7 +19,36 @@ constexpr u8 MAX_SKYLANDERS = 16; namespace IOS::HLE::USB { -extern const std::map, const char*> list_skylanders; +enum class Game +{ + SpyrosAdv, + Giants, + SwapForce, + TrapTeam, + Superchargers, + Other, +}; +enum class Element +{ + Magic, + Fire, + Air, + Life, + Undead, + Earth, + Water, + Tech, + Other +}; + +struct SkyData +{ + const char* name = ""; + Game game = Game::Other; + Element element = Element::Other; +}; + +extern const std::map, SkyData> list_skylanders; class SkylanderUSB final : public Device { public: @@ -93,7 +122,7 @@ public: void QueryBlock(u8 sky_num, u8 block, u8* reply_buf); void WriteBlock(u8 sky_num, u8 block, const u8* to_write_buf, u8* reply_buf); - bool CreateSkylander(const std::string& file_path, u16 sky_id, u16 sky_var); + bool CreateSkylander(const std::string& file_path, u16 m_sky_id, u16 m_sky_var); bool RemoveSkylander(u8 sky_num); u8 LoadSkylander(u8* buf, File::IOFile in_file); std::pair CalculateIDs(const std::array& file_data); diff --git a/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp b/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp index 107f1ddbe7..fd1c365521 100644 --- a/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp +++ b/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp @@ -16,32 +16,35 @@ #include #include #include +#include #include #include #include +#include #include #include +#include #include #include "Common/IOFile.h" +#include "Common/FileUtil.h" #include "Core/Config/MainSettings.h" +#include "Core/IOS/USB/Emulated/Skylander.h" #include "Core/System.h" #include "DolphinQt/QtUtils/DolphinFileDialog.h" #include "DolphinQt/Resources.h" #include "DolphinQt/Settings.h" -// Qt is not guaranteed to keep track of file paths using native file pickers, so we use this -// static variable to ensure we open at the most recent Skylander file location -static QString s_last_skylander_path; - SkylanderPortalWindow::SkylanderPortalWindow(QWidget* parent) : QWidget(parent) { setWindowTitle(tr("Skylanders Manager")); setWindowIcon(Resources::GetAppIcon()); setObjectName(QString::fromStdString("skylanders_manager")); - setMinimumSize(QSize(700, 200)); + setMinimumSize(QSize(650, 500)); + + m_only_show_collection = new QCheckBox(tr("Only Show Collection")); CreateMainWindow(); @@ -51,24 +54,104 @@ SkylanderPortalWindow::SkylanderPortalWindow(QWidget* parent) : QWidget(parent) installEventFilter(this); OnEmulationStateChanged(Core::GetState()); + + connect(m_skylander_list, &QListWidget::itemSelectionChanged, this, + &SkylanderPortalWindow::UpdateCurrentIDs); + + QDir skylanders_folder; + // skylanders folder in user directory + QString user_path = + QString::fromStdString(File::GetUserPath(D_USER_IDX)) + QString::fromStdString("Skylanders"); + // first time initialize path in config + if (Config::Get(Config::MAIN_SKYLANDERS_PATH) == "") + { + Config::SetBase(Config::MAIN_SKYLANDERS_PATH, user_path.toStdString()); + skylanders_folder = QDir(user_path); + } + else + { + skylanders_folder = QDir(QString::fromStdString(Config::Get(Config::MAIN_SKYLANDERS_PATH))); + } + // prompt folder creation if path invalid + if (!skylanders_folder.exists()) + { + QMessageBox::StandardButton create_folder_response; + create_folder_response = + QMessageBox::question(this, tr("Create Skylander Folder"), + tr("Skylanders folder not found for this user. Create new folder?"), + QMessageBox::Yes | QMessageBox::No); + if (create_folder_response == QMessageBox::Yes) + { + skylanders_folder = QDir(user_path); + Config::SetBase(Config::MAIN_SKYLANDERS_PATH, user_path.toStdString()); + skylanders_folder.mkdir(skylanders_folder.path()); + } + } + + m_collection_path = QDir::toNativeSeparators(skylanders_folder.path()) + QDir::separator(); + m_last_skylander_path = m_collection_path; + m_path_edit->setText(m_collection_path); }; SkylanderPortalWindow::~SkylanderPortalWindow() = default; +// Window creation void SkylanderPortalWindow::CreateMainWindow() { auto* main_layout = new QVBoxLayout(); - auto* checkbox_group = new QGroupBox(); - auto* checkbox_layout = new QHBoxLayout(); - checkbox_layout->setAlignment(Qt::AlignHCenter); - m_checkbox = new QCheckBox(tr("Emulate Skylander Portal"), this); - m_checkbox->setChecked(Config::Get(Config::MAIN_EMULATE_SKYLANDER_PORTAL)); - connect(m_checkbox, &QCheckBox::toggled, [&](bool checked) { EmulatePortal(checked); }); - checkbox_layout->addWidget(m_checkbox); - checkbox_group->setLayout(checkbox_layout); - main_layout->addWidget(checkbox_group); + auto* select_layout = new QHBoxLayout; + // left and right widgets within window separated into own functions for readability + select_layout->addLayout(CreateSlotLayout()); + select_layout->addLayout(CreateFinderLayout()); + select_layout->setStretch(0, 1); + select_layout->setStretch(1, 2); + + main_layout->addLayout(select_layout); + + // create command buttons at bottom of window + QBoxLayout* command_layout = new QHBoxLayout; + m_command_buttons = new QFrame(); + command_layout->setAlignment(Qt::AlignCenter); + auto* create_btn = new QPushButton(tr("Customize")); + auto* load_file_btn = new QPushButton(tr("Load File")); + auto* clear_btn = new QPushButton(tr("Clear Slot")); + auto* load_btn = new QPushButton(tr("Load Slot")); + connect(create_btn, &QAbstractButton::clicked, this, + &SkylanderPortalWindow::CreateSkylanderAdvanced); + connect(clear_btn, &QAbstractButton::clicked, this, [this]() { ClearSlot(GetCurrentSlot()); }); + connect(load_btn, &QAbstractButton::clicked, this, &SkylanderPortalWindow::LoadSelected); + connect(load_file_btn, &QAbstractButton::clicked, this, &SkylanderPortalWindow::LoadFromFile); + command_layout->addWidget(create_btn); + command_layout->addWidget(load_file_btn); + command_layout->addWidget(clear_btn); + command_layout->addWidget(load_btn); + m_command_buttons->setLayout(command_layout); + main_layout->addWidget(m_command_buttons); + + setLayout(main_layout); + + RefreshList(); + m_skylander_list->setCurrentItem(m_skylander_list->item(0), QItemSelectionModel::Select); + UpdateSlotNames(); +} + +QVBoxLayout* SkylanderPortalWindow::CreateSlotLayout() +{ + auto* slot_layout = new QVBoxLayout(); + + // WIDGET: Portal Enable Checkbox + auto* checkbox_layout = new QVBoxLayout(); + m_enabled_checkbox = new QCheckBox(tr("Emulate Skylander Portal"), this); + m_enabled_checkbox->setChecked(Config::Get(Config::MAIN_EMULATE_SKYLANDER_PORTAL)); + m_emulating = Config::Get(Config::MAIN_EMULATE_SKYLANDER_PORTAL); + connect(m_enabled_checkbox, &QCheckBox::toggled, [&](bool checked) { EmulatePortal(checked); }); + checkbox_layout->addWidget(m_enabled_checkbox); + slot_layout->addLayout(checkbox_layout); + + // WIDGET: Portal Slots + // Helper function for creating slots auto add_line = [](QVBoxLayout* vbox) { auto* line = new QFrame(); line->setFrameShape(QFrame::HLine); @@ -76,7 +159,10 @@ void SkylanderPortalWindow::CreateMainWindow() vbox->addWidget(line); }; - m_group_skylanders = new QGroupBox(tr("Active Portal Skylanders:")); + // Create portal slots + auto* portal_slots_group = new QGroupBox(tr("Portal Slots")); + auto* portal_slots_layout = new QVBoxLayout(); + m_group_skylanders = new QFrame(); auto* vbox_group = new QVBoxLayout(); auto* scroll_area = new QScrollArea(); @@ -92,71 +178,292 @@ void SkylanderPortalWindow::CreateMainWindow() m_edit_skylanders[i] = new QLineEdit(); m_edit_skylanders[i]->setEnabled(false); - auto* clear_btn = new QPushButton(tr("Clear")); - auto* create_btn = new QPushButton(tr("Create")); - auto* load_btn = new QPushButton(tr("Load")); - - connect(clear_btn, &QAbstractButton::clicked, this, [this, i]() { ClearSkylander(i); }); - connect(create_btn, &QAbstractButton::clicked, this, [this, i]() { CreateSkylander(i); }); - connect(load_btn, &QAbstractButton::clicked, this, [this, i]() { LoadSkylander(i); }); - + QRadioButton* button = new QRadioButton; + m_slot_radios[i] = button; + button->setProperty("id", i); + hbox_skylander->addWidget(button); hbox_skylander->addWidget(label_skyname); hbox_skylander->addWidget(m_edit_skylanders[i]); - hbox_skylander->addWidget(clear_btn); - hbox_skylander->addWidget(create_btn); - hbox_skylander->addWidget(load_btn); vbox_group->addLayout(hbox_skylander); } + m_slot_radios[0]->setChecked(true); m_group_skylanders->setLayout(vbox_group); + m_group_skylanders->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); scroll_area->setWidget(m_group_skylanders); scroll_area->setWidgetResizable(true); + scroll_area->setFrameStyle(QFrame::NoFrame); m_group_skylanders->setVisible(Config::Get(Config::MAIN_EMULATE_SKYLANDER_PORTAL)); - main_layout->addWidget(scroll_area); - setLayout(main_layout); + portal_slots_layout->addWidget(scroll_area); + portal_slots_group->setLayout(portal_slots_layout); + slot_layout->addWidget(portal_slots_group); - UpdateEdits(); + return slot_layout; } -void SkylanderPortalWindow::OnEmulationStateChanged(Core::State state) +QVBoxLayout* SkylanderPortalWindow::CreateFinderLayout() { - const bool running = state != Core::State::Uninitialized; + auto* main_layout = new QVBoxLayout(); - m_checkbox->setEnabled(!running); -} + // WIDGET: Skylander List + m_skylander_list = new QListWidget; + connect(m_skylander_list, &QListWidget::itemDoubleClicked, this, + &SkylanderPortalWindow::LoadSelected); -CreateSkylanderDialog::CreateSkylanderDialog(QWidget* parent) : QDialog(parent) -{ - setWindowTitle(tr("Skylander Creator")); - setObjectName(QString::fromStdString("skylanders_creator")); - setMinimumSize(QSize(500, 150)); - auto* layout = new QVBoxLayout; + auto* collection_layout = new QHBoxLayout(); - auto* combo_skylist = new QComboBox(); - QStringList filterlist; - for (const auto& entry : IOS::HLE::USB::list_skylanders) + // WIDGET: Skylander Collection Path + collection_layout->addWidget(new QLabel(tr("Skylander Collection Path:"))); + m_path_edit = new QLineEdit; + collection_layout->addWidget(m_path_edit); + m_path_select = new QPushButton(tr("Choose")); + connect(m_path_edit, &QLineEdit::editingFinished, this, + &SkylanderPortalWindow::OnCollectionPathChanged); + connect(m_path_select, &QAbstractButton::clicked, this, + &SkylanderPortalWindow::SelectCollectionPath); + collection_layout->addWidget(m_path_select); + + main_layout->addLayout(collection_layout); + + auto* finder_layout = new QVBoxLayout(); + + // WIDGET: Search Bar + auto* search_bar_layout = new QHBoxLayout; + m_sky_search = new QLineEdit; + m_sky_search->setClearButtonEnabled(true); + connect(m_sky_search, &QLineEdit::textChanged, this, &SkylanderPortalWindow::RefreshList); + search_bar_layout->addWidget(new QLabel(tr("Search:"))); + search_bar_layout->addWidget(m_sky_search); + finder_layout->addLayout(search_bar_layout); + + auto* finder_list_layout = new QHBoxLayout(); + + auto* search_filters_layout = new QVBoxLayout(); + + // WIDGET: Filter by Game + auto* search_game_group = new QGroupBox(tr("Game")); + auto* search_game_layout = new QVBoxLayout(); + auto* search_checkbox_scroll_area = new QScrollArea(); + search_checkbox_scroll_area->setContentsMargins(0, 0, 0, 0); + search_checkbox_scroll_area->setFrameStyle(QFrame::NoFrame); + auto* search_checkbox_group = new QFrame(); + search_checkbox_group->setContentsMargins(0, 0, 0, 0); + auto* search_checkbox_layout = new QVBoxLayout(); + + for (size_t i = 0; i < m_game_filters.size(); ++i) { - const uint qvar = (entry.first.first << 16) | entry.first.second; - combo_skylist->addItem(QString::fromStdString(entry.second), QVariant(qvar)); - filterlist << QString::fromStdString(entry.second); + QCheckBox* checkbox = new QCheckBox(this); + checkbox->setChecked(true); + connect(checkbox, &QCheckBox::toggled, this, &SkylanderPortalWindow::RefreshList); + m_game_filters[i] = checkbox; + search_checkbox_layout->addWidget(checkbox); } - combo_skylist->addItem(tr("--Unknown--"), QVariant(0xFFFFFFFF)); - combo_skylist->setEditable(true); - combo_skylist->setInsertPolicy(QComboBox::NoInsert); + m_game_filters[GetGameID(IOS::HLE::USB::Game::SpyrosAdv)]->setText(tr("Spyro's Adventure")); + m_game_filters[GetGameID(IOS::HLE::USB::Game::Giants)]->setText(tr("Giants")); + m_game_filters[GetGameID(IOS::HLE::USB::Game::SwapForce)]->setText(tr("Swap Force")); + m_game_filters[GetGameID(IOS::HLE::USB::Game::TrapTeam)]->setText(tr("Trap Team")); + m_game_filters[GetGameID(IOS::HLE::USB::Game::Superchargers)]->setText(tr("Superchargers")); + search_checkbox_group->setLayout(search_checkbox_layout); + search_checkbox_scroll_area->setWidget(search_checkbox_group); + search_game_layout->addWidget(search_checkbox_scroll_area); + search_game_group->setLayout(search_game_layout); + search_game_group->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); + search_filters_layout->addWidget(search_game_group); - auto* co_compl = new QCompleter(filterlist, this); - co_compl->setCaseSensitivity(Qt::CaseInsensitive); - co_compl->setCompletionMode(QCompleter::PopupCompletion); - co_compl->setFilterMode(Qt::MatchContains); - combo_skylist->setCompleter(co_compl); + // WIDGET: Filter by Element + auto* search_element_group = new QGroupBox(tr("Element")); + auto* search_element_layout = new QVBoxLayout(); + auto* search_radio_scroll_area = new QScrollArea(); + search_radio_scroll_area->setContentsMargins(0, 0, 0, 0); + search_radio_scroll_area->setFrameStyle(QFrame::NoFrame); + auto* search_radio_group = new QFrame(); + search_radio_group->setContentsMargins(0, 0, 0, 0); + auto* search_radio_layout = new QHBoxLayout(); - layout->addWidget(combo_skylist); + auto* radio_layout_left = new QVBoxLayout(); + for (int i = 0; i < 10; i += 2) + { + QRadioButton* radio = new QRadioButton(this); + radio->setProperty("id", i); + connect(radio, &QRadioButton::toggled, this, &SkylanderPortalWindow::RefreshList); + m_element_filter[i] = radio; + radio_layout_left->addWidget(radio); + } + search_radio_layout->addLayout(radio_layout_left); - auto* line = new QFrame(); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - layout->addWidget(line); + auto* radio_layout_right = new QVBoxLayout(); + for (int i = 1; i < 10; i += 2) + { + QRadioButton* radio = new QRadioButton(this); + radio->setProperty("id", i); + connect(radio, &QRadioButton::toggled, this, &SkylanderPortalWindow::RefreshList); + m_element_filter[i] = radio; + radio_layout_right->addWidget(radio); + } + search_radio_layout->addLayout(radio_layout_right); + + m_element_filter[0]->setText(tr("All")); + m_element_filter[0]->setChecked(true); + m_element_filter[1]->setText(tr("Magic")); + m_element_filter[2]->setText(tr("Water")); + m_element_filter[3]->setText(tr("Tech")); + m_element_filter[4]->setText(tr("Fire")); + m_element_filter[5]->setText(tr("Earth")); + m_element_filter[6]->setText(tr("Life")); + m_element_filter[7]->setText(tr("Air")); + m_element_filter[8]->setText(tr("Undead")); + m_element_filter[9]->setText(tr("Other")); + + search_radio_group->setLayout(search_radio_layout); + search_radio_scroll_area->setWidget(search_radio_group); + search_element_layout->addWidget(search_radio_scroll_area); + search_element_group->setLayout(search_element_layout); + search_element_group->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); + search_filters_layout->addWidget(search_element_group); + + // Widget: Other Filters + auto* other_box = new QGroupBox(tr("Other")); + auto* other_layout = new QVBoxLayout; + connect(m_only_show_collection, &QCheckBox::toggled, this, &SkylanderPortalWindow::RefreshList); + other_layout->addWidget(m_only_show_collection); + other_box->setLayout(other_layout); + search_filters_layout->addWidget(other_box); + + search_checkbox_scroll_area->setMinimumWidth(search_radio_group->width() + 20); + search_radio_scroll_area->setMinimumWidth(search_radio_group->width() + 20); + other_box->setMinimumWidth(search_radio_group->width() + 20); + + search_filters_layout->addStretch(1); + + finder_list_layout->addLayout(search_filters_layout); + + finder_list_layout->addWidget(m_skylander_list); + + finder_layout->addLayout(finder_list_layout); + + main_layout->addLayout(finder_layout); + + return main_layout; +} + +bool SkylanderPortalWindow::eventFilter(QObject* object, QEvent* event) +{ + if (event->type() == QEvent::KeyPress) + { + // Close when escape is pressed + if (static_cast(event)->matches(QKeySequence::Cancel)) + hide(); + } + + return false; +} + +void SkylanderPortalWindow::closeEvent(QCloseEvent* event) +{ + hide(); +} + +// UI +void SkylanderPortalWindow::EmulatePortal(bool emulate) +{ + Config::SetBaseOrCurrent(Config::MAIN_EMULATE_SKYLANDER_PORTAL, emulate); + m_group_skylanders->setVisible(emulate); + m_command_buttons->setVisible(emulate); + m_emulating = emulate; +} + +void SkylanderPortalWindow::SelectCollectionPath() +{ + QString dir = QDir::toNativeSeparators(DolphinFileDialog::getExistingDirectory( + this, tr("Select Skylander Collection"), m_collection_path)); + if (!dir.isEmpty()) + { + dir += QDir::separator(); + m_path_edit->setText(dir); + m_collection_path = dir; + } + Config::SetBase(Config::MAIN_SKYLANDERS_PATH, dir.toStdString()); + + if (m_only_show_collection->isChecked()) + RefreshList(); +} + +void SkylanderPortalWindow::LoadSelected() +{ + if (!m_emulating) + return; + + const u8 slot = GetCurrentSlot(); + + QString file_path; + if (m_only_show_collection->isChecked()) + { + if (m_skylander_list->currentItem() == nullptr) + return; + file_path = m_collection_path + m_skylander_list->currentItem()->text() + tr(".sky"); + } + else + { + file_path = GetFilePath(m_sky_id, m_sky_var); + } + + if (file_path.isEmpty()) + { + QMessageBox::StandardButton create_file_response; + create_file_response = + QMessageBox::question(this, tr("Create Skylander File"), + tr("Skylander not found in this collection. Create new file?"), + QMessageBox::Yes | QMessageBox::No); + + if (create_file_response == QMessageBox::Yes) + { + QString predef_name = m_collection_path; + const auto found_sky = + IOS::HLE::USB::list_skylanders.find(std::make_pair(m_sky_id, m_sky_var)); + if (found_sky != IOS::HLE::USB::list_skylanders.end()) + { + predef_name += QString::fromStdString(std::string(found_sky->second.name) + ".sky"); + } + else + { + const QString str = tr("Unknown(%1 %2).sky"); + predef_name += str.arg(m_sky_id, m_sky_var); + } + + CreateSkyfile(predef_name, true); + } + } + else + { + m_last_skylander_path = QFileInfo(file_path).absolutePath() + tr("/"); + + LoadSkyfilePath(slot, file_path); + } +} + +void SkylanderPortalWindow::LoadFromFile() +{ + const u8 slot = GetCurrentSlot(); + const QString file_path = + DolphinFileDialog::getOpenFileName(this, tr("Select Skylander File"), m_last_skylander_path, + tr("Skylander (*.sky);;All Files (*)")); + ; + if (file_path.isEmpty()) + { + return; + } + m_last_skylander_path = + QDir::toNativeSeparators(QFileInfo(file_path).absolutePath()) + QDir::separator(); + + LoadSkyfilePath(slot, file_path); +} + +void SkylanderPortalWindow::CreateSkylanderAdvanced() +{ + QDialog* create_window = new QDialog; + + auto* layout = new QVBoxLayout; auto* hbox_idvar = new QHBoxLayout(); auto* label_id = new QLabel(tr("ID:")); @@ -177,30 +484,18 @@ CreateSkylanderDialog::CreateSkylanderDialog(QWidget* parent) : QDialog(parent) buttons->button(QDialogButtonBox::Ok)->setText(tr("Create")); layout->addWidget(buttons); - setLayout(layout); - - connect(combo_skylist, QOverload::of(&QComboBox::currentIndexChanged), [=](int index) { - const u32 sky_info = combo_skylist->itemData(index).toUInt(); - if (sky_info != 0xFFFFFFFF) - { - const u16 sky_id = sky_info >> 16; - const u16 sky_var = sky_info & 0xFFFF; - - edit_id->setText(QString::number(sky_id)); - edit_var->setText(QString::number(sky_var)); - } - }); + create_window->setLayout(layout); connect(buttons, &QDialogButtonBox::accepted, this, [=, this]() { bool ok_id = false, ok_var = false; - const u16 sky_id = edit_id->text().toUShort(&ok_id); + m_sky_id = edit_id->text().toUShort(&ok_id); if (!ok_id) { QMessageBox::warning(this, tr("Error converting value"), tr("ID entered is invalid!"), QMessageBox::Ok); return; } - const u16 sky_var = edit_var->text().toUShort(&ok_var); + m_sky_var = edit_var->text().toUShort(&ok_var); if (!ok_var) { QMessageBox::warning(this, tr("Error converting value"), tr("Variant entered is invalid!"), @@ -208,82 +503,159 @@ CreateSkylanderDialog::CreateSkylanderDialog(QWidget* parent) : QDialog(parent) return; } - QString predef_name = s_last_skylander_path; - const auto found_sky = IOS::HLE::USB::list_skylanders.find(std::make_pair(sky_id, sky_var)); + QString predef_name = m_last_skylander_path; + const auto found_sky = IOS::HLE::USB::list_skylanders.find(std::make_pair(m_sky_id, m_sky_var)); if (found_sky != IOS::HLE::USB::list_skylanders.end()) { - predef_name += QString::fromStdString(std::string(found_sky->second) + ".sky"); + predef_name += QString::fromStdString(std::string(found_sky->second.name) + ".sky"); } else { QString str = tr("Unknown(%1 %2).sky"); - predef_name += str.arg(sky_id, sky_var); + predef_name += str.arg(m_sky_id, m_sky_var); } - m_file_path = DolphinFileDialog::getSaveFileName(this, tr("Create Skylander File"), predef_name, - tr("Skylander Object (*.sky);;")); - if (m_file_path.isEmpty()) + QString file_path = DolphinFileDialog::getSaveFileName( + this, tr("Create Skylander File"), predef_name, tr("Skylander (*.sky);;All Files (*)")); + if (file_path.isEmpty()) { return; } - auto& system = Core::System::GetInstance(); + CreateSkyfile(file_path, true); + create_window->accept(); + }); - if (!system.GetSkylanderPortal().CreateSkylander(m_file_path.toStdString(), sky_id, sky_var)) + connect(buttons, &QDialogButtonBox::rejected, create_window, &QDialog::reject); + + create_window->show(); + create_window->raise(); +} + +void SkylanderPortalWindow::ClearSlot(u8 slot) +{ + auto& system = Core::System::GetInstance(); + if (auto slot_infos = m_sky_slots[slot]) + { + if (!system.GetSkylanderPortal().RemoveSkylander(slot_infos->portal_slot)) { - QMessageBox::warning(this, tr("Failed to create Skylander file!"), - tr("Failed to create Skylander file:\n%1").arg(m_file_path), + QMessageBox::warning(this, tr("Failed to clear Skylander!"), + tr("Failed to clear the Skylander from slot(%1)!").arg(slot), QMessageBox::Ok); return; } - s_last_skylander_path = QFileInfo(m_file_path).absolutePath() + QString::fromStdString("/"); - accept(); - }); - - connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject); - - connect(co_compl, QOverload::of(&QCompleter::activated), - [=](const QString& text) { - combo_skylist->setCurrentText(text); - combo_skylist->setCurrentIndex(combo_skylist->findText(text)); - }); -} - -QString CreateSkylanderDialog::GetFilePath() const -{ - return m_file_path; -} - -void SkylanderPortalWindow::EmulatePortal(bool emulate) -{ - Config::SetBaseOrCurrent(Config::MAIN_EMULATE_SKYLANDER_PORTAL, emulate); - m_group_skylanders->setVisible(emulate); -} - -void SkylanderPortalWindow::CreateSkylander(u8 slot) -{ - CreateSkylanderDialog create_dlg(this); - if (create_dlg.exec() == CreateSkylanderDialog::Accepted) - { - LoadSkylanderPath(slot, create_dlg.GetFilePath()); + m_sky_slots[slot].reset(); + if (m_only_show_collection->isChecked()) + RefreshList(); + UpdateSlotNames(); } } -void SkylanderPortalWindow::LoadSkylander(u8 slot) +// Behind the scenes +void SkylanderPortalWindow::OnCollectionPathChanged() { - const QString file_path = - DolphinFileDialog::getOpenFileName(this, tr("Select Skylander File"), s_last_skylander_path, - QString::fromStdString("Skylander (*.sky);;")); - if (file_path.isEmpty()) + m_collection_path = m_path_edit->text(); + Config::SetBase(Config::MAIN_SKYLANDERS_PATH, m_path_edit->text().toStdString()); + RefreshList(); +} + +void SkylanderPortalWindow::OnEmulationStateChanged(Core::State state) +{ + const bool running = state != Core::State::Uninitialized; + + m_enabled_checkbox->setEnabled(!running); +} + +void SkylanderPortalWindow::UpdateCurrentIDs() +{ + const u32 sky_info = m_skylander_list->currentItem()->data(1).toUInt(); + if (sky_info != 0xFFFFFFFF) { + m_sky_id = sky_info >> 16; + m_sky_var = sky_info & 0xFFFF; + } +} + +void SkylanderPortalWindow::RefreshList() +{ + const int row = m_skylander_list->currentRow(); + m_skylander_list->clear(); + if (m_only_show_collection->isChecked()) + { + const QDir collection = QDir(m_collection_path); + auto& system = Core::System::GetInstance(); + for (auto file : collection.entryInfoList(QStringList(tr("*.sky")))) + { + File::IOFile sky_file(file.filePath().toStdString(), "r+b"); + if (!sky_file) + { + continue; + } + std::array file_data; + if (!sky_file.ReadBytes(file_data.data(), file_data.size())) + { + continue; + } + auto ids = system.GetSkylanderPortal().CalculateIDs(file_data); + if (PassesFilter(file.baseName(), ids.first, ids.second)) + { + const uint qvar = (ids.first << 16) | ids.second; + QListWidgetItem* skylander = new QListWidgetItem(file.baseName()); + skylander->setBackground(GetBaseColor(ids)); + skylander->setForeground(QBrush(QColor(0, 0, 0, 255))); + skylander->setData(1, qvar); + m_skylander_list->addItem(skylander); + } + } + } + else + { + for (const auto& entry : IOS::HLE::USB::list_skylanders) + { + int id = entry.first.first; + int var = entry.first.second; + if (PassesFilter(tr(entry.second.name), id, var)) + { + const uint qvar = (entry.first.first << 16) | entry.first.second; + QListWidgetItem* skylander = new QListWidgetItem(tr(entry.second.name)); + skylander->setBackground(GetBaseColor(entry.first)); + skylander->setForeground(QBrush(QColor(0, 0, 0, 255))); + skylander->setData(1, qvar); + m_skylander_list->addItem(skylander); + } + } + } + if (m_skylander_list->count() >= row) + { + m_skylander_list->setCurrentItem(m_skylander_list->item(row), QItemSelectionModel::Select); + } + else if (m_skylander_list->count() > 0) + { + m_skylander_list->setCurrentItem(m_skylander_list->item(m_skylander_list->count() - 1), + QItemSelectionModel::Select); + } +} + +void SkylanderPortalWindow::CreateSkyfile(const QString& path, bool load_after) +{ + auto& system = Core::System::GetInstance(); + + if (!system.GetSkylanderPortal().CreateSkylander(path.toStdString(), m_sky_id, m_sky_var)) + { + QMessageBox::warning( + this, tr("Failed to create Skylander file!"), + tr("Failed to create Skylander file:\n%1\n(Skylander may already be on the portal)") + .arg(path), + QMessageBox::Ok); return; } - s_last_skylander_path = QFileInfo(file_path).absolutePath() + QString::fromStdString("/"); + m_last_skylander_path = QFileInfo(path).absolutePath() + QString::fromStdString("/"); - LoadSkylanderPath(slot, file_path); + if (load_after) + LoadSkyfilePath(GetCurrentSlot(), path); } -void SkylanderPortalWindow::LoadSkylanderPath(u8 slot, const QString& path) +void SkylanderPortalWindow::LoadSkyfilePath(u8 slot, const QString& path) { File::IOFile sky_file(path.toStdString(), "r+b"); if (!sky_file) @@ -305,11 +677,12 @@ void SkylanderPortalWindow::LoadSkylanderPath(u8 slot, const QString& path) return; } - ClearSkylander(slot); + ClearSlot(slot); auto& system = Core::System::GetInstance(); - std::pair id_var = system.GetSkylanderPortal().CalculateIDs(file_data); - u8 portal_slot = system.GetSkylanderPortal().LoadSkylander(file_data.data(), std::move(sky_file)); + const std::pair id_var = system.GetSkylanderPortal().CalculateIDs(file_data); + const u8 portal_slot = + system.GetSkylanderPortal().LoadSkylander(file_data.data(), std::move(sky_file)); if (portal_slot == 0xFF) { QMessageBox::warning(this, tr("Failed to load the Skylander file!"), @@ -317,41 +690,26 @@ void SkylanderPortalWindow::LoadSkylanderPath(u8 slot, const QString& path) return; } m_sky_slots[slot] = {portal_slot, id_var.first, id_var.second}; - UpdateEdits(); + RefreshList(); + UpdateSlotNames(); } -void SkylanderPortalWindow::ClearSkylander(u8 slot) -{ - auto& system = Core::System::GetInstance(); - if (auto slot_infos = m_sky_slots[slot]) - { - if (!system.GetSkylanderPortal().RemoveSkylander(slot_infos->portal_slot)) - { - QMessageBox::warning(this, tr("Failed to clear Skylander!"), - tr("Failed to clear the Skylander from slot(%1)!\n").arg(slot), - QMessageBox::Ok); - return; - } - m_sky_slots[slot].reset(); - UpdateEdits(); - } -} - -void SkylanderPortalWindow::UpdateEdits() +void SkylanderPortalWindow::UpdateSlotNames() { for (auto i = 0; i < MAX_SKYLANDERS; i++) { QString display_string; if (auto sd = m_sky_slots[i]) { - auto found_sky = IOS::HLE::USB::list_skylanders.find(std::make_pair(sd->sky_id, sd->sky_var)); + auto found_sky = + IOS::HLE::USB::list_skylanders.find(std::make_pair(sd->m_sky_id, sd->m_sky_var)); if (found_sky != IOS::HLE::USB::list_skylanders.end()) { - display_string = QString::fromStdString(found_sky->second); + display_string = QString::fromStdString(found_sky->second.name); } else { - display_string = QString(tr("Unknown (Id:%1 Var:%2)")).arg(sd->sky_id).arg(sd->sky_var); + display_string = QString(tr("Unknown (Id:%1 Var:%2)")).arg(sd->m_sky_id).arg(sd->m_sky_var); } } else @@ -363,19 +721,227 @@ void SkylanderPortalWindow::UpdateEdits() } } -bool SkylanderPortalWindow::eventFilter(QObject* object, QEvent* event) +// Helpers +bool SkylanderPortalWindow::PassesFilter(QString name, u16 id, u16 var) { - // Close when escape is pressed - if (event->type() == QEvent::KeyPress) + const auto skypair = IOS::HLE::USB::list_skylanders.find(std::make_pair(id, var)); + IOS::HLE::USB::SkyData character; + if (skypair == IOS::HLE::USB::list_skylanders.end()) { - if (static_cast(event)->matches(QKeySequence::Cancel)) - hide(); + return false; + } + else + { + character = skypair->second; } - return false; + bool pass = false; + + // Check against active game filters + if (m_game_filters[GetGameID(IOS::HLE::USB::Game::SpyrosAdv)]->isChecked()) + { + if (character.game == IOS::HLE::USB::Game::SpyrosAdv) + pass = true; + } + if (m_game_filters[GetGameID(IOS::HLE::USB::Game::Giants)]->isChecked()) + { + if (character.game == IOS::HLE::USB::Game::Giants) + pass = true; + } + if (m_game_filters[GetGameID(IOS::HLE::USB::Game::SwapForce)]->isChecked()) + { + if (character.game == IOS::HLE::USB::Game::SwapForce) + pass = true; + } + if (m_game_filters[GetGameID(IOS::HLE::USB::Game::TrapTeam)]->isChecked()) + { + if (character.game == IOS::HLE::USB::Game::TrapTeam) + pass = true; + } + if (m_game_filters[GetGameID(IOS::HLE::USB::Game::Superchargers)]->isChecked()) + { + if (character.game == IOS::HLE::USB::Game::Superchargers) + pass = true; + } + if (!pass) + return false; + + // Check against search bar filter + if (!name.contains(m_sky_search->text(), Qt::CaseInsensitive)) + return false; + + // Check against active element filter + switch (GetElementRadio()) + { + case 1: + if (character.element != IOS::HLE::USB::Element::Magic) + return false; + break; + case 2: + if (character.element != IOS::HLE::USB::Element::Water) + return false; + break; + case 3: + if (character.element != IOS::HLE::USB::Element::Tech) + return false; + break; + case 4: + if (character.element != IOS::HLE::USB::Element::Fire) + return false; + break; + case 5: + if (character.element != IOS::HLE::USB::Element::Earth) + return false; + break; + case 6: + if (character.element != IOS::HLE::USB::Element::Life) + return false; + break; + case 7: + if (character.element != IOS::HLE::USB::Element::Air) + return false; + break; + case 8: + if (character.element != IOS::HLE::USB::Element::Undead) + return false; + break; + case 9: + if (character.element != IOS::HLE::USB::Element::Other) + return false; + break; + } + + return true; } -void SkylanderPortalWindow::closeEvent(QCloseEvent* event) +QString SkylanderPortalWindow::GetFilePath(u16 id, u16 var) { - hide(); + const QDir collection = QDir(m_collection_path); + auto& system = Core::System::GetInstance(); + for (auto file : collection.entryInfoList(QStringList(tr("*.sky")))) + { + File::IOFile sky_file(file.filePath().toStdString(), "r+b"); + if (!sky_file) + { + continue; + } + std::array file_data; + if (!sky_file.ReadBytes(file_data.data(), file_data.size())) + { + continue; + } + auto ids = system.GetSkylanderPortal().CalculateIDs(file_data); + if (ids.first == id && ids.second == var) + { + return file.filePath(); + } + } + return QString(); +} + +u8 SkylanderPortalWindow::GetCurrentSlot() +{ + for (auto radio : m_slot_radios) + { + if (radio->isChecked()) + { + return radio->property("id").toInt(); + } + } + return 0; +} + +int SkylanderPortalWindow::GetElementRadio() +{ + for (auto radio : m_element_filter) + { + if (radio->isChecked()) + { + return radio->property("id").toInt(); + } + } + return -1; +} + +QBrush SkylanderPortalWindow::GetBaseColor(std::pair ids) +{ + auto skylander = IOS::HLE::USB::list_skylanders.find(ids); + + if (skylander == IOS::HLE::USB::list_skylanders.end()) + return QBrush(QColor(255, 255, 255, 255)); + + switch ((*skylander).second.game) + { + case IOS::HLE::USB::Game::SpyrosAdv: + return QBrush(QColor(240, 255, 240, 255)); + case IOS::HLE::USB::Game::Giants: + return QBrush(QColor(255, 240, 215, 255)); + case IOS::HLE::USB::Game::SwapForce: + return QBrush(QColor(240, 245, 255, 255)); + case IOS::HLE::USB::Game::TrapTeam: + return QBrush(QColor(255, 240, 240, 255)); + case IOS::HLE::USB::Game::Superchargers: + return QBrush(QColor(247, 228, 215, 255)); + default: + return QBrush(QColor(255, 255, 255, 255)); + } +} + +int SkylanderPortalWindow::GetGameID(IOS::HLE::USB::Game game) +{ + switch (game) + { + case IOS::HLE::USB::Game::SpyrosAdv: + return 0; + + case IOS::HLE::USB::Game::Giants: + return 1; + + case IOS::HLE::USB::Game::SwapForce: + return 2; + + case IOS::HLE::USB::Game::TrapTeam: + return 3; + + case IOS::HLE::USB::Game::Superchargers: + return 4; + + case IOS::HLE::USB::Game::Other: + return 5; + } + return -1; +} + +int SkylanderPortalWindow::GetElementID(IOS::HLE::USB::Element elem) +{ + switch (elem) + { + case IOS::HLE::USB::Element::Magic: + return 0; + + case IOS::HLE::USB::Element::Fire: + return 1; + + case IOS::HLE::USB::Element::Air: + return 2; + + case IOS::HLE::USB::Element::Life: + return 3; + + case IOS::HLE::USB::Element::Undead: + return 4; + + case IOS::HLE::USB::Element::Earth: + return 5; + + case IOS::HLE::USB::Element::Water: + return 6; + + case IOS::HLE::USB::Element::Tech: + return 7; + + case IOS::HLE::USB::Element::Other: + return 8; + } + return -1; } diff --git a/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.h b/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.h index 320d524710..72ce63420a 100644 --- a/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.h +++ b/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.h @@ -6,8 +6,11 @@ #include #include -#include +#include +#include #include +#include +#include #include #include "Core/Core.h" @@ -16,12 +19,15 @@ class QCheckBox; class QGroupBox; class QLineEdit; +class QPushButton; +class QRadioButton; +class QListWidget; struct Skylander { u8 portal_slot; - u16 sky_id; - u16 sky_var; + u16 m_sky_id; + u16 m_sky_var; }; class SkylanderPortalWindow : public QWidget @@ -36,29 +42,58 @@ protected: std::array, MAX_SKYLANDERS> m_sky_slots; private: + // Window void CreateMainWindow(); - void OnEmulationStateChanged(Core::State state); - void CreateSkylander(u8 slot); - void ClearSkylander(u8 slot); - void EmulatePortal(bool emulate); - void LoadSkylander(u8 slot); - void LoadSkylanderPath(u8 slot, const QString& path); - void UpdateEdits(); + QVBoxLayout* CreateSlotLayout(); + QVBoxLayout* CreateFinderLayout(); void closeEvent(QCloseEvent* bar) override; bool eventFilter(QObject* object, QEvent* event) final override; - QCheckBox* m_checkbox; - QGroupBox* m_group_skylanders; -}; - -class CreateSkylanderDialog : public QDialog -{ - Q_OBJECT - -public: - explicit CreateSkylanderDialog(QWidget* parent); - QString GetFilePath() const; - -protected: - QString m_file_path; + // UI + void EmulatePortal(bool emulate); + void SelectCollectionPath(); + void LoadSelected(); + void LoadFromFile(); + void ClearSlot(u8 slot); + void CreateSkylanderAdvanced(); + + // Behind the scenes + void OnEmulationStateChanged(Core::State state); + void OnCollectionPathChanged(); + void RefreshList(); + void UpdateCurrentIDs(); + void CreateSkyfile(const QString& path, bool load_after); + void LoadSkyfilePath(u8 slot, const QString& path); + void UpdateSlotNames(); + + // Helpers + bool PassesFilter(QString name, u16 id, u16 var); + QString GetFilePath(u16 id, u16 var); + u8 GetCurrentSlot(); + int GetElementRadio(); + QBrush GetBaseColor(std::pair ids); + int GetGameID(IOS::HLE::USB::Game game); + int GetElementID(IOS::HLE::USB::Element elem); + + bool m_emulating; + QCheckBox* m_enabled_checkbox; + QFrame* m_group_skylanders; + QFrame* m_command_buttons; + std::array m_slot_radios; + + // Qt is not guaranteed to keep track of file paths using native file pickers, so we use this + // variable to ensure we open at the most recent Skylander file location + QString m_last_skylander_path; + + QString m_collection_path; + QLineEdit* m_path_edit; + QPushButton* m_path_select; + + std::array m_game_filters; + std::array m_element_filter; + QCheckBox* m_only_show_collection; + QLineEdit* m_sky_search; + QListWidget* m_skylander_list; + u16 m_sky_id = 0; + u16 m_sky_var = 0; };