🗃️ added default filter options, closes #83

Took 9 minutes
This commit is contained in:
Kiran Hart 2024-01-23 15:01:35 -05:00
parent cc5d8e934a
commit 8ee91ecf76
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
2 changed files with 29 additions and 7 deletions

View File

@ -69,7 +69,23 @@ public class AuctionPlayer {
private long endAllRequestTime; private long endAllRequestTime;
public AuctionPlayer(UUID uuid) { public AuctionPlayer(UUID uuid) {
this(uuid, Bukkit.getPlayer(uuid), AuctionSaleType.BOTH, AuctionItemCategory.ALL, AuctionSortType.RECENT, "", AuctionSaleType.BOTH, AuctionItemCategory.ALL, AuctionSortType.RECENT, TransactionViewFilter.ALL, true, -1, null, -1, -1); this(
uuid,
Bukkit.getPlayer(uuid),
Enum.valueOf(AuctionSaleType.class, Settings.DEFAULT_FILTER_SALE_TYPE.getString()),
Enum.valueOf(AuctionItemCategory.class, Settings.DEFAULT_FILTER_CATEGORY.getString()),
Enum.valueOf(AuctionSortType.class, Settings.DEFAULT_FILTER_SORT.getString()),
"",
Enum.valueOf(AuctionSaleType.class, Settings.DEFAULT_FILTER_SALE_TYPE.getString()),
Enum.valueOf(AuctionItemCategory.class, Settings.DEFAULT_FILTER_CATEGORY.getString()),
Enum.valueOf(AuctionSortType.class, Settings.DEFAULT_FILTER_SORT.getString()),
TransactionViewFilter.ALL,
true,
-1,
null,
-1,
-1
);
} }
public AuctionPlayer(Player player) { public AuctionPlayer(Player player) {
@ -131,16 +147,16 @@ public class AuctionPlayer {
} }
public void resetFilter() { public void resetFilter() {
this.selectedFilter = AuctionItemCategory.ALL; this.selectedFilter = Enum.valueOf(AuctionItemCategory.class, Settings.DEFAULT_FILTER_CATEGORY.getString());
this.auctionSortType = AuctionSortType.RECENT; this.auctionSortType = Enum.valueOf(AuctionSortType.class, Settings.DEFAULT_FILTER_SORT.getString());
this.selectedSaleType = AuctionSaleType.BOTH; this.selectedSaleType = Enum.valueOf(AuctionSaleType.class, Settings.DEFAULT_FILTER_SALE_TYPE.getString());
this.currentSearchPhrase = ""; this.currentSearchPhrase = "";
} }
public void resetTransactionFilter() { public void resetTransactionFilter() {
this.selectedTransactionFilter = AuctionItemCategory.ALL; this.selectedTransactionFilter = Enum.valueOf(AuctionItemCategory.class, Settings.DEFAULT_FILTER_CATEGORY.getString());
this.transactionSortType = AuctionSortType.RECENT; this.transactionSortType = Enum.valueOf(AuctionSortType.class, Settings.DEFAULT_FILTER_SORT.getString());
this.selectedTransactionSaleType = AuctionSaleType.BOTH; this.selectedTransactionSaleType = Enum.valueOf(AuctionSaleType.class, Settings.DEFAULT_FILTER_SALE_TYPE.getString());
} }

View File

@ -64,6 +64,12 @@ public class Settings {
public static final ConfigSetting DEFAULT_BIN_LISTING_TIME = new ConfigSetting(config, "auction setting.listings times.bin item", 86400, "The default listing time for bin items (buy only items) before they expire"); public static final ConfigSetting DEFAULT_BIN_LISTING_TIME = new ConfigSetting(config, "auction setting.listings times.bin item", 86400, "The default listing time for bin items (buy only items) before they expire");
public static final ConfigSetting DEFAULT_AUCTION_LISTING_TIME = new ConfigSetting(config, "auction setting.listings times.auction item", 604800, "The default listing time for auction items before they expire"); public static final ConfigSetting DEFAULT_AUCTION_LISTING_TIME = new ConfigSetting(config, "auction setting.listings times.auction item", 604800, "The default listing time for auction items before they expire");
public static final ConfigSetting DEFAULT_FILTER_CATEGORY = new ConfigSetting(config, "auction setting.default filters.auction category", "ALL", "Valid Options: ALL, FOOD, ARMOR, BLOCKS, TOOLS, WEAPONS, POTIONS, SPAWNERS, ENCHANTS, MISC, SEARCH, SELF");
public static final ConfigSetting DEFAULT_FILTER_SORT = new ConfigSetting(config, "auction setting.default filters.auction sort", "RECENT", "Valid Options: RECENT, OLDEST, PRICE");
public static final ConfigSetting DEFAULT_FILTER_SALE_TYPE = new ConfigSetting(config, "auction setting.default filters.sale type", "BOTH", "Valid Options: USED_BIDDING_SYSTEM, WITHOUT_BIDDING_SYSTEM, BOTH");
public static final ConfigSetting INTERNAL_CREATE_DELAY = new ConfigSetting(config, "auction setting.internal create delay", 2, "How many ticks should auction house wait before actually creating the item."); public static final ConfigSetting INTERNAL_CREATE_DELAY = new ConfigSetting(config, "auction setting.internal create delay", 2, "How many ticks should auction house wait before actually creating the item.");
public static final ConfigSetting MAX_AUCTION_PRICE = new ConfigSetting(config, "auction setting.pricing.max auction price", 1000000000, "The max price for buy only / buy now items"); public static final ConfigSetting MAX_AUCTION_PRICE = new ConfigSetting(config, "auction setting.pricing.max auction price", 1000000000, "The max price for buy only / buy now items");
public static final ConfigSetting MAX_AUCTION_START_PRICE = new ConfigSetting(config, "auction setting.pricing.max auction start price", 1000000000, "The max price starting a bidding auction"); public static final ConfigSetting MAX_AUCTION_START_PRICE = new ConfigSetting(config, "auction setting.pricing.max auction start price", 1000000000, "The max price starting a bidding auction");