Merge
This commit is contained in:
@@ -69,7 +69,7 @@ public class DrawOperation{
|
||||
}else if(type == OpType.rotation.ordinal()){
|
||||
tile.rotation(to);
|
||||
}else if(type == OpType.team.ordinal()){
|
||||
tile.setTeam(Team.all[to]);
|
||||
tile.setTeam(Team.get(to));
|
||||
}else if(type == OpType.overlay.ordinal()){
|
||||
tile.setOverlayID(to);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class EditorTile extends Tile{
|
||||
return;
|
||||
}
|
||||
|
||||
if(getTeamID() == team.ordinal()) return;
|
||||
if(getTeamID() == team.id) return;
|
||||
op(OpType.team, getTeamID());
|
||||
super.setTeam(team);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package mindustry.editor;
|
||||
|
||||
import arc.struct.IntArray;
|
||||
import arc.func.*;
|
||||
import arc.math.Mathf;
|
||||
import arc.math.geom.Bresenham2;
|
||||
import arc.util.Structs;
|
||||
import mindustry.Vars;
|
||||
import mindustry.content.Blocks;
|
||||
import mindustry.game.Team;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.BlockPart;
|
||||
import mindustry.world.blocks.*;
|
||||
|
||||
public enum EditorTool{
|
||||
zoom,
|
||||
@@ -80,7 +79,7 @@ public enum EditorTool{
|
||||
editor.drawCircle(x, y, tile -> {
|
||||
if(mode == -1){
|
||||
//erase block
|
||||
Vars.world.removeBlock(tile);
|
||||
tile.remove();
|
||||
}else if(mode == 0){
|
||||
//erase ore
|
||||
tile.clearOverlay();
|
||||
@@ -141,7 +140,7 @@ public enum EditorTool{
|
||||
if(tile.link().synthetic()){
|
||||
Team dest = tile.getTeam();
|
||||
if(dest == editor.drawTeam) return;
|
||||
fill(editor, x, y, false, t -> t.getTeamID() == dest.ordinal() && t.link().synthetic(), t -> t.setTeam(editor.drawTeam));
|
||||
fill(editor, x, y, false, t -> t.getTeamID() == (int)dest.id && t.link().synthetic(), t -> t.setTeam(editor.drawTeam));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import arc.util.Structs;
|
||||
import mindustry.content.Blocks;
|
||||
import mindustry.game.Team;
|
||||
import mindustry.gen.TileOp;
|
||||
import mindustry.io.LegacyMapIO;
|
||||
import mindustry.io.MapIO;
|
||||
import mindustry.maps.Map;
|
||||
import mindustry.world.*;
|
||||
@@ -65,7 +64,7 @@ public class MapEditor{
|
||||
reset();
|
||||
|
||||
createTiles(pixmap.getWidth(), pixmap.getHeight());
|
||||
load(() -> LegacyMapIO.readPixmap(pixmap, tiles()));
|
||||
load(() -> MapIO.readPixmap(pixmap, tiles()));
|
||||
renderer.resize(width(), height());
|
||||
}
|
||||
|
||||
@@ -84,7 +83,7 @@ public class MapEditor{
|
||||
//re-add them
|
||||
for(Tile tile : tiles){
|
||||
if(tile.block().isMultiblock()){
|
||||
world.setBlock(tile, tile.block(), tile.getTeam());
|
||||
tile.set(tile.block(), tile.getTeam());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -174,7 +173,7 @@ public class MapEditor{
|
||||
}
|
||||
}
|
||||
|
||||
world.setBlock(tile(x, y), drawBlock, drawTeam);
|
||||
tile(x, y).set(drawBlock, drawTeam);
|
||||
}else{
|
||||
boolean isFloor = drawBlock.isFloor() && drawBlock != Blocks.air;
|
||||
|
||||
@@ -183,7 +182,7 @@ public class MapEditor{
|
||||
|
||||
//remove linked tiles blocking the way
|
||||
if(!isFloor && (tile.isLinked() || tile.block().isMultiblock())){
|
||||
world.removeBlock(tile.link());
|
||||
tile.link().remove();
|
||||
}
|
||||
|
||||
if(isFloor){
|
||||
|
||||
@@ -551,7 +551,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
|
||||
int i = 0;
|
||||
|
||||
for(Team team : Team.all){
|
||||
for(Team team : Team.base()){
|
||||
ImageButton button = new ImageButton(Tex.whiteui, Styles.clearTogglePartiali);
|
||||
button.margin(4f);
|
||||
button.getImageCell().grow();
|
||||
|
||||
@@ -138,7 +138,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
tile.rotation(write.rotation);
|
||||
tile.setFloor((Floor)content.block(write.floor));
|
||||
tile.setBlock(content.block(write.block));
|
||||
tile.setTeam(Team.all[write.team]);
|
||||
tile.setTeam(Team.get(write.team));
|
||||
tile.setOverlay(content.block(write.ore));
|
||||
}
|
||||
}
|
||||
@@ -367,7 +367,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
GenTile tile = buffer1[px][py];
|
||||
input.apply(x, y, content.block(tile.floor), content.block(tile.block), content.block(tile.ore));
|
||||
filter.apply(input);
|
||||
buffer2[px][py].set(input.floor, input.block, input.ore, Team.all[tile.team], tile.rotation);
|
||||
buffer2[px][py].set(input.floor, input.block, input.ore, Team.get(tile.team), tile.rotation);
|
||||
});
|
||||
|
||||
pixmap.each((px, py) -> buffer1[px][py].set(buffer2[px][py]));
|
||||
@@ -411,7 +411,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
this.floor = floor.id;
|
||||
this.block = wall.id;
|
||||
this.ore = ore.id;
|
||||
this.team = (byte)team.ordinal();
|
||||
this.team = (byte) team.id;
|
||||
this.rotation = (byte)rotation;
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
ctile.setBlock(content.block(block));
|
||||
ctile.setOverlay(content.block(ore));
|
||||
ctile.rotation(rotation);
|
||||
ctile.setTeam(Team.all[team]);
|
||||
ctile.setTeam(Team.get(team));
|
||||
return ctile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class MapView extends Element implements GestureListener{
|
||||
private boolean grid = false;
|
||||
private GridImage image = new GridImage(0, 0);
|
||||
private Vec2 vec = new Vec2();
|
||||
private Rectangle rect = new Rectangle();
|
||||
private Rect rect = new Rect();
|
||||
private Vec2[][] brushPolygons = new Vec2[MapEditor.brushSizes.length][0];
|
||||
|
||||
private boolean drawing;
|
||||
|
||||
Reference in New Issue
Block a user