Skip to content

Commit

Permalink
Fixes CalendarFrame not switching to previous month
Browse files Browse the repository at this point in the history
Fixes wrong name on Calendar button
Fixes IllegalState for closing inv async
  • Loading branch information
RoinujNosde committed May 21, 2021
1 parent 3e7bc05 commit d48e1ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void nextMonth() {
*/
public void previousMonth() {
period = period.minusMonths(1);
InventoryDrawer.getInstance().open(this);
}

private void addPanels() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private Component update() {

@NotNull
private Component calendar() {
ComponentImpl calendar = new ComponentImpl(configuration.getCalendarMenuBackButtonName(), null, FILLED_MAP, 25);
ComponentImpl calendar = new ComponentImpl(configuration.getButtonCalendarName(), null, FILLED_MAP, 25);
calendar.setPermission(ClickType.LEFT, "cryptomarket.calendar");
calendar.setListener(ClickType.LEFT, () ->
InventoryDrawer.getInstance().open(new CalendarFrame(this, getViewer())));
Expand Down Expand Up @@ -153,13 +153,14 @@ private Component coins() {
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
coins.setItemMeta(meta);

getViewer().closeInventory();
coins.setPermission(ClickType.RIGHT, "cryptomarket.negotiate");
coins.setListener(ClickType.RIGHT, () -> {
getViewer().closeInventory();
new NegotiationConversation(plugin, Negotiation.PURCHASE, getViewer()).start();
});
coins.setPermission(ClickType.LEFT, "cryptomarket.negotiate");
coins.setListener(ClickType.LEFT, () -> {
getViewer().closeInventory();
new NegotiationConversation(plugin, Negotiation.SELL, getViewer()).start();
});

Expand Down

0 comments on commit d48e1ee

Please sign in to comment.