Skip to content

Commit

Permalink
Bug Fix: Fixed lookup links
Browse files Browse the repository at this point in the history
Merge Master
  • Loading branch information
GoldenGnu committed Apr 26, 2024
2 parents 591dd3d + 60f7d46 commit a8768d2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public enum Images {
FILTER_AFTER_COLUMN ("filter_after_column.png"),
FILTER_BEFORE_COLUMN ("filter_before_column.png"),

LINK_EVEMARKETER ("link_evemarketer.png"),
LINK_EVE_MARKETDATA ("link_eve_marketdata.png"),
LINK_EVEINFO ("link_eveinfo.png"),
LINK_DOTLAN_EVEMAPS ("link_dotlan_evemaps.png"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
public class JMenuLookup<T> extends JAutoMenu<T> {

private enum MenuLookupAction {
EVEMARKETER,
GAMES_CHRUKER,
FUZZWORK_ITEMS,
ZKILLBOARD_ITEM,
Expand Down Expand Up @@ -186,16 +185,6 @@ public Set<String> getLinks(MenuData<?> menuData) {
}
},
//Market
EVEMARKETER() {
@Override
public Set<String> getLinks(MenuData<?> menuData) {
Set<String> urls = new HashSet<>();
for (int marketTypeID : menuData.getMarketTypeIDs()) {
urls.add("https://evemarketer.com/types/" + marketTypeID);
}
return urls;
}
},
ADAM4EVE() {
@Override
public Set<String> getLinks(MenuData<?> menuData) {
Expand All @@ -221,7 +210,7 @@ public Set<String> getLinks(MenuData<?> menuData) {
public Set<String> getLinks(MenuData<?> menuData) {
Set<String> urls = new HashSet<>();
for (int marketTypeID : menuData.getMarketTypeIDs()) {
urls.add("https://evemarketer.com/types/" + marketTypeID);
urls.add("https://evetycoon.com/market/" + marketTypeID);
}
return urls;
}
Expand Down Expand Up @@ -293,7 +282,7 @@ public Set<String> getLinks(MenuData<?> menuData) {
public Set<String> getLinks(MenuData<?> menuData) {
Set<String> urls = new HashSet<>();
for (int typeID : menuData.getInventionTypeIDs()) {
urls.add("https://lazy-blacksmith.space/blueprint/invention/" + typeID);
urls.add("https://lzb.eveskillboard.com/blueprint/invention/" + typeID);
}
return urls;
}
Expand All @@ -303,7 +292,7 @@ public Set<String> getLinks(MenuData<?> menuData) {
public Set<String> getLinks(MenuData<?> menuData) {
Set<String> urls = new HashSet<>();
for (int typeID : menuData.getBlueprintTypeIDs()) {
urls.add("https://lazy-blacksmith.space/blueprint/manufacturing/" + typeID);
urls.add("https://lzb.eveskillboard.com/blueprint/manufacturing/" + typeID);
}
return urls;
}
Expand All @@ -313,7 +302,7 @@ public Set<String> getLinks(MenuData<?> menuData) {
public Set<String> getLinks(MenuData<?> menuData) {
Set<String> urls = new HashSet<>();
for (int typeID : menuData.getBlueprintTypeIDs()) {
urls.add("https://lazy-blacksmith.space/blueprint/research_copy/" + typeID);
urls.add("https://lzb.eveskillboard.com/blueprint/research_copy/" + typeID);
}
return urls;
}
Expand Down Expand Up @@ -351,7 +340,6 @@ public Set<String> getLinks(MenuData<?> menuData) {
private final JMenuItem jEveMissioneerConstellation;
private final JMenuItem jEveMissioneerRegion;
private final JMenu jMarket;
private final JMenuItem jEveMarketer;
private final JMenuItem jFuzzworkMarket;
private final JMenuItem jEveTycoon;
private final JMenu jItemDatabase;
Expand Down Expand Up @@ -471,12 +459,6 @@ public JMenuLookup(final Program program) {
jMarket.setIcon(Images.ORDERS_SELL.getIcon());
add(jMarket);

jEveMarketer = new JMenuItem(GuiShared.get().eveMarketer());
jEveMarketer.setIcon(Images.LINK_EVEMARKETER.getIcon());
jEveMarketer.setActionCommand(MenuLookupAction.EVEMARKETER.name());
jEveMarketer.addActionListener(listener);
jMarket.add(jEveMarketer);

jFuzzworkMarket = new JMenuItem(GuiShared.get().fuzzworkMarket());
jFuzzworkMarket.setIcon(Images.LINK_FUZZWORK.getIcon());
jFuzzworkMarket.setActionCommand(MenuLookupAction.FUZZWORK_MARKET.name());
Expand Down Expand Up @@ -585,7 +567,6 @@ public void updateMenuData() {
jEveMissioneerRegion.setEnabled(!menuData.getRegionLocations().isEmpty());
//Market
jMarket.setEnabled(!menuData.getMarketTypeIDs().isEmpty());
jEveMarketer.setEnabled(!menuData.getMarketTypeIDs().isEmpty());
jFuzzworkMarket.setEnabled(!menuData.getMarketTypeIDs().isEmpty());
jEveTycoon.setEnabled(!menuData.getMarketTypeIDs().isEmpty());
jAdam4eve.setEnabled(!menuData.getMarketTypeIDs().isEmpty());
Expand Down Expand Up @@ -717,8 +698,6 @@ public void actionPerformed(final ActionEvent e) {
} else if (MenuLookupAction.EVEMISSIONEER_REGION.name().equals(e.getActionCommand())) {
DesktopUtil.browse(LookupLinks.EVEMISSIONEER_REGION.getLinks(menuData), program);
//Market
} else if (MenuLookupAction.EVEMARKETER.name().equals(e.getActionCommand())) {
DesktopUtil.browse(LookupLinks.EVEMARKETER.getLinks(menuData), program);
} else if (MenuLookupAction.ADAM4EVE.name().equals(e.getActionCommand())) {
DesktopUtil.browse(LookupLinks.ADAM4EVE.getLinks(menuData), program);
} else if (MenuLookupAction.FUZZWORK_MARKET.name().equals(e.getActionCommand())) {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ public void testLookup() {
menuData.getInventionTypeIDs().add(10679);
List<Lookup> lookups = new ArrayList<>();
for (LookupLinks lookupLinks : LookupLinks.values()) {
if (lookupLinks == LookupLinks.ZKILLBOARD_ITEM
|| lookupLinks == LookupLinks.ZKILLBOARD_SYSTEM
|| lookupLinks == LookupLinks.ZKILLBOARD_CONSTELLATION
|| lookupLinks == LookupLinks.ZKILLBOARD_REGION ) {
continue; //Protected by cloudflare
}
Set<String> links = lookupLinks.getLinks(menuData);
assertNotNull(lookupLinks.name() + " is null", links);
assertFalse(lookupLinks.name() + " is empty", links.isEmpty());
Expand All @@ -79,7 +85,7 @@ private static class Lookup extends Thread {

private final LookupLinks lookupLinks;
private final String link;
private int code = 0;
private int code = -1;

public Lookup(LookupLinks lookupLinks, String link) {
this.lookupLinks = lookupLinks;
Expand Down

0 comments on commit a8768d2

Please sign in to comment.