diff --git a/src/main/java/world/bentobox/challenges/panel/admin/EditSettingsGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/EditSettingsGUI.java index fb79f70..edb57a9 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/EditSettingsGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/EditSettingsGUI.java @@ -7,6 +7,7 @@ import org.bukkit.World; import java.util.ArrayList; import java.util.List; +import net.wesjd.anvilgui.AnvilGUI; import world.bentobox.bentobox.api.panels.builders.PanelBuilder; import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder; import world.bentobox.bentobox.api.user.User; @@ -179,12 +180,60 @@ public class EditSettingsGUI extends CommonGUI glow(this.addon.getChallengesSettings().isFreeChallengesFirst()). build()); + // Challenge Lore Message + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.challenge-lore")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", this.addon.getChallengesSettings().getChallengeLoreMessage())); + panelBuilder.item(24, new PanelItemBuilder(). + name(this.user.getTranslation("challenges.gui.buttons.admin.challenge-lore")). + description(GuiUtils.stringSplit(description, lineLength)). + icon(Material.PAPER). + clickHandler((panel, user1, clickType, i) -> { + new AnvilGUI(this.addon.getPlugin(), + this.user.getPlayer(), + this.addon.getChallengesSettings().getChallengeLoreMessage(), + (player, reply) -> { + this.addon.getChallengesSettings().setChallengeLoreMessage(reply); + this.build(); + return reply; + }); + + return true; + }). + glow(false). + build()); + + // Level Lore Message + description = new ArrayList<>(2); + description.add(this.user.getTranslation("challenges.gui.descriptions.admin.level-lore")); + description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", + "[value]", this.addon.getChallengesSettings().getLevelLoreMessage())); + panelBuilder.item(33, new PanelItemBuilder(). + name(this.user.getTranslation("challenges.gui.buttons.admin.level-lore")). + description(GuiUtils.stringSplit(description, lineLength)). + icon(Material.PAPER). + clickHandler((panel, user1, clickType, i) -> { + new AnvilGUI(this.addon.getPlugin(), + this.user.getPlayer(), + this.addon.getChallengesSettings().getLevelLoreMessage(), + (player, reply) -> { + this.addon.getChallengesSettings().setLevelLoreMessage(reply); + this.build(); + return reply; + }); + + return true; + }). + glow(false). + build()); + // Lore line length description = new ArrayList<>(2); description.add(this.user.getTranslation("challenges.gui.descriptions.admin.line-length")); description.add(this.user.getTranslation("challenges.gui.descriptions.current-value", "[value]", Integer.toString(this.addon.getChallengesSettings().getLoreLineLength()))); - panelBuilder.item(24, new PanelItemBuilder(). + panelBuilder.item(25, new PanelItemBuilder(). name(this.user.getTranslation("challenges.gui.buttons.admin.line-length")). description(GuiUtils.stringSplit(description, lineLength)). icon(Material.ANVIL). diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index 97c86f6..e73d20e 100755 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -133,6 +133,8 @@ challenges: clear: 'Clear' remove-empty: 'Remove empty' number: '[number]' + level-lore: 'Level Description' + challenge-lore: 'Challenge Description' next: 'Next' previous: 'Previous' return: 'Return' @@ -212,6 +214,8 @@ challenges: selected: 'Selected' remove-selected: 'Remove selected elements.|You can select elements with right mouse button.' show-eggs: 'Switch entity view between Egg mode or Head mode.' + level-lore: 'Allows to modify which elements of level description should be visible.' + challenge-lore: 'Allows to modify which elements of challenge description should be visible.' current-value: '|&6Current value: [value].' enabled: 'Active' disabled: 'Disabled' @@ -301,4 +305,4 @@ challenges: import-no-file: '&cCould not find challenges.yml file to import!' no-load: '&cError: Could not load challenges.yml. [message]' load-error: '&cError: Cannot load [value].' -version: 4 \ No newline at end of file +version: 5 \ No newline at end of file