forked from SteamWar/SteamWar
Add configurable particle slot model
Introduce parameters, particle types, designs and entries that build the existing particle elements, store each of the 7 particle slots in its own UserConfig key, and let LobbyPlayer select a slot next to the old enum particles. Slots 4-5 need a team, 6-7 the server team.
This commit is contained in:
@@ -41,6 +41,10 @@ public interface ParticleRequirement {
|
||||
|
||||
boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig);
|
||||
|
||||
default boolean test(UnlockContext context) {
|
||||
return test(context.getUser(), context.getEvents(), context.getEggHuntConfig());
|
||||
}
|
||||
|
||||
ParticleRequirement SERVER_TEAM = new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
@@ -51,6 +55,11 @@ public interface ParticleRequirement {
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return user.hasPerm(UserPerm.TEAM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(UnlockContext context) {
|
||||
return context.getUser().hasPerm(UserPerm.TEAM);
|
||||
}
|
||||
};
|
||||
|
||||
ParticleRequirement NO_REQUIRMENT = new ParticleRequirement() {
|
||||
@@ -63,6 +72,29 @@ public interface ParticleRequirement {
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(UnlockContext context) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// Unlike HAS_TEAM this does not also pass for the server team
|
||||
ParticleRequirement TEAM_MEMBER = new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_TEAM", player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return user.getTeam() != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(UnlockContext context) {
|
||||
return context.getUser().getTeam() != 0;
|
||||
}
|
||||
};
|
||||
ParticleRequirement HAS_TEAM = new ParticleRequirement() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user