Bugfixes
This commit is contained in:
@@ -2,6 +2,7 @@ package mindustry.editor;
|
||||
|
||||
import arc.func.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.editor.DrawOperation.*;
|
||||
import mindustry.game.*;
|
||||
@@ -20,7 +21,7 @@ public class EditorTile extends Tile{
|
||||
|
||||
@Override
|
||||
public void setFloor(@NonNull Floor type){
|
||||
if(state.isGame()){
|
||||
if(skip()){
|
||||
super.setFloor(type);
|
||||
return;
|
||||
}
|
||||
@@ -41,13 +42,11 @@ public class EditorTile extends Tile{
|
||||
|
||||
@Override
|
||||
public void setBlock(Block type, Team team, int rotation){
|
||||
if(state.isGame()){
|
||||
if(skip()){
|
||||
super.setBlock(type, team, rotation);
|
||||
return;
|
||||
}
|
||||
|
||||
if(this.block == type && (build == null || build.rotation == rotation)) return;
|
||||
|
||||
if(rotation != 0) op(OpType.rotation, (byte)rotation);
|
||||
if(team() != Team.derelict) op(OpType.team, (byte)team().id);
|
||||
op(OpType.block, block.id);
|
||||
@@ -56,7 +55,7 @@ public class EditorTile extends Tile{
|
||||
|
||||
@Override
|
||||
public void setTeam(Team team){
|
||||
if(state.isGame()){
|
||||
if(skip()){
|
||||
super.setTeam(team);
|
||||
return;
|
||||
}
|
||||
@@ -68,7 +67,7 @@ public class EditorTile extends Tile{
|
||||
|
||||
@Override
|
||||
public void setOverlay(Block overlay){
|
||||
if(state.isGame()){
|
||||
if(skip()){
|
||||
super.setOverlay(overlay);
|
||||
return;
|
||||
}
|
||||
@@ -81,7 +80,7 @@ public class EditorTile extends Tile{
|
||||
|
||||
@Override
|
||||
protected void fireChanged(){
|
||||
if(state.isGame()){
|
||||
if(skip()){
|
||||
super.fireChanged();
|
||||
}else{
|
||||
ui.editor.editor.renderer().updatePoint(x, y);
|
||||
@@ -90,14 +89,14 @@ public class EditorTile extends Tile{
|
||||
|
||||
@Override
|
||||
public void recache(){
|
||||
if(state.isGame()){
|
||||
if(skip()){
|
||||
super.recache();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void changeEntity(Team team, Prov<Building> entityprov, int rotation){
|
||||
if(state.isGame()){
|
||||
if(skip()){
|
||||
super.changeEntity(team, entityprov, rotation);
|
||||
return;
|
||||
}
|
||||
@@ -118,6 +117,10 @@ public class EditorTile extends Tile{
|
||||
}
|
||||
}
|
||||
|
||||
private boolean skip(){
|
||||
return state.isGame() || ui.editor.editor.isLoading();
|
||||
}
|
||||
|
||||
private void op(OpType type, short value){
|
||||
ui.editor.editor.addTileOp(TileOp.get(x, y, (byte)type.ordinal(), value));
|
||||
}
|
||||
|
||||
@@ -31,6 +31,10 @@ public class MapEditor{
|
||||
public Block drawBlock = Blocks.stone;
|
||||
public Team drawTeam = Team.sharded;
|
||||
|
||||
public boolean isLoading(){
|
||||
return loading;
|
||||
}
|
||||
|
||||
public StringMap getTags(){
|
||||
return tags;
|
||||
}
|
||||
@@ -52,7 +56,7 @@ public class MapEditor{
|
||||
if(map.file.parent().parent().name().equals("1127400") && steam){
|
||||
tags.put("steamid", map.file.parent().name());
|
||||
}
|
||||
MapIO.loadMap(map, context);
|
||||
load(() -> MapIO.loadMap(map, context));
|
||||
renderer.resize(width(), height());
|
||||
loading = false;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public class MapRenderer implements Disposable{
|
||||
wx * tilesize + wall.offset + (tilesize - width) / 2f,
|
||||
wy * tilesize + wall.offset + (tilesize - height) / 2f,
|
||||
width, height,
|
||||
tile.build == null || !wall.rotate ? 0 : tile.build.rotdeg() - 90);
|
||||
tile.build == null || !wall.rotate ? 0 : tile.build.rotdeg());
|
||||
}else{
|
||||
region = floor.editorVariantRegions()[Mathf.randomSeed(idxWall, 0, floor.editorVariantRegions().length - 1)];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user