Stacked map editor brush slider
This commit is contained in:
@@ -1161,6 +1161,7 @@ public class Blocks implements ContentList{
|
|||||||
requirements(Category.power, with(Items.copper, 40, Items.graphite, 35, Items.lead, 50, Items.silicon, 35, Items.metaglass, 40));
|
requirements(Category.power, with(Items.copper, 40, Items.graphite, 35, Items.lead, 50, Items.silicon, 35, Items.metaglass, 40));
|
||||||
powerProduction = 1.8f;
|
powerProduction = 1.8f;
|
||||||
generateEffect = Fx.redgeneratespark;
|
generateEffect = Fx.redgeneratespark;
|
||||||
|
effectChance = 0.013f;
|
||||||
size = 2;
|
size = 2;
|
||||||
floating = true;
|
floating = true;
|
||||||
ambientSound = Sounds.hum;
|
ambientSound = Sounds.hum;
|
||||||
|
|||||||
@@ -1526,11 +1526,10 @@ public class Fx{
|
|||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
|
|
||||||
redgeneratespark = new Effect(18, e -> {
|
redgeneratespark = new Effect(80, e -> {
|
||||||
randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> {
|
|
||||||
float len = e.fout() * 4f;
|
|
||||||
color(Pal.redSpark, Color.gray, e.fin());
|
color(Pal.redSpark, Color.gray, e.fin());
|
||||||
Fill.circle(e.x + x, e.y + y, len/2f);
|
randLenVectors(e.id, 2, e.finpow() * 9f, (x, y) -> {
|
||||||
|
Fill.circle(e.x + x, e.y + y, e.fslope() * 1.8f);
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|||||||
@@ -560,10 +560,12 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t.top();
|
var label = new Label("@editor.brush");
|
||||||
t.add("@editor.brush");
|
label.setAlignment(Align.center);
|
||||||
|
label.touchable = Touchable.disabled;
|
||||||
|
|
||||||
|
t.top().stack(slider, label).width(size * 3f - 20).padTop(4f);
|
||||||
t.row();
|
t.row();
|
||||||
t.add(slider).width(size * 3f - 20).padTop(4f);
|
|
||||||
}).padTop(5).growX().top();
|
}).padTop(5).growX().top();
|
||||||
|
|
||||||
mid.row();
|
mid.row();
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import mindustry.world.meta.*;
|
|||||||
|
|
||||||
public class ThermalGenerator extends PowerGenerator{
|
public class ThermalGenerator extends PowerGenerator{
|
||||||
public Effect generateEffect = Fx.none;
|
public Effect generateEffect = Fx.none;
|
||||||
|
public float effectChance = 0.05f;
|
||||||
public Attribute attribute = Attribute.heat;
|
public Attribute attribute = Attribute.heat;
|
||||||
|
|
||||||
public ThermalGenerator(String name){
|
public ThermalGenerator(String name){
|
||||||
@@ -52,7 +53,7 @@ public class ThermalGenerator extends PowerGenerator{
|
|||||||
public void updateTile(){
|
public void updateTile(){
|
||||||
productionEfficiency = sum + attribute.env();
|
productionEfficiency = sum + attribute.env();
|
||||||
|
|
||||||
if(productionEfficiency > 0.1f && Mathf.chance(0.05 * delta())){
|
if(productionEfficiency > 0.1f && Mathf.chanceDelta(effectChance)){
|
||||||
generateEffect.at(x + Mathf.range(3f), y + Mathf.range(3f));
|
generateEffect.at(x + Mathf.range(3f), y + Mathf.range(3f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user