diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-08-24 13:48:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-24 13:48:53 +0200 |
| commit | c3845685bbb3a2a7fde25476eed0f788e038dc93 (patch) | |
| tree | f0569ff00274a3b419e3a5da3742baabce8622be /src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java | |
| parent | b97dd13100f36dc64560067c707081af5bc8ff0c (diff) | |
| download | notenoughupdates-c3845685bbb3a2a7fde25476eed0f788e038dc93.tar.gz notenoughupdates-c3845685bbb3a2a7fde25476eed0f788e038dc93.tar.bz2 notenoughupdates-c3845685bbb3a2a7fde25476eed0f788e038dc93.zip | |
Neuah save search (#243)
* saving the last search in neuah
* default enabled
* saving jani's desk
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java b/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java index f0ef1ec6..7b4542d0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java @@ -133,6 +133,8 @@ public class CustomAH extends Gui { public int guiLeft = -1; public int guiTop = -1; + private String lastSearch = ""; + private final Category CATEGORY_SWORD = new Category("sword", "Swords", "diamond_sword"); private final Category CATEGORY_ARMOR = new Category("armor", "Armor", "diamond_chestplate"); private final Category CATEGORY_BOWS = new Category("bow", "Bows", "bow"); @@ -275,7 +277,11 @@ public class CustomAH extends Gui { } public void setSearch(String search) { - searchField.setText(search); + if (search == null) { + searchField.setText(lastSearch); + } else { + searchField.setText(search); + } updateSearch(); } @@ -1487,8 +1493,15 @@ public class CustomAH extends Gui { auctionIdsNew.add(entry.getKey()); } } + if (NotEnoughUpdates.INSTANCE.config.neuAuctionHouse.saveLastSearch) { + lastSearch = ""; + } } else { String query = searchField.getText(); + + if (NotEnoughUpdates.INSTANCE.config.neuAuctionHouse.saveLastSearch) { + lastSearch = query; + } Set<String> dontMatch = new HashSet<>(); HashSet<String> allMatch = new HashSet<>(); |
