mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-02-27 21:31:33 +01:00
➕ Normal filter button in main menu can now change icons depending on the item category
Took 34 seconds
This commit is contained in:
parent
7cf21d2758
commit
7c2f6e4ca9
@ -80,6 +80,36 @@ public enum AuctionItemCategory {
|
|||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getFilterIcon() {
|
||||||
|
switch (this) {
|
||||||
|
case ALL:
|
||||||
|
return Settings.FILTERS_ALL_ICON.getString();
|
||||||
|
case FOOD:
|
||||||
|
return Settings.FILTERS_FOOD_ICON.getString();
|
||||||
|
case ARMOR:
|
||||||
|
return Settings.FILTERS_ARMOR_ICON.getString();
|
||||||
|
case BLOCKS:
|
||||||
|
return Settings.FILTERS_BLOCKS_ICON.getString();
|
||||||
|
case TOOLS:
|
||||||
|
return Settings.FILTERS_TOOLS_ICON.getString();
|
||||||
|
case MISC:
|
||||||
|
return Settings.FILTERS_MISC_ICON.getString();
|
||||||
|
case ENCHANTS:
|
||||||
|
return Settings.FILTERS_ENCHANTS_ICON.getString();
|
||||||
|
case SPAWNERS:
|
||||||
|
return Settings.FILTERS_SPAWNERS_ICON.getString();
|
||||||
|
case WEAPONS:
|
||||||
|
return Settings.FILTERS_WEAPONS_ICON.getString();
|
||||||
|
case POTIONS:
|
||||||
|
return Settings.FILTERS_POTIONS_ICON.getString();
|
||||||
|
case SELF:
|
||||||
|
return Settings.FILTERS_SELF_ICON.getString();
|
||||||
|
case SEARCH:
|
||||||
|
return Settings.FILTERS_SEARCH_ICON.getString();
|
||||||
|
}
|
||||||
|
return Settings.FILTERS_ALL_ICON.getString();
|
||||||
|
}
|
||||||
|
|
||||||
public String getTranslatedType() {
|
public String getTranslatedType() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case ALL:
|
case ALL:
|
||||||
|
@ -24,6 +24,7 @@ import ca.tweetzy.auctionhouse.auction.*;
|
|||||||
import ca.tweetzy.auctionhouse.auction.enums.*;
|
import ca.tweetzy.auctionhouse.auction.enums.*;
|
||||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||||
import ca.tweetzy.auctionhouse.transaction.Transaction;
|
import ca.tweetzy.auctionhouse.transaction.Transaction;
|
||||||
|
import ca.tweetzy.auctionhouse.transaction.TransactionViewFilter;
|
||||||
import ca.tweetzy.core.database.DataManagerAbstract;
|
import ca.tweetzy.core.database.DataManagerAbstract;
|
||||||
import ca.tweetzy.core.database.DatabaseConnector;
|
import ca.tweetzy.core.database.DatabaseConnector;
|
||||||
import ca.tweetzy.core.database.MySQLConnector;
|
import ca.tweetzy.core.database.MySQLConnector;
|
||||||
@ -696,6 +697,7 @@ public class DataManager extends DataManagerAbstract {
|
|||||||
AuctionSaleType.BOTH,
|
AuctionSaleType.BOTH,
|
||||||
AuctionItemCategory.ALL,
|
AuctionItemCategory.ALL,
|
||||||
AuctionSortType.RECENT,
|
AuctionSortType.RECENT,
|
||||||
|
TransactionViewFilter.ALL,
|
||||||
true,
|
true,
|
||||||
resultSet.getLong("last_listed_item"),
|
resultSet.getLong("last_listed_item"),
|
||||||
null,
|
null,
|
||||||
|
@ -699,16 +699,22 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_ENABLED.getBoolean()) {
|
if (Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_ENABLED.getBoolean()) {
|
||||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_LORE.getStringList(), new HashMap<String, Object>() {{
|
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(
|
||||||
put("%filter_category%", auctionPlayer.getSelectedFilter().getTranslatedType());
|
this.player,
|
||||||
put("%filter_auction_type%", auctionPlayer.getSelectedSaleType().getTranslatedType());
|
this.auctionPlayer.getSelectedFilter().getFilterIcon(),
|
||||||
put("%filter_sort_order%", auctionPlayer.getAuctionSortType().getTranslatedType());
|
Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_NAME.getString(),
|
||||||
}}), e -> {
|
Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_LORE.getStringList(),
|
||||||
|
new HashMap<String, Object>() {{
|
||||||
|
put("%filter_category%", auctionPlayer.getSelectedFilter().getTranslatedType());
|
||||||
|
put("%filter_auction_type%", auctionPlayer.getSelectedSaleType().getTranslatedType());
|
||||||
|
put("%filter_sort_order%", auctionPlayer.getAuctionSortType().getTranslatedType());
|
||||||
|
}}), e -> {
|
||||||
|
|
||||||
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_CATEGORY.getString().toUpperCase())) {
|
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_CATEGORY.getString().toUpperCase())) {
|
||||||
this.auctionPlayer.setSelectedFilter(this.auctionPlayer.getSelectedFilter().next());
|
this.auctionPlayer.setSelectedFilter(this.auctionPlayer.getSelectedFilter().next());
|
||||||
updatePlayerFilter(this.auctionPlayer);
|
updatePlayerFilter(this.auctionPlayer);
|
||||||
draw();
|
draw();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_RESET.getString().toUpperCase())) {
|
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_RESET.getString().toUpperCase())) {
|
||||||
|
@ -184,6 +184,22 @@ public class Settings {
|
|||||||
public static final ConfigSetting TAX_SALES_TAX_BUY_NOW_PERCENTAGE = new ConfigSetting(config, "auction setting.tax.buy now sales tax", 15.0, "Tax % that should be charged on items that are bought immediately");
|
public static final ConfigSetting TAX_SALES_TAX_BUY_NOW_PERCENTAGE = new ConfigSetting(config, "auction setting.tax.buy now sales tax", 15.0, "Tax % that should be charged on items that are bought immediately");
|
||||||
public static final ConfigSetting TAX_SALES_TAX_AUCTION_WON_PERCENTAGE = new ConfigSetting(config, "auction setting.tax.auction won sales tax", 10.0, "Tax % that should be charged on items that are won through the auction");
|
public static final ConfigSetting TAX_SALES_TAX_AUCTION_WON_PERCENTAGE = new ConfigSetting(config, "auction setting.tax.auction won sales tax", 10.0, "Tax % that should be charged on items that are won through the auction");
|
||||||
|
|
||||||
|
|
||||||
|
public static final ConfigSetting FILTERS_ALL_ICON = new ConfigSetting(config, "auction setting.filter icons.all", "HOPPER");
|
||||||
|
public static final ConfigSetting FILTERS_FOOD_ICON = new ConfigSetting(config, "auction setting.filter icons.food", "APPLE");
|
||||||
|
public static final ConfigSetting FILTERS_ARMOR_ICON = new ConfigSetting(config, "auction setting.filter icons.armor", "DIAMOND_HELMET");
|
||||||
|
public static final ConfigSetting FILTERS_BLOCKS_ICON = new ConfigSetting(config, "auction setting.filter icons.blocks", "GRASS_BLOCK");
|
||||||
|
public static final ConfigSetting FILTERS_TOOLS_ICON = new ConfigSetting(config, "auction setting.filter icons.tools", "STONE_SHOVEL");
|
||||||
|
public static final ConfigSetting FILTERS_WEAPONS_ICON = new ConfigSetting(config, "auction setting.filter icons.weapons", "IRON_SWORD");
|
||||||
|
public static final ConfigSetting FILTERS_SPAWNERS_ICON = new ConfigSetting(config, "auction setting.filter icons.spawners", "SPAWNER");
|
||||||
|
public static final ConfigSetting FILTERS_ENCHANTS_ICON = new ConfigSetting(config, "auction setting.filter icons.enchants", "ENCHANTED_BOOK");
|
||||||
|
public static final ConfigSetting FILTERS_POTIONS_ICON = new ConfigSetting(config, "auction setting.filter icons.potions", "POTION");
|
||||||
|
public static final ConfigSetting FILTERS_MISC_ICON = new ConfigSetting(config, "auction setting.filter icons.misc", "OAK_SIGN");
|
||||||
|
public static final ConfigSetting FILTERS_SELF_ICON = new ConfigSetting(config, "auction setting.filter icons.self", "NAME_TAG");
|
||||||
|
public static final ConfigSetting FILTERS_SEARCH_ICON = new ConfigSetting(config, "auction setting.filter icons.search", "COMPASS");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static final ConfigSetting ALL_FILTER_ENABLED = new ConfigSetting(config, "auction setting.enabled filters.all", true, "Should this filter be enabled?");
|
public static final ConfigSetting ALL_FILTER_ENABLED = new ConfigSetting(config, "auction setting.enabled filters.all", true, "Should this filter be enabled?");
|
||||||
public static final ConfigSetting FOOD_FILTER_ENABLED = new ConfigSetting(config, "auction setting.enabled filters.food", true, "Should this filter be enabled?");
|
public static final ConfigSetting FOOD_FILTER_ENABLED = new ConfigSetting(config, "auction setting.enabled filters.food", true, "Should this filter be enabled?");
|
||||||
public static final ConfigSetting ARMOR_FILTER_ENABLED = new ConfigSetting(config, "auction setting.enabled filters.armor", true, "Should this filter be enabled?");
|
public static final ConfigSetting ARMOR_FILTER_ENABLED = new ConfigSetting(config, "auction setting.enabled filters.armor", true, "Should this filter be enabled?");
|
||||||
@ -298,6 +314,18 @@ public class Settings {
|
|||||||
"&cIf you overlap click types (ex. LEFT for both inspect and buy) things will go crazy."
|
"&cIf you overlap click types (ex. LEFT for both inspect and buy) things will go crazy."
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public static final ConfigSetting CLICKS_FILTER_TRANSACTION_BUY_TYPE = new ConfigSetting(config, "auction setting.clicks.filter.transaction buy type", "SHIFT_LEFT",
|
||||||
|
"Valid Click Types",
|
||||||
|
"LEFT",
|
||||||
|
"RIGHT",
|
||||||
|
"SHIFT_LEFT",
|
||||||
|
"SHIFT_RIGHT",
|
||||||
|
"MIDDLE",
|
||||||
|
"DROP",
|
||||||
|
"",
|
||||||
|
"&cIf you overlap click types (ex. LEFT for both inspect and buy) things will go crazy."
|
||||||
|
);
|
||||||
|
|
||||||
public static final ConfigSetting CLICKS_FILTER_RESET = new ConfigSetting(config, "auction setting.clicks.filter.reset", "DROP",
|
public static final ConfigSetting CLICKS_FILTER_RESET = new ConfigSetting(config, "auction setting.clicks.filter.reset", "DROP",
|
||||||
"Valid Click Types",
|
"Valid Click Types",
|
||||||
"LEFT",
|
"LEFT",
|
||||||
@ -793,11 +821,13 @@ public class Settings {
|
|||||||
public static final ConfigSetting GUI_TRANSACTIONS_ITEMS_FILTER_LORE = new ConfigSetting(config, "gui.transactions.items.filter.lore", Arrays.asList(
|
public static final ConfigSetting GUI_TRANSACTIONS_ITEMS_FILTER_LORE = new ConfigSetting(config, "gui.transactions.items.filter.lore", Arrays.asList(
|
||||||
"&eItem Category&f: &7%filter_category%",
|
"&eItem Category&f: &7%filter_category%",
|
||||||
"&eAuction Type&f: &7%filter_auction_type%",
|
"&eAuction Type&f: &7%filter_auction_type%",
|
||||||
|
"&eTransaction Type&f: &7%filter_buy_type%",
|
||||||
"&eSort Order&f: &7%filter_sort_order%",
|
"&eSort Order&f: &7%filter_sort_order%",
|
||||||
"",
|
"",
|
||||||
"&7Left-Click to change item category",
|
"&7Left-Click to change item category",
|
||||||
"&7Right-Click to change change auction type",
|
"&7Right-Click to change change auction type",
|
||||||
"&7Shift Right-Click to change sort order",
|
"&7Shift Right-Click to change sort order",
|
||||||
|
"&7Shift Left-Click to change buy type",
|
||||||
"&7Press Drop to reset filters"
|
"&7Press Drop to reset filters"
|
||||||
));
|
));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user