forked from SteamWar/SteamWar
Add lobby particle slot menus
Replace the particle inventory with a main menu showing the 7 slots and unlocked presets, a slot editor with a read-only view for locked slots, and an entry editor with pickers for designs, choices, colours and icons. Slots are limited to 10 entries and a particles-per-tick budget.
This commit is contained in:
@@ -22,7 +22,9 @@ package de.steamwar.lobby.particle.slot;
|
||||
import com.google.gson.JsonParser;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.particle.ParticleRequirement;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import de.steamwar.sql.UserConfig;
|
||||
import de.steamwar.sql.UserPerm;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
import java.util.logging.Level;
|
||||
@@ -31,8 +33,14 @@ import java.util.logging.Level;
|
||||
public class ParticleSlots {
|
||||
|
||||
public final int COUNT = 7;
|
||||
public final int MAX_ENTRIES = 10;
|
||||
private final String KEY_PREFIX = "lobby-particle-slot-";
|
||||
|
||||
// Particle positions per tick a slot may spawn
|
||||
public double maxCost(SteamwarUser user) {
|
||||
return user.hasPerm(UserPerm.TEAM) ? 80 : 40;
|
||||
}
|
||||
|
||||
// Slots 1-3 for everyone, 4-5 for team members, 6-7 for the server team
|
||||
public ParticleRequirement requirement(int index) {
|
||||
if (index < 3) return ParticleRequirement.NO_REQUIRMENT;
|
||||
|
||||
Reference in New Issue
Block a user