Minor fix - rename some variable on editor. (#495)

- editor/EditorTool.java
- editor/MapInfoDialog.java
- editor/MapRenderer.java
This commit is contained in:
Fenr1r 2019-05-26 01:08:00 +09:00 committed by Anuken
parent 32adcc3676
commit 3997ca6454
3 changed files with 16 additions and 16 deletions

View File

@ -50,7 +50,7 @@ public enum EditorTool{
IntArray stack = new IntArray();
Block dest;
boolean isfloor;
boolean isFloor;
MapEditor data;
public void touched(MapEditor editor, int x, int y){
@ -64,14 +64,14 @@ public enum EditorTool{
}
data = editor;
isfloor = editor.drawBlock instanceof Floor;
isFloor = editor.drawBlock instanceof Floor;
Block floor = tile.floor();
Block block = tile.block();
boolean synth = editor.drawBlock.synthetic();
Block draw = editor.drawBlock;
dest = draw instanceof OverlayFloor ? tile.overlay() : isfloor ? floor : block;
dest = draw instanceof OverlayFloor ? tile.overlay() : isFloor ? floor : block;
if(dest == draw || block instanceof BlockPart || block.isMultiblock()){
return;
@ -85,7 +85,7 @@ public enum EditorTool{
IntPositionConsumer writer = (px, py) -> {
Tile write = editor.tile(px, py);
if(isfloor){
if(isFloor){
if(alt && !(draw instanceof OverlayFloor)){
Block ore = write.overlay();
write.setFloor((Floor)draw);
@ -167,7 +167,7 @@ public enum EditorTool{
boolean eq(int px, int py){
Tile tile = data.tile(px, py);
return (data.drawBlock instanceof OverlayFloor ? tile.overlay() : isfloor ? tile.floor() : tile.block()) == dest && !(data.drawBlock instanceof OverlayFloor && tile.floor().isLiquid);
return (data.drawBlock instanceof OverlayFloor ? tile.overlay() : isFloor ? tile.floor() : tile.block()) == dest && !(data.drawBlock instanceof OverlayFloor && tile.floor().isLiquid);
}
},
spray{

View File

@ -12,13 +12,13 @@ import io.anuke.mindustry.ui.dialogs.FloatingDialog;
public class MapInfoDialog extends FloatingDialog{
private final MapEditor editor;
private final WaveInfoDialog waveinfo;
private final CustomRulesDialog ruleinfo = new CustomRulesDialog();
private final WaveInfoDialog waveInfo;
private final CustomRulesDialog ruleInfo = new CustomRulesDialog();
public MapInfoDialog(MapEditor editor){
super("$editor.mapinfo");
this.editor = editor;
this.waveinfo = new WaveInfoDialog(editor);
this.waveInfo = new WaveInfoDialog(editor);
addCloseButton();
@ -58,11 +58,11 @@ public class MapInfoDialog extends FloatingDialog{
cont.row();
cont.add("$editor.rules").padRight(8).left();
cont.addButton("$edit", () -> ruleinfo.show(Vars.state.rules, () -> Vars.state.rules = new Rules())).left().width(200f);;
cont.addButton("$edit", () -> ruleInfo.show(Vars.state.rules, () -> Vars.state.rules = new Rules())).left().width(200f);;
cont.row();
cont.add("$editor.waves").padRight(8).left();
cont.addButton("$edit", waveinfo::show).left().width(200f);
cont.addButton("$edit", waveInfo::show).left().width(200f);
name.change();
description.change();

View File

@ -19,7 +19,7 @@ import io.anuke.mindustry.world.blocks.BlockPart;
import static io.anuke.mindustry.Vars.tilesize;
public class MapRenderer implements Disposable{
private static final int chunksize = 64;
private static final int chunkSize = 64;
private IndexedRenderer[][] chunks;
private IntSet updates = new IntSet();
private IntSet delayedUpdates = new IntSet();
@ -41,11 +41,11 @@ public class MapRenderer implements Disposable{
}
}
chunks = new IndexedRenderer[(int)Math.ceil((float)width / chunksize)][(int)Math.ceil((float)height / chunksize)];
chunks = new IndexedRenderer[(int)Math.ceil((float)width / chunkSize)][(int)Math.ceil((float)height / chunkSize)];
for(int x = 0; x < chunks.length; x++){
for(int y = 0; y < chunks[0].length; y++){
chunks[x][y] = new IndexedRenderer(chunksize * chunksize * 2);
chunks[x][y] = new IndexedRenderer(chunkSize * chunkSize * 2);
}
}
this.width = width;
@ -97,7 +97,7 @@ public class MapRenderer implements Disposable{
}
private void render(int wx, int wy){
int x = wx / chunksize, y = wy / chunksize;
int x = wx / chunkSize, y = wy / chunkSize;
IndexedRenderer mesh = chunks[x][y];
Tile tile = editor.tiles()[wx][wy];
@ -107,8 +107,8 @@ public class MapRenderer implements Disposable{
TextureRegion region;
int idxWall = (wx % chunksize) + (wy % chunksize) * chunksize;
int idxDecal = (wx % chunksize) + (wy % chunksize) * chunksize + chunksize * chunksize;
int idxWall = (wx % chunkSize) + (wy % chunkSize) * chunkSize;
int idxDecal = (wx % chunkSize) + (wy % chunkSize) * chunkSize + chunkSize * chunkSize;
if(wall != Blocks.air && (wall.synthetic() || wall instanceof BlockPart)){
region = !Core.atlas.isFound(wall.editorIcon()) ? Core.atlas.find("clear-editor") : wall.editorIcon();