Many various internal changes
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);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class EditorTile extends Tile{
|
||||
return;
|
||||
}
|
||||
|
||||
if(getTeamID() == (int) team.id) return;
|
||||
if(getTeamID() == (int)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() == (int) dest.id && 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());
|
||||
}
|
||||
|
||||
@@ -86,7 +85,7 @@ public class MapEditor{
|
||||
for(int x = 0; x < width(); x++){
|
||||
for(int y = 0; y < height(); y++){
|
||||
if(tiles[x][y].block().isMultiblock()){
|
||||
world.setBlock(tiles[x][y], tiles[x][y].block(), tiles[x][y].getTeam());
|
||||
tiles[x][y].set(tiles[x][y].block(), tiles[x][y].getTeam());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -176,7 +175,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;
|
||||
|
||||
@@ -185,7 +184,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);
|
||||
}
|
||||
}
|
||||
for(int px = 0; px < pixmap.getWidth(); px++){
|
||||
@@ -415,7 +415,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
this.floor = floor.id;
|
||||
this.block = wall.id;
|
||||
this.ore = ore.id;
|
||||
this.team = (byte) (int) team.id;
|
||||
this.team = (byte) (int)team.id;
|
||||
this.rotation = (byte)rotation;
|
||||
}
|
||||
|
||||
@@ -437,7 +437,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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user