add customization for filter click inputs, closes #17

Took 8 minutes
This commit is contained in:
Kiran Hart 2022-11-16 20:27:18 -05:00
parent f3fa5bb396
commit cbe6d43664
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
2 changed files with 98 additions and 40 deletions

View File

@ -571,27 +571,31 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
if (Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_ENABLED.getBoolean()) {
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_SLOT.getInt(), item, e -> {
switch (e.clickType) {
case LEFT:
e.manager.showGUI(e.player, new GUIFilterSelection(this.auctionPlayer));
break;
case DROP:
this.auctionPlayer.resetFilter();
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_CATEGORY.getString().toUpperCase())) {
e.manager.showGUI(e.player, new GUIFilterSelection(this.auctionPlayer));
return;
}
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_RESET.getString().toUpperCase())) {
this.auctionPlayer.resetFilter();
updatePlayerFilter(this.auctionPlayer);
draw();
return;
}
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_SORT_SALE_TYPE.getString().toUpperCase())) {
if (Settings.ALLOW_USAGE_OF_BID_SYSTEM.getBoolean()) {
this.auctionPlayer.setSelectedSaleType(this.auctionPlayer.getSelectedSaleType().next());
updatePlayerFilter(this.auctionPlayer);
draw();
break;
case RIGHT:
if (Settings.ALLOW_USAGE_OF_BID_SYSTEM.getBoolean()) {
this.auctionPlayer.setSelectedSaleType(this.auctionPlayer.getSelectedSaleType().next());
updatePlayerFilter(this.auctionPlayer);
draw();
}
break;
case SHIFT_RIGHT:
this.auctionPlayer.setAuctionSortType(this.auctionPlayer.getAuctionSortType().next());
updatePlayerFilter(this.auctionPlayer);
draw();
break;
}
return;
}
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_SORT_PRICE_OR_RECENT.getString().toUpperCase())) {
this.auctionPlayer.setAuctionSortType(this.auctionPlayer.getAuctionSortType().next());
updatePlayerFilter(this.auctionPlayer);
draw();
}
});
}
@ -604,29 +608,33 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
put("%filter_auction_type%", auctionPlayer.getSelectedSaleType().getTranslatedType());
put("%filter_sort_order%", auctionPlayer.getAuctionSortType().getTranslatedType());
}}), e -> {
switch (e.clickType) {
case DROP:
this.auctionPlayer.resetFilter();
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_CATEGORY.getString().toUpperCase())) {
this.auctionPlayer.setSelectedFilter(this.auctionPlayer.getSelectedFilter().next());
updatePlayerFilter(this.auctionPlayer);
draw();
}
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_RESET.getString().toUpperCase())) {
this.auctionPlayer.resetFilter();
updatePlayerFilter(this.auctionPlayer);
draw();
return;
}
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_SORT_SALE_TYPE.getString().toUpperCase())) {
if (Settings.ALLOW_USAGE_OF_BID_SYSTEM.getBoolean()) {
this.auctionPlayer.setSelectedSaleType(this.auctionPlayer.getSelectedSaleType().next());
updatePlayerFilter(this.auctionPlayer);
draw();
break;
case LEFT:
this.auctionPlayer.setSelectedFilter(this.auctionPlayer.getSelectedFilter().next());
updatePlayerFilter(this.auctionPlayer);
draw();
break;
case RIGHT:
if (Settings.ALLOW_USAGE_OF_BID_SYSTEM.getBoolean()) {
this.auctionPlayer.setSelectedSaleType(this.auctionPlayer.getSelectedSaleType().next());
updatePlayerFilter(this.auctionPlayer);
draw();
}
break;
case SHIFT_RIGHT:
this.auctionPlayer.setAuctionSortType(this.auctionPlayer.getAuctionSortType().next());
updatePlayerFilter(this.auctionPlayer);
draw();
break;
}
return;
}
if (e.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_SORT_PRICE_OR_RECENT.getString().toUpperCase())) {
this.auctionPlayer.setAuctionSortType(this.auctionPlayer.getAuctionSortType().next());
updatePlayerFilter(this.auctionPlayer);
draw();
}
});
}

View File

@ -237,6 +237,56 @@ public class Settings {
"&cIf you overlap click types (ex. LEFT for both inspect and buy) things will go crazy."
);
public static final ConfigSetting CLICKS_FILTER_SORT_PRICE_OR_RECENT = new ConfigSetting(config, "auction setting.clicks.filter.sort by price or recent", "SHIFT_RIGHT",
"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_SORT_SALE_TYPE = new ConfigSetting(config, "auction setting.clicks.filter.sort sale type", "RIGHT",
"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",
"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_CATEGORY= new ConfigSetting(config, "auction setting.clicks.filter.change category", "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."
);
/* ===============================
* DATABASE OPTIONS
* ===============================*/