added refresh option on filter change

This commit is contained in:
Kiran Hart 2021-03-22 18:48:50 -04:00
parent 3ff2d4c9e1
commit 1c4e29e725
2 changed files with 11 additions and 2 deletions

View File

@ -86,11 +86,19 @@ public class GUIAuctionHouse extends Gui {
switch (e.clickType) {
case LEFT:
this.filterCategory = this.filterCategory.next();
draw();
if (Settings.REFRESH_GUI_ON_FILTER_CHANGE.getBoolean()) {
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
} else {
draw();
}
break;
case RIGHT:
this.filterAuctionType = this.filterAuctionType.next();
draw();
if (Settings.REFRESH_GUI_ON_FILTER_CHANGE.getBoolean()){
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
} else {
draw();
}
break;
}
});

View File

@ -37,6 +37,7 @@ public class Settings {
public static final ConfigSetting TIME_TO_INCREASE_BY_ON_BID = new ConfigSetting(config, "auction setting.time to increase by on the bid", 20, "How many seconds should be added to the remaining time?");
public static final ConfigSetting TICK_UPDATE_TIME = new ConfigSetting(config, "auction setting.tick auctions every", 1, "How many seconds should pass before the plugin updates all the times on items?");
public static final ConfigSetting REFRESH_GUI_WHEN_BID = new ConfigSetting(config, "auction setting.refresh gui when bid", true, "Should the auction gui be re-opened (not redrawn) when a user places a bid, so they get the latest items?");
public static final ConfigSetting REFRESH_GUI_ON_FILTER_CHANGE = new ConfigSetting(config, "auction setting.refresh gui when filter changed", false, "Should the gui refresh when the player changes the filter mode?");
public static final ConfigSetting RECORD_TRANSACTIONS = new ConfigSetting(config, "auction setting.record transactions", true, "Should every transaction be recorded (everything an auction is won or an item is bought)");
/* ===============================