forked from SteamWar/SteamWar
Add drawn wing shapes to the slot builder
A new Drawn wings design draws angel, bat, butterfly, fairy and phoenix wings from lines and curves instead of images. The points per wing can be set from 6 to 60, so sparse wings stay cheap enough to show often.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
package de.steamwar.lobby.particle.design;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.DrawnWings;
|
||||
import de.steamwar.lobby.particle.WingDesign;
|
||||
import de.steamwar.lobby.particle.elements.Circle;
|
||||
import de.steamwar.lobby.particle.elements.Cloud;
|
||||
@@ -105,6 +106,27 @@ public class Designs {
|
||||
}
|
||||
};
|
||||
|
||||
public final ChoiceParameter<DrawnWings> DRAWN_SHAPE = ChoiceParameter.ofEnum("shape", "PARTICLE_PARAM_DRAWN_SHAPE", DrawnWings.ANGEL);
|
||||
public final IntParameter WING_DETAIL = new IntParameter("detail", "PARTICLE_PARAM_WING_DETAIL", 20, 6, 60);
|
||||
|
||||
// Wings drawn from lines, with a chosen number of points per wing; sparse ones stay cheap enough to show often
|
||||
public final ParticleDesign DRAWN_WING = new ParticleDesign("drawn_wing", Material.FEATHER, "PARTICLE_DESIGN_DRAWN_WING", DRAWN_SHAPE, WING_DETAIL, WING_SIZE) {
|
||||
@Override
|
||||
public ParticleElement build(ParameterValues values, ParticleElement particle) {
|
||||
return new Wing(particle, values.get(WING_SIZE), values.get(DRAWN_SHAPE).withDetail(values.get(WING_DETAIL)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int points(ParameterValues values) {
|
||||
return 2 * values.get(WING_DETAIL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyDefaults(ParameterValues values) {
|
||||
WING.applyDefaults(values);
|
||||
}
|
||||
};
|
||||
|
||||
public final ParticleDesign CLOUD = new ParticleDesign("cloud", Material.WHITE_WOOL, "PARTICLE_DESIGN_CLOUD") {
|
||||
@Override
|
||||
public ParticleElement build(ParameterValues values, ParticleElement particle) {
|
||||
@@ -115,7 +137,7 @@ public class Designs {
|
||||
private Map<String, ParticleDesign> registry() {
|
||||
if (registry == null) {
|
||||
Map<String, ParticleDesign> designs = new LinkedHashMap<>();
|
||||
List.of(SIMPLE, CIRCLE, WING, CLOUD).forEach(design -> register(designs, design));
|
||||
List.of(SIMPLE, CIRCLE, WING, DRAWN_WING, CLOUD).forEach(design -> register(designs, design));
|
||||
RewardDesigns.all().forEach(design -> register(designs, design));
|
||||
InternalDesigns.all().forEach(design -> register(designs, design));
|
||||
registry = designs;
|
||||
|
||||
Reference in New Issue
Block a user