Skip to content

Commit

Permalink
Pull changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfsblvt committed Aug 14, 2016
2 parents 7906d60 + f407691 commit baa78d8
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/me/corriekay/pokegoutil/utils/ConfigKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public enum ConfigKey {
SORT_COLINDEX_2("options.sort.2.colIndex", 12, Integer.class),
SORT_ORDER_2("options.sort.2.order", SortOrder.DESCENDING.toString(), String.class),

TRANSFER_AFTER_EVOLVE("transfer.afterEvolve", false, Boolean.class),
SHOW_BULK_POPUP("popup.afterBulk", true, Boolean.class),
TRANSFER_AFTER_EVOLVE("settings.transferAfterEvolve", false, Boolean.class),
SHOW_BULK_POPUP("settings.popupAfterBulk", true, Boolean.class),
INCLUDE_FAMILY("settings.includeFamily", true, Boolean.class),

LANGUAGE("options.lang", "en", String.class),
FONT_SIZE("options.fontsize", 0, Integer.class),
Expand Down
29 changes: 21 additions & 8 deletions src/me/corriekay/pokegoutil/windows/MenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,43 @@ public MenuBar(PokemonGo go) {
tAfterE.addItemListener(e -> config.setBool(ConfigKey.TRANSFER_AFTER_EVOLVE, tAfterE.isSelected()));
settings.add(tAfterE);

JCheckBoxMenuItem doNotShowBulkPopup = new JCheckBoxMenuItem("Show Bulk Completion");
JCheckBoxMenuItem doNotShowBulkPopup = new JCheckBoxMenuItem("Show Bulk Completion Window");
doNotShowBulkPopup.setSelected(config.getBool(ConfigKey.SHOW_BULK_POPUP));
doNotShowBulkPopup
.addItemListener(e -> config.setBool(ConfigKey.SHOW_BULK_POPUP, doNotShowBulkPopup.isSelected()));
doNotShowBulkPopup.addItemListener(e -> config.setBool(ConfigKey.SHOW_BULK_POPUP, doNotShowBulkPopup.isSelected()));
settings.add(doNotShowBulkPopup);

JCheckBoxMenuItem includeFamily = new JCheckBoxMenuItem("Include Family On Searchbar");
includeFamily.setSelected(config.getBool(ConfigKey.INCLUDE_FAMILY));
includeFamily.addItemListener(e -> config.setBool(ConfigKey.INCLUDE_FAMILY, includeFamily.isSelected()));
settings.add(includeFamily);

add(settings);

// Help menu
help = new JMenu("Help");

JMenuItem about = new JMenuItem("About");
about.addActionListener(l -> JOptionPane.showMessageDialog(null,
"Version: " + BlossomsPoGoManager.VERSION + "\n\nAuthor: Corrie 'Blossom' Kay"
+ "\n\nThis work is protected under the"
"Version: " + BlossomsPoGoManager.VERSION
+ "\n"
+ "\nAuthor: Corrie 'Blossom' Kay"
+ "\nCollaborators: Wolfsblvt, Ljay,"
+ "\nnaderki, wullxz, Cryptically, "
+ "\neralpsahin, weblue, edysantosa,"
+ "\ndylanpdx, michael-smith-versacom"
+ "\n"
+ "\nThis work is protected under the"
+ "\nCreative Commons Attribution-"
+ "\nNonCommercial-ShareAlike 4.0"
+ "\nInternational license, which can"
+ "\nbe found here:"
+ "\nhttps://creativecommons.org/"
+ "\nlicenses/by-nc-sa/4.0/"
+ "\n\nThanks to Grover for providing"
+ "\nsuch a great API." + "\n\nThanks for Draseart for"
+ "\n"
+ "\nThanks to Grover for providing"
+ "\nsuch a great API."
+ "\n"
+ "\nThanks for Draseart for"
+ "\nthe icon art.",
"About Blossom's Pokémon Go Manager", JOptionPane.PLAIN_MESSAGE));
help.add(about);
Expand All @@ -101,5 +115,4 @@ private void displayTrainerStats() throws Exception {
"Stardust: " + pp.getCurrency(Currency.STARDUST)};
JOptionPane.showMessageDialog(null, tstats, "Trainer Stats", JOptionPane.PLAIN_MESSAGE);
}

}
16 changes: 15 additions & 1 deletion src/me/corriekay/pokegoutil/windows/PokemonTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,21 @@ private void refreshList() {
String[] terms = search.split(";");
try {
go.getInventories().getPokebank().getPokemons().forEach(poke -> {
String searchme = PokeHandler.getLocalPokeName(poke) + "" + poke.getPokemonFamily() + poke.getNickname()
boolean useFamilyName = config.getBool(ConfigKey.INCLUDE_FAMILY);
String familyName = "";
if (useFamilyName) {
// Try translating family name
try {
PokemonId familyPokemonId = PokemonId.valueOf(poke.getPokemonFamily().toString().replaceAll("FAMILY_", ""));
familyName = PokeHandler.getLocalPokeName(familyPokemonId.getNumber());
} catch (IllegalArgumentException e) {
familyName = poke.getPokemonFamily().toString();
}
}

String searchme = PokeHandler.getLocalPokeName(poke)
+ ((useFamilyName) ? familyName : "")
+ poke.getNickname()
+ poke.getMeta().getType1() + poke.getMeta().getType2() + poke.getMove1() + poke.getMove2()
+ poke.getPokeball();
searchme = searchme.replaceAll("_FAST", "").replaceAll("FAMILY_", "").replaceAll("NONE", "").replaceAll("ITEM_", "").replaceAll("_", "").replaceAll(" ", "").toLowerCase();
Expand Down

0 comments on commit baa78d8

Please sign in to comment.