@@ -6,7 +6,7 @@ namespace CTRPluginFramework {
66 u16 spwnSpecies;
77 u8 spawnLv;
88 u8 spwnForm;
9- int pkmnID;
9+ int pkmnID = 0 ;
1010
1111 int MatchPkmn (Pokemon &output, string &input) {
1212 int index = 0 ;
@@ -67,26 +67,22 @@ namespace CTRPluginFramework {
6767 // If we have only one matches, complete the input
6868 if (count == 1 ) {
6969 pkmnID = matches.choiceNo [0 ] + 1 ;
70- input = matches.name [0 ];
71- return ;
72- }
73-
74- if (count == 2 && (input == " Mew" || input == " Pidgeot" )) {
75- pkmnID = matches.choiceNo [1 ] + 1 ;
76- input = matches.name [1 ];
70+ OSD::Notify (Color::LimeGreen << " Success" << Color::White << " ! Selected: " << matches.name [0 ]);
71+ keyboard.Close ();
7772 return ;
7873 }
7974
8075 // If we have less than or equal to ten matches, populate a list keyboard
81- if (count > 1 && count <= 10 && (input != " Mew " && input != " Pidgeot " ) ) {
76+ if (count > 1 && count <= 10 ) {
8277 Keyboard kb (matches.name );
8378 kb.CanAbort (false );
8479 kb.DisplayTopScreen = false ;
8580 choice = kb.Open ();
8681
8782 if (choice >= 0 ) {
8883 pkmnID = matches.choiceNo [choice] + 1 ;
89- input = matches.name [choice];
84+ OSD::Notify (Color::LimeGreen << " Success" << Color::White << " ! Selected: " << matches.name [choice]);
85+ keyboard.Close ();
9086 return ;
9187 }
9288 }
@@ -100,8 +96,6 @@ namespace CTRPluginFramework {
10096
10197 if (KB<string>(" Pokémon:" , true , 11 , output, " " , PkmnInputChange))
10298 return ;
103-
104- pkmnID = 0 ;
10599 }
106100
107101 int abilityID;
@@ -297,7 +291,6 @@ namespace CTRPluginFramework {
297291 int index = 0 ;
298292 output.name .clear ();
299293 string lowerCase (input);
300- static const vector<int > ignored = {622 , 623 , 624 , 625 , 626 , 627 , 628 , 629 , 630 , 631 , 632 , 633 , 634 , 635 , 636 , 637 , 638 , 639 , 640 , 641 , 642 , 643 , 644 , 645 , 646 , 647 , 648 , 649 , 650 , 651 , 652 , 653 , 654 , 655 , 656 , 657 , 658 , 695 , 696 , 697 , 698 , 699 , 700 , 701 , 702 , 703 , 719 , 723 , 724 , 725 , 726 , 727 , 728 };
301294
302295 for (char &character : lowerCase)
303296 character = tolower (character);
@@ -314,11 +307,9 @@ namespace CTRPluginFramework {
314307 }
315308
316309 if (index < Helpers::AutoRegion (Helpers::GetVersion (617 , 621 ), Helpers::GetVersion (719 , 728 ))) {
317- if (*find (ignored.begin (), ignored.end (), index) != index) {
318- if (iterator == lowerCase.end ()) {
319- output.name .push_back (moves);
320- output.choiceNo .push_back (index);
321- }
310+ if (iterator == lowerCase.end ()) {
311+ output.name .push_back (moves);
312+ output.choiceNo .push_back (index);
322313 }
323314 }
324315
@@ -355,26 +346,22 @@ namespace CTRPluginFramework {
355346 // If we have only one matches, complete the input
356347 if (count == 1 ) {
357348 moveID = matches.choiceNo [0 ] + 1 ;
358- input = matches.name [0 ];
359- return ;
360- }
361-
362- if (count == 6 && (input == " Thunder" )) {
363- moveID = matches.choiceNo [4 ] + 1 ;
364- input = matches.name [4 ];
349+ OSD::Notify (Color::LimeGreen << " Success" << Color::White << " ! Applied: " << matches.name [0 ]);
350+ keyboard.Close ();
365351 return ;
366352 }
367353
368354 // If we have less than or equal to ten matches, populate a list keyboard
369- if (count > 1 && count <= 10 && (input != " Thunder " ) ) {
355+ if (count > 1 && count <= 10 ) {
370356 Keyboard kb (matches.name );
371357 kb.CanAbort (false );
372358 kb.DisplayTopScreen = false ;
373359 int choice = kb.Open ();
374360
375361 if (choice >= 0 ) {
376362 moveID = matches.choiceNo [choice] + 1 ;
377- input = matches.name [choice];
363+ OSD::Notify (Color::LimeGreen << " Success" << Color::White << " ! Applied: " << matches.name [choice]);
364+ keyboard.Close ();
378365 return ;
379366 }
380367 }
@@ -388,7 +375,5 @@ namespace CTRPluginFramework {
388375
389376 if (KB<string>(" Move:" , true , 27 , output, " " , MoveInputChange))
390377 return ;
391-
392- moveID = 0 ;
393378 }
394379}
0 commit comments