Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
Conflicts: core/src/mindustry/content/Blocks.java
This commit is contained in:
@@ -3,7 +3,6 @@ package mindustry.maps;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.ai.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.*;
|
||||
@@ -186,7 +185,6 @@ public class SectorDamage{
|
||||
|
||||
Tile start = spawns.first();
|
||||
|
||||
Time.mark();
|
||||
var field = pathfinder.getField(state.rules.waveTeam, Pathfinder.costGround, Pathfinder.fieldCore);
|
||||
Seq<Tile> path = new Seq<>();
|
||||
boolean found = false;
|
||||
|
||||
@@ -111,4 +111,23 @@ public abstract class FilterOption{
|
||||
table.add("@filter.option." + name);
|
||||
}
|
||||
}
|
||||
|
||||
static class ToggleOption extends FilterOption{
|
||||
final String name;
|
||||
final Boolp getter;
|
||||
final Boolc setter;
|
||||
|
||||
ToggleOption(String name, Boolp getter, Boolc setter){
|
||||
this.name = name;
|
||||
this.getter = getter;
|
||||
this.setter = setter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(Table table){
|
||||
table.row();
|
||||
CheckBox check = table.check("@filter.option." + name, setter).growX().padBottom(5).padTop(5).center().get();
|
||||
check.changed(changed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,11 +15,13 @@ public class MirrorFilter extends GenerateFilter{
|
||||
private final Vec2 v1 = new Vec2(), v2 = new Vec2(), v3 = new Vec2();
|
||||
|
||||
int angle = 45;
|
||||
boolean rotate = false;
|
||||
|
||||
@Override
|
||||
public FilterOption[] options(){
|
||||
return Structs.arr(
|
||||
new SliderOption("angle", () -> angle, f -> angle = (int)f, 0, 360, 45)
|
||||
new SliderOption("angle", () -> angle, f -> angle = (int)f, 0, 360, 45),
|
||||
new ToggleOption("rotate", () -> rotate, f -> rotate = f)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -72,8 +74,8 @@ public class MirrorFilter extends GenerateFilter{
|
||||
}
|
||||
|
||||
void mirror(Vec2 p, float x0, float y0, float x1, float y1){
|
||||
//special case: uneven map mirrored at 45 degree angle
|
||||
if(in.width != in.height && angle % 90 != 0){
|
||||
//special case: uneven map mirrored at 45 degree angle (or someone might just want rotational symmetry)
|
||||
if((in.width != in.height && angle % 90 != 0) || rotate){
|
||||
p.x = in.width - p.x - 1;
|
||||
p.y = in.height - p.y - 1;
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user