forked from SteamWar/SteamWar
Simplify lobby particle menus
Every menu item now acts on a plain click: slots open their editor with a use button, entries open their editor, and duplicating is gone. The entry editor groups settings into labelled rows, numbers and colours get their own screens instead of relying on right click or Q, and slot names show the particles per tick used out of the maximum.
This commit is contained in:
@@ -25,6 +25,8 @@ import de.steamwar.lobby.particle.UnlockContext;
|
||||
import de.steamwar.lobby.particle.design.*;
|
||||
import de.steamwar.lobby.particle.slot.ParticleEntry;
|
||||
import de.steamwar.lobby.particle.slot.ParticleSlot;
|
||||
import de.steamwar.lobby.particle.slot.ParticleSlots;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -136,6 +138,15 @@ class ParticleGuiText {
|
||||
}
|
||||
}
|
||||
|
||||
// The slot's name followed by how many of its allowed particles per tick it uses
|
||||
String slotName(ParticleSlot slot, SteamwarUser user, Player player) {
|
||||
return msg("PARTICLE_SLOT_NAME", player, slot.getName(), number(slot.cost()), number(ParticleSlots.maxCost(user)));
|
||||
}
|
||||
|
||||
String slotTitle(ParticleSlot slot, SteamwarUser user, Player player) {
|
||||
return msg("PARTICLE_SLOT_TITLE", player, slot.getName(), number(slot.cost()), number(ParticleSlots.maxCost(user)));
|
||||
}
|
||||
|
||||
List<String> slotSummary(ParticleSlot slot, Player player) {
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add(msg("PARTICLE_SLOT_ENTRIES", player, slot.getEntries().size()));
|
||||
|
||||
Reference in New Issue
Block a user