generation UI fix + other miniscule ui fix (#7117)
This commit is contained in:
@@ -106,7 +106,6 @@ public abstract class FilterOption{
|
||||
table.button(b -> b.image(supplier.get().uiIcon).update(i -> ((TextureRegionDrawable)i.getDrawable())
|
||||
.setRegion(supplier.get() == Blocks.air ? Icon.none.getRegion() : supplier.get().uiIcon)).size(iconSmall), () -> {
|
||||
BaseDialog dialog = new BaseDialog("@filter.option." + name);
|
||||
dialog.setFillParent(false);
|
||||
dialog.cont.pane(t -> {
|
||||
int i = 0;
|
||||
for(Block block : Vars.content.blocks()){
|
||||
@@ -119,7 +118,8 @@ public abstract class FilterOption{
|
||||
});
|
||||
if(++i % 10 == 0) t.row();
|
||||
}
|
||||
});
|
||||
dialog.setFillParent(i > 100);
|
||||
}).padRight(8f).scrollX(false);
|
||||
|
||||
|
||||
dialog.addCloseButton();
|
||||
|
||||
@@ -12,7 +12,7 @@ import mindustry.gen.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.environment.*;
|
||||
|
||||
public abstract class GenerateFilter{
|
||||
public abstract class GenerateFilter implements Cloneable{
|
||||
public int seed = 0;
|
||||
|
||||
public void apply(Tiles tiles, GenerateInput in){
|
||||
@@ -128,6 +128,14 @@ public abstract class GenerateFilter{
|
||||
return Mathf.randomSeed(Pack.longInt(x, y + seed));
|
||||
}
|
||||
|
||||
public GenerateFilter copy(){
|
||||
try{
|
||||
return (GenerateFilter) clone();
|
||||
}catch(CloneNotSupportedException disgrace){
|
||||
throw new RuntimeException("java is the best language", disgrace);
|
||||
}
|
||||
}
|
||||
|
||||
/** an input for generating at a certain coordinate. should only be instantiated once. */
|
||||
public static class GenerateInput{
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ public class RiverNoiseFilter extends GenerateFilter{
|
||||
new SliderOption("octaves", () -> octaves, f -> octaves = f, 1f, 10f),
|
||||
new SliderOption("falloff", () -> falloff, f -> falloff = f, 0f, 1f),
|
||||
new BlockOption("target", () -> target, b -> target = b, anyOptional),
|
||||
new BlockOption("block", () -> block, b -> block = b, wallsOnly),
|
||||
new BlockOption("floor", () -> floor, b -> floor = b, floorsOnly),
|
||||
new BlockOption("floor2", () -> floor2, b -> floor2 = b, floorsOnly)
|
||||
new BlockOption("block", () -> block, b -> block = b, wallsOptional),
|
||||
new BlockOption("floor", () -> floor, b -> floor = b, floorsOptional),
|
||||
new BlockOption("floor2", () -> floor2, b -> floor2 = b, floorsOptional)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,13 +35,13 @@ public class RiverNoiseFilter extends GenerateFilter{
|
||||
float noise = rnoise(in.x, in.y, (int)octaves, scl, falloff, 1f);
|
||||
|
||||
if(noise >= threshold && (target == Blocks.air || in.floor == target || in.block == target)){
|
||||
in.floor = floor;
|
||||
if(floor != Blocks.air) in.floor = floor;
|
||||
|
||||
if(in.block.solid){
|
||||
if(in.block.solid && block != Blocks.air && in.block != Blocks.air){
|
||||
in.block = block;
|
||||
}
|
||||
|
||||
if(noise >= threshold2){
|
||||
if(noise >= threshold2 && floor2 != Blocks.air){
|
||||
in.floor = floor2;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user