forked from SteamWar/SteamWar
Space out entry editor rows and show empty slots as firework stars
Settings in the entry editor start one column after the row headers, and empty particle slots show a firework star instead of a gray pane.
This commit is contained in:
@@ -50,6 +50,8 @@ class EntryEditor {
|
||||
private final int ROW_SHAPE = 2;
|
||||
private final int ROW_TIMING = 3;
|
||||
private final int ROW_CONDITIONS = 4;
|
||||
// Settings start after the row header and one column of space
|
||||
private final int FIRST_SETTING = 2;
|
||||
private final int SIZE = 54;
|
||||
private final int BACK = BottomBar.position(SIZE, BottomBar.BACK);
|
||||
private final int COST = BottomBar.position(SIZE, BottomBar.COST);
|
||||
@@ -107,19 +109,19 @@ class EntryEditor {
|
||||
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,
|
||||
inventory.setItem(ROW_DESIGN * 9 + FIRST_SETTING, 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)));
|
||||
if (design.usesEntryParticle()) {
|
||||
inventory.setItem(ROW_DESIGN * 9 + 2, parameterItem(context, PARTICLE));
|
||||
inventory.setItem(ROW_DESIGN * 9 + FIRST_SETTING + 1, parameterItem(context, PARTICLE));
|
||||
ParticleType type = entry.getValues().get(PARTICLE);
|
||||
if (type.usesColors()) {
|
||||
inventory.setItem(ROW_DESIGN * 9 + 3, parameterItem(context, COLORS));
|
||||
inventory.setItem(ROW_DESIGN * 9 + FIRST_SETTING + 2, parameterItem(context, COLORS));
|
||||
} else if (type.usesBlock()) {
|
||||
inventory.setItem(ROW_DESIGN * 9 + 3, parameterItem(context, BLOCK));
|
||||
inventory.setItem(ROW_DESIGN * 9 + FIRST_SETTING + 2, parameterItem(context, BLOCK));
|
||||
}
|
||||
row(inventory, context, ROW_PARTICLE, List.of(COUNT, SPEED, SPREAD_X, SPREAD_Y, SPREAD_Z));
|
||||
} else {
|
||||
inventory.setItem(ROW_PARTICLE * 9 + 1, new SWItem(Material.STRUCTURE_VOID, msg("PARTICLE_FIXED_LOOK", player), clickType -> {
|
||||
inventory.setItem(ROW_PARTICLE * 9 + FIRST_SETTING, new SWItem(Material.STRUCTURE_VOID, msg("PARTICLE_FIXED_LOOK", player), clickType -> {
|
||||
}));
|
||||
}
|
||||
row(inventory, context, ROW_SHAPE, design.getParameters());
|
||||
@@ -146,8 +148,8 @@ class EntryEditor {
|
||||
}
|
||||
|
||||
private void row(SWInventory inventory, Context context, int row, List<Parameter<?>> parameters) {
|
||||
for (int i = 0; i < parameters.size() && i < 8; i++) {
|
||||
inventory.setItem(row * 9 + 1 + i, parameterItem(context, parameters.get(i)));
|
||||
for (int i = 0; i < parameters.size() && FIRST_SETTING + i < 9; i++) {
|
||||
inventory.setItem(row * 9 + FIRST_SETTING + i, parameterItem(context, parameters.get(i)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ParticleMenu {
|
||||
});
|
||||
}
|
||||
List<String> lore = List.of(msg("PARTICLE_SLOT_CREATE", player));
|
||||
return new SWItem(Material.GRAY_STAINED_GLASS_PANE, msg("PARTICLE_SLOT_EMPTY", player), lore, false, clickType -> {
|
||||
return new SWItem(Material.FIREWORK_STAR, msg("PARTICLE_SLOT_EMPTY", player), lore, false, clickType -> {
|
||||
lobbyPlayer.setSlot(index, new ParticleSlot(ParticleSlots.defaultName(index)));
|
||||
SlotEditor.open(player, index);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user