From 3997ca6454c15e492b8b6e72c0fdd0754b5290b4 Mon Sep 17 00:00:00 2001 From: Fenr1r <40751502+fenrir94@users.noreply.github.com> Date: Sun, 26 May 2019 01:08:00 +0900 Subject: [PATCH] Minor fix - rename some variable on editor. (#495) - editor/EditorTool.java - editor/MapInfoDialog.java - editor/MapRenderer.java --- core/src/io/anuke/mindustry/editor/EditorTool.java | 10 +++++----- .../src/io/anuke/mindustry/editor/MapInfoDialog.java | 10 +++++----- core/src/io/anuke/mindustry/editor/MapRenderer.java | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/core/src/io/anuke/mindustry/editor/EditorTool.java b/core/src/io/anuke/mindustry/editor/EditorTool.java index 41cab43717..7eb6ffa334 100644 --- a/core/src/io/anuke/mindustry/editor/EditorTool.java +++ b/core/src/io/anuke/mindustry/editor/EditorTool.java @@ -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{ diff --git a/core/src/io/anuke/mindustry/editor/MapInfoDialog.java b/core/src/io/anuke/mindustry/editor/MapInfoDialog.java index efd049d11f..7f9fca20e6 100644 --- a/core/src/io/anuke/mindustry/editor/MapInfoDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapInfoDialog.java @@ -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(); diff --git a/core/src/io/anuke/mindustry/editor/MapRenderer.java b/core/src/io/anuke/mindustry/editor/MapRenderer.java index decc0c18d3..789fdf4283 100644 --- a/core/src/io/anuke/mindustry/editor/MapRenderer.java +++ b/core/src/io/anuke/mindustry/editor/MapRenderer.java @@ -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();