style: gui adjustements

This commit is contained in:
ineanto 2023-07-01 17:35:46 +02:00
parent de9904df52
commit c6f037a24d
4 changed files with 24 additions and 15 deletions

View file

@ -1,7 +1,5 @@
package xyz.atnrch.nicko; package xyz.atnrch.nicko;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.command.PluginCommand; import org.bukkit.command.PluginCommand;
@ -39,7 +37,6 @@ public class NickoBukkit extends JavaPlugin {
private Configuration configuration; private Configuration configuration;
private LocaleFileManager localeFileManager; private LocaleFileManager localeFileManager;
private PlayerNameStore nameStore; private PlayerNameStore nameStore;
private ProtocolManager protocolManager;
public NickoBukkit() { this.unitTesting = false; } public NickoBukkit() { this.unitTesting = false; }
@ -83,7 +80,6 @@ public class NickoBukkit extends JavaPlugin {
} }
if (!unitTesting) { if (!unitTesting) {
protocolManager = ProtocolLibrary.getProtocolManager();
localeFileManager = new LocaleFileManager(); localeFileManager = new LocaleFileManager();
if (configuration.isCustomLocale()) { if (configuration.isCustomLocale()) {
if (localeFileManager.dumpFromLocale(Locale.ENGLISH)) { if (localeFileManager.dumpFromLocale(Locale.ENGLISH)) {
@ -98,10 +94,8 @@ public class NickoBukkit extends JavaPlugin {
command.setExecutor(new NickoCommand()); command.setExecutor(new NickoCommand());
} }
//new SimpleItem(new ItemBuilder(Material.BLACK_STAINED_GLASS_PANE).setDisplayName(" "))
//new SimpleItem(new ItemBuilder(Material.ORANGE_STAINED_GLASS_PANE).setDisplayName(" "))
Structure.addGlobalIngredient('#', new SimpleItem(new ItemBuilder(Material.AIR))); Structure.addGlobalIngredient('#', new SimpleItem(new ItemBuilder(Material.AIR)));
Structure.addGlobalIngredient('%', new SimpleItem(new ItemBuilder(Material.AIR))); Structure.addGlobalIngredient('%', new SimpleItem(new ItemBuilder(Material.BLACK_STAINED_GLASS_PANE).setDisplayName(" ")));
Structure.addGlobalIngredient('U', new OptionUnavailable()); Structure.addGlobalIngredient('U', new OptionUnavailable());
Structure.addGlobalIngredient('E', new ExitGUI()); Structure.addGlobalIngredient('E', new ExitGUI());

View file

@ -17,7 +17,11 @@ public class CacheManagementGUI {
public CacheManagementGUI(Player player) { public CacheManagementGUI(Player player) {
final AdminGUI parent = new AdminGUI(player); final AdminGUI parent = new AdminGUI(player);
this.gui = Gui.normal() this.gui = Gui.normal()
.setStructure("B # S A D") .setStructure(
"# # # # # # # # #",
"# # # S A D # # #",
"B # # # # # # # #"
)
.addIngredient('B', new GoBack(parent.getGUI(), parent.getTitle())) .addIngredient('B', new GoBack(parent.getGUI(), parent.getTitle()))
.addIngredient('S', new CacheOverview()) .addIngredient('S', new CacheOverview())
.addIngredient('A', new InvalidateCompleteCache()) .addIngredient('A', new InvalidateCompleteCache())

View file

@ -22,7 +22,7 @@ import java.util.stream.Collectors;
public class CacheDetailedGUI { public class CacheDetailedGUI {
public static final String TITLE = "... > Cache > Invalidate"; public static final String TITLE = "... > Cache > Invalidate";
private final Player player; private final Player player;
private final Gui gui; private final Gui gui;
@ -40,12 +40,12 @@ public class CacheDetailedGUI {
final CacheManagementGUI parent = new CacheManagementGUI(player); final CacheManagementGUI parent = new CacheManagementGUI(player);
gui = ScrollGui.items(guiItemBuilder -> { gui = ScrollGui.items(guiItemBuilder -> {
guiItemBuilder.setStructure( guiItemBuilder.setStructure(
"# # # # # # # # #", "x x x x x x x x U",
"# x x x x x x U #", "x x x x x x x x #",
"# x x x x x x # #", "x x x x x x x x #",
"# x x x x x x # #", "x x x x x x x x #",
"# x x x x x x D #", "x x x x x x x x D",
"B # # # # # # # #"); "B % % % % % % % %");
guiItemBuilder.addIngredient('x', Markers.CONTENT_LIST_SLOT_HORIZONTAL); guiItemBuilder.addIngredient('x', Markers.CONTENT_LIST_SLOT_HORIZONTAL);
guiItemBuilder.addIngredient('U', new ScrollUp()); guiItemBuilder.addIngredient('U', new ScrollUp());
guiItemBuilder.addIngredient('D', new ScrollDown()); guiItemBuilder.addIngredient('D', new ScrollDown());

View file

@ -1,6 +1,10 @@
package xyz.atnrch.nicko.gui.items.admin.cache; package xyz.atnrch.nicko.gui.items.admin.cache;
import org.bukkit.Material; 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;
import xyz.xenondevs.invui.item.builder.ItemBuilder; import xyz.xenondevs.invui.item.builder.ItemBuilder;
import xyz.xenondevs.invui.item.builder.SkullBuilder; import xyz.xenondevs.invui.item.builder.SkullBuilder;
import xyz.xenondevs.invui.item.impl.AsyncItem; import xyz.xenondevs.invui.item.impl.AsyncItem;
@ -18,4 +22,11 @@ public class EntryPlaceholder extends AsyncItem {
return skull; return skull;
}); });
} }
@Override
public void handleClick(@NotNull ClickType click, @NotNull Player player, @NotNull InventoryClickEvent event) {
if (click.isLeftClick() || click.isRightClick()) {
event.getView().close();
}
}
} }