feat: unavailable option display
This commit is contained in:
parent
8dfdbd4db3
commit
cd03732aaa
2 changed files with 28 additions and 3 deletions
|
@ -5,10 +5,10 @@ import de.studiocode.invui.gui.builder.GUIBuilder;
|
||||||
import de.studiocode.invui.gui.builder.guitype.GUIType;
|
import de.studiocode.invui.gui.builder.guitype.GUIType;
|
||||||
import de.studiocode.invui.window.impl.single.SimpleWindow;
|
import de.studiocode.invui.window.impl.single.SimpleWindow;
|
||||||
import net.artelnatif.nicko.NickoBukkit;
|
import net.artelnatif.nicko.NickoBukkit;
|
||||||
import net.artelnatif.nicko.gui.MainGUI;
|
|
||||||
import net.artelnatif.nicko.gui.items.common.GoBack;
|
import net.artelnatif.nicko.gui.items.common.GoBack;
|
||||||
import net.artelnatif.nicko.gui.items.settings.BungeeCordCycling;
|
import net.artelnatif.nicko.gui.items.settings.BungeeCordCycling;
|
||||||
import net.artelnatif.nicko.gui.items.settings.LanguageCycling;
|
import net.artelnatif.nicko.gui.items.settings.LanguageCycling;
|
||||||
|
import net.artelnatif.nicko.gui.items.settings.OptionUnavailable;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class SettingsGUI {
|
public class SettingsGUI {
|
||||||
|
@ -18,12 +18,12 @@ public class SettingsGUI {
|
||||||
public SettingsGUI(Player player) {
|
public SettingsGUI(Player player) {
|
||||||
final String[] dynamicStructure = new String[]{
|
final String[] dynamicStructure = new String[]{
|
||||||
"# # # # # # # # #",
|
"# # # # # # # # #",
|
||||||
"# % % L # T % % #",
|
"# % % L U T % % #",
|
||||||
"B # # # # # # # #"
|
"B # # # # # # # #"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!NickoBukkit.getInstance().getNickoConfig().isBungeecordSupport()) {
|
if (!NickoBukkit.getInstance().getNickoConfig().isBungeecordSupport()) {
|
||||||
dynamicStructure[1] = dynamicStructure[1].replace("T", "#");
|
dynamicStructure[1] = dynamicStructure[1].replace("T", "U");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gui = new GUIBuilder<>(GUIType.NORMAL)
|
this.gui = new GUIBuilder<>(GUIType.NORMAL)
|
||||||
|
@ -31,6 +31,7 @@ public class SettingsGUI {
|
||||||
.addIngredient('B', new GoBack(new MainGUI(player).getGUI()))
|
.addIngredient('B', new GoBack(new MainGUI(player).getGUI()))
|
||||||
.addIngredient('L', new LanguageCycling().get(player))
|
.addIngredient('L', new LanguageCycling().get(player))
|
||||||
.addIngredient('T', new BungeeCordCycling().get(player))
|
.addIngredient('T', new BungeeCordCycling().get(player))
|
||||||
|
.addIngredient('U', new OptionUnavailable())
|
||||||
.build();
|
.build();
|
||||||
this.player = player;
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package net.artelnatif.nicko.gui.items.settings;
|
||||||
|
|
||||||
|
import de.studiocode.invui.item.ItemProvider;
|
||||||
|
import de.studiocode.invui.item.builder.ItemBuilder;
|
||||||
|
import de.studiocode.invui.item.impl.BaseItem;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
public class OptionUnavailable extends BaseItem {
|
||||||
|
@Override
|
||||||
|
public ItemProvider getItemProvider() {
|
||||||
|
final ItemBuilder builder = new ItemBuilder(Material.RED_TERRACOTTA);
|
||||||
|
builder.setDisplayName("§cOption unavailable :(");
|
||||||
|
builder.addLoreLines("§7This option is disabled due to the",
|
||||||
|
"§7feature it controls being disabled.");
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleClick(@NotNull ClickType clickType, @NotNull Player player, @NotNull InventoryClickEvent inventoryClickEvent) { }
|
||||||
|
}
|
Loading…
Reference in a new issue