Skip to content

Commit

Permalink
feat: hide reset kdr in main frame if perm denied
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomut0 committed Jul 23, 2023
1 parent 8269d80 commit 1a9193a
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,24 @@ private void addLanguageSelector() {
}

public void addResetKdr() {
List<String> resetKrLore;
if (!plugin.getPermissionsManager().has(getViewer(), "simpleclans.vip.resetkdr")) {
return;
}

List<String> resetKdrLore;
if (plugin.getSettingsManager().is(ECONOMY_PURCHASE_RESET_KDR)) {
resetKrLore = Arrays.asList(
resetKdrLore = Arrays.asList(
lang("gui.main.reset.kdr.lore.price", getViewer(), plugin.getSettingsManager().getString(ECONOMY_RESET_KDR_PRICE)),
lang("gui.main.reset.kdr.lore", getViewer()));
} else {
resetKrLore = Collections.singletonList(lang("gui.main.reset.kdr.lore", getViewer()));
resetKdrLore = Collections.singletonList(lang("gui.main.reset.kdr.lore", getViewer()));
}
SCComponent resetKdr = new SCComponentImpl(lang("gui.main.reset.kdr.title", getViewer()),
resetKrLore, XMaterial.ANVIL, 5);
resetKdrLore, XMaterial.ANVIL, 5);
resetKdr.setListener(ClickType.LEFT, () -> InventoryController.runSubcommand(getViewer(), "resetkdr", false));
resetKdr.setConfirmationRequired(ClickType.LEFT);
resetKdr.setPermission(ClickType.LEFT, "simpleclans.vip.resetkdr");

add(resetKdr);
}

Expand Down

0 comments on commit 1a9193a

Please sign in to comment.