mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-29 22:13:22 +01:00
Add Single GUI enabling button in Settings GUI.
This commit is contained in:
parent
c737c874da
commit
6bf439cef6
@ -78,9 +78,16 @@ public class EditSettingsGUI extends CommonGUI
|
||||
panelBuilder.item(20, this.getSettingsButton(Button.GLOW_COMPLETED));
|
||||
panelBuilder.item(29, this.getSettingsButton(Button.REMOVE_COMPLETED));
|
||||
|
||||
panelBuilder.item(12, this.getSettingsButton(Button.LOCKED_LEVEL_ICON));
|
||||
panelBuilder.item(21, this.getSettingsButton(Button.FREE_AT_TOP));
|
||||
panelBuilder.item(30, this.getSettingsButton(Button.GAMEMODE_GUI));
|
||||
panelBuilder.item(21, this.getSettingsButton(Button.LOCKED_LEVEL_ICON));
|
||||
panelBuilder.item(30, this.getSettingsButton(Button.FREE_AT_TOP));
|
||||
|
||||
panelBuilder.item(22, this.getSettingsButton(Button.GAMEMODE_GUI));
|
||||
|
||||
if (this.settings.isUseCommonGUI())
|
||||
{
|
||||
// This should be active only when single gui is enabled.
|
||||
panelBuilder.item(31, this.getSettingsButton(Button.GAMEMODE_GUI_VIEW_MODE));
|
||||
}
|
||||
|
||||
panelBuilder.item(14, this.getSettingsButton(Button.LORE_LENGTH));
|
||||
panelBuilder.item(23, this.getSettingsButton(Button.CHALLENGE_LORE));
|
||||
@ -294,7 +301,7 @@ public class EditSettingsGUI extends CommonGUI
|
||||
glow = this.settings.isAddCompletedGlow();
|
||||
break;
|
||||
}
|
||||
case GAMEMODE_GUI:
|
||||
case GAMEMODE_GUI_VIEW_MODE:
|
||||
{
|
||||
description = new ArrayList<>(2);
|
||||
description.add(this.user.getTranslation("challenges.gui.descriptions.admin.gui-view-mode"));
|
||||
@ -322,6 +329,27 @@ public class EditSettingsGUI extends CommonGUI
|
||||
glow = this.settings.getUserGuiMode().equals(Settings.GuiMode.GAMEMODE_LIST);
|
||||
break;
|
||||
}
|
||||
case GAMEMODE_GUI:
|
||||
{
|
||||
description = new ArrayList<>(2);
|
||||
description.add(this.user.getTranslation("challenges.gui.descriptions.admin.gui-mode"));
|
||||
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
||||
"[value]",
|
||||
this.settings.isUseCommonGUI() ?
|
||||
this.user.getTranslation("challenges.gui.descriptions.enabled") :
|
||||
this.user.getTranslation("challenges.gui.descriptions.disabled")));
|
||||
name = this.user.getTranslation("challenges.gui.buttons.admin.gui-mode");
|
||||
icon = new ItemStack(Material.BLACK_STAINED_GLASS_PANE);
|
||||
clickHandler = (panel, user1, clickType, i) -> {
|
||||
this.settings.setUseCommonGUI(!this.settings.isUseCommonGUI());
|
||||
// We cannot use single item changing as this option enabling/disabling will change other
|
||||
// option visibility.
|
||||
this.build();
|
||||
return true;
|
||||
};
|
||||
glow = this.settings.isUseCommonGUI();
|
||||
break;
|
||||
}
|
||||
case HISTORY:
|
||||
{
|
||||
description = new ArrayList<>(2);
|
||||
@ -446,6 +474,7 @@ public class EditSettingsGUI extends CommonGUI
|
||||
LEVEL_LORE,
|
||||
CHALLENGE_LORE,
|
||||
FREE_AT_TOP,
|
||||
GAMEMODE_GUI_VIEW_MODE,
|
||||
GAMEMODE_GUI,
|
||||
HISTORY,
|
||||
PURGE_HISTORY,
|
||||
|
@ -138,6 +138,7 @@ challenges:
|
||||
level-lore: 'Level Description'
|
||||
challenge-lore: 'Challenge Description'
|
||||
gui-view-mode: 'Display All GameModes'
|
||||
gui-mode: 'Single Challenges GUI'
|
||||
history-store: 'Challenges History'
|
||||
history-lifespan: 'History LifeSpan'
|
||||
island-store: 'Store per Island'
|
||||
@ -230,6 +231,7 @@ challenges:
|
||||
history-lifespan: 'Allows to modify how many days history data will be saved.|0 means forever.'
|
||||
island-store: 'Allows to enable/disable challenges data string per island. This means that challenges will be the same on whole team, if this is enabled.|Will NOT convert data on click. PROGRESS WILL BE LOST.'
|
||||
default-locked-icon: 'Allows to change default locked level icon.|This option can be overwritten by each level.'
|
||||
gui-mode: 'Allows to enable/disable single challenges GUI.|&2Requires server restart.'
|
||||
current-value: '|&6Current value: [value].'
|
||||
enabled: 'Active'
|
||||
disabled: 'Disabled'
|
||||
|
Loading…
Reference in New Issue
Block a user