forked from SteamWar/SteamWar
Toggle particle slots with a click and label entry editor rows
A slot with entries is switched on or off with a click in the particle menu and edited with a shift click; empty slots still open the editor. The entry editor rows get distinct glowing header icons.
This commit is contained in:
@@ -98,11 +98,11 @@ class EntryEditor {
|
||||
ParticleDesign design = entry.getDesign();
|
||||
|
||||
SWInventory inventory = new SWInventory(player, 54, msg("PARTICLE_ENTRY_EDITOR", player, designName(design, player)));
|
||||
header(inventory, ROW_DESIGN, "PARTICLE_SECTION_DESIGN", player);
|
||||
header(inventory, ROW_PARTICLE, "PARTICLE_SECTION_PARTICLE", player);
|
||||
header(inventory, ROW_SHAPE, "PARTICLE_SECTION_SHAPE", player);
|
||||
header(inventory, ROW_TIMING, "PARTICLE_SECTION_TIMING", player);
|
||||
header(inventory, ROW_CONDITIONS, "PARTICLE_SECTION_CONDITIONS", player);
|
||||
header(inventory, ROW_DESIGN, Material.PAINTING, "PARTICLE_SECTION_DESIGN", player);
|
||||
header(inventory, ROW_PARTICLE, Material.FIREWORK_STAR, "PARTICLE_SECTION_PARTICLE", player);
|
||||
header(inventory, ROW_SHAPE, Material.ARMOR_STAND, "PARTICLE_SECTION_SHAPE", player);
|
||||
header(inventory, ROW_TIMING, Material.DAYLIGHT_DETECTOR, "PARTICLE_SECTION_TIMING", player);
|
||||
header(inventory, ROW_CONDITIONS, Material.OBSERVER, "PARTICLE_SECTION_CONDITIONS", player);
|
||||
|
||||
inventory.setItem(ROW_DESIGN * 9 + 1, new SWItem(design.getIcon(), designName(design, player), List.of(msg("PARTICLE_VALUE_CLICK", player)), false,
|
||||
clickType -> Pickers.design(player, design, picked -> changeDesign(context, picked), context::reopen)));
|
||||
@@ -132,8 +132,9 @@ class EntryEditor {
|
||||
inventory.open();
|
||||
}
|
||||
|
||||
private void header(SWInventory inventory, int row, String key, Player player) {
|
||||
inventory.setItem(row * 9, new SWItem(Material.LIGHT_GRAY_STAINED_GLASS_PANE, msg(key, player), clickType -> {
|
||||
// Glowing so the row labels stand apart from the settings next to them
|
||||
private void header(SWInventory inventory, int row, Material icon, String key, Player player) {
|
||||
inventory.setItem(row * 9, new SWItem(icon, msg(key, player), List.of(), true, clickType -> {
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user