Fixed GWT build errors and rotation axis bug
This commit is contained in:
BIN
core/assets-raw/sprites/ui/icons/controller-cursor.png
Normal file
BIN
core/assets-raw/sprites/ui/icons/controller-cursor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 235 B |
@@ -4,4 +4,5 @@
|
|||||||
<source path="io/anuke/mindustry" />
|
<source path="io/anuke/mindustry" />
|
||||||
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.entities.enemies" />
|
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.entities.enemies" />
|
||||||
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.world.Tile" />
|
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.world.Tile" />
|
||||||
|
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.world.Maps" />
|
||||||
</module>
|
</module>
|
||||||
@@ -30,9 +30,9 @@ public class Vars{
|
|||||||
//discord group URL
|
//discord group URL
|
||||||
public static final String discordURL = "https://discord.gg/r8BkXNd";
|
public static final String discordURL = "https://discord.gg/r8BkXNd";
|
||||||
//directory for user-created map data
|
//directory for user-created map data
|
||||||
public static final FileHandle customMapDirectory = Gdx.files.local("mindustry-maps/");
|
public static final FileHandle customMapDirectory = gwt ? null : Gdx.files.local("mindustry-maps/");
|
||||||
//save file directory
|
//save file directory
|
||||||
public static final FileHandle saveDirectory = Gdx.files.local("mindustry-saves/");
|
public static final FileHandle saveDirectory = gwt ? null : Gdx.files.local("mindustry-saves/");
|
||||||
//scale of the font
|
//scale of the font
|
||||||
public static float fontscale = Math.max(Unit.dp.scl(1f)/2f, 0.5f);
|
public static float fontscale = Math.max(Unit.dp.scl(1f)/2f, 0.5f);
|
||||||
//camera zoom displayed on startup
|
//camera zoom displayed on startup
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ public class Control extends Module{
|
|||||||
//multiplying by 2 so you start with more time in the beginning
|
//multiplying by 2 so you start with more time in the beginning
|
||||||
wavetime = waveSpacing()*2;
|
wavetime = waveSpacing()*2;
|
||||||
|
|
||||||
if(mode == GameMode.sandbox){
|
if(mode.infiniteResources){
|
||||||
Arrays.fill(items, 999999999);
|
Arrays.fill(items, 999999999);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ public class Control extends Module{
|
|||||||
|
|
||||||
int last = Settings.getInt("hiscore" + world.getMap().name);
|
int last = Settings.getInt("hiscore" + world.getMap().name);
|
||||||
|
|
||||||
if(wave > last && mode != GameMode.sandbox){
|
if(wave > last && !mode.infiniteResources && !mode.toggleWaves){
|
||||||
Settings.putInt("hiscore" + world.getMap().name, wave);
|
Settings.putInt("hiscore" + world.getMap().name, wave);
|
||||||
Settings.save();
|
Settings.save();
|
||||||
hiscore = true;
|
hiscore = true;
|
||||||
@@ -622,7 +622,7 @@ public class Control extends Module{
|
|||||||
tutorial.update();
|
tutorial.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!tutorial.active() && mode != GameMode.sandbox){
|
if(!tutorial.active() && !mode.toggleWaves){
|
||||||
|
|
||||||
if(enemies <= 0){
|
if(enemies <= 0){
|
||||||
wavetime -= delta();
|
wavetime -= delta();
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ public class Renderer extends RendererModule{
|
|||||||
|
|
||||||
camera.position.set(lastx - deltax, lasty - deltay, 0);
|
camera.position.set(lastx - deltax, lasty - deltay, 0);
|
||||||
|
|
||||||
record(); //this only does something if GdxGifRecorder is on the class path, which it usually isn't
|
if(Vars.debug) record(); //this only does something if GdxGifRecorder is on the class path, which it usually isn't
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FrameBuffer buffer = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false);
|
FrameBuffer buffer = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class UI extends SceneModule{
|
|||||||
Tooltip tooltip;
|
Tooltip tooltip;
|
||||||
Tile configTile;
|
Tile configTile;
|
||||||
Array<String> statlist = new Array<>();
|
Array<String> statlist = new Array<>();
|
||||||
MapEditor editor = new MapEditor();
|
MapEditor editor;
|
||||||
boolean wasPaused = false;
|
boolean wasPaused = false;
|
||||||
|
|
||||||
private Fragment blockfrag = new BlocksFragment(),
|
private Fragment blockfrag = new BlocksFragment(),
|
||||||
@@ -175,7 +175,10 @@ public class UI extends SceneModule{
|
|||||||
configtable = new Table();
|
configtable = new Table();
|
||||||
scene.add(configtable);
|
scene.add(configtable);
|
||||||
|
|
||||||
if(!Vars.gwt) editorDialog = new MapEditorDialog(editor);
|
if(!Vars.gwt){
|
||||||
|
editor = new MapEditor();
|
||||||
|
editorDialog = new MapEditorDialog(editor);
|
||||||
|
}
|
||||||
|
|
||||||
settingserror = new Dialog("Warning", "dialog");
|
settingserror = new Dialog("Warning", "dialog");
|
||||||
settingserror.content().add("[crimson]Failed to access local storage.\nSettings will not be saved.");
|
settingserror.content().add("[crimson]Failed to access local storage.\nSettings will not be saved.");
|
||||||
|
|||||||
@@ -113,6 +113,10 @@ public class World extends Module{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Tile[] getNearby(int x, int y){
|
public Tile[] getNearby(int x, int y){
|
||||||
|
return getNearby(x, y, temptiles);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tile[] getNearby(int x, int y, Tile[] temptiles){
|
||||||
temptiles[0] = tile(x+1, y);
|
temptiles[0] = tile(x+1, y);
|
||||||
temptiles[1] = tile(x, y+1);
|
temptiles[1] = tile(x, y+1);
|
||||||
temptiles[2] = tile(x-1, y);
|
temptiles[2] = tile(x-1, y);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
int endx, endy;
|
int endx, endy;
|
||||||
private boolean enableHold = false;
|
private boolean enableHold = false;
|
||||||
private boolean beganBreak;
|
private boolean beganBreak;
|
||||||
|
private boolean rotated = false;
|
||||||
|
|
||||||
@Override public float getCursorEndX(){ return endx; }
|
@Override public float getCursorEndX(){ return endx; }
|
||||||
@Override public float getCursorEndY(){ return endy; }
|
@Override public float getCursorEndY(){ return endy; }
|
||||||
@@ -64,7 +65,12 @@ public class DesktopInput extends InputHandler{
|
|||||||
renderer.scaleCamera((int)Inputs.getAxis("zoom"));
|
renderer.scaleCamera((int)Inputs.getAxis("zoom"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!rotated) {
|
||||||
player.rotation += Inputs.getAxis("rotate_alt");
|
player.rotation += Inputs.getAxis("rotate_alt");
|
||||||
|
rotated = true;
|
||||||
|
}
|
||||||
|
if(!Inputs.getAxisActive("rotate_alt")) rotated = false;
|
||||||
|
|
||||||
player.rotation += Inputs.getAxis("rotate");
|
player.rotation += Inputs.getAxis("rotate");
|
||||||
player.rotation = Mathf.mod(player.rotation, 4);
|
player.rotation = Mathf.mod(player.rotation, 4);
|
||||||
|
|
||||||
@@ -74,8 +80,8 @@ public class DesktopInput extends InputHandler{
|
|||||||
player.breakMode = PlaceMode.hold;
|
player.breakMode = PlaceMode.hold;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 1; i <= 6 && i < control.getWeapons().size; i ++){
|
for(int i = 1; i <= 6 && i <= control.getWeapons().size; i ++){
|
||||||
if(Inputs.keyTap("weapon_" + i) && i < control.getWeapons().size){
|
if(Inputs.keyTap("weapon_" + i)){
|
||||||
player.weapon = control.getWeapons().get(i - 1);
|
player.weapon = control.getWeapons().get(i - 1);
|
||||||
ui.updateWeapons();
|
ui.updateWeapons();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import io.anuke.mindustry.resource.Section;
|
|||||||
import io.anuke.mindustry.ui.FloatingDialog;
|
import io.anuke.mindustry.ui.FloatingDialog;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.core.Draw;
|
||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
|
import io.anuke.ucore.scene.builders.button;
|
||||||
|
import io.anuke.ucore.scene.builders.imagebutton;
|
||||||
import io.anuke.ucore.scene.builders.table;
|
import io.anuke.ucore.scene.builders.table;
|
||||||
import io.anuke.ucore.scene.event.Touchable;
|
import io.anuke.ucore.scene.event.Touchable;
|
||||||
import io.anuke.ucore.scene.ui.*;
|
import io.anuke.ucore.scene.ui.*;
|
||||||
@@ -25,22 +27,26 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
public class BlocksFragment implements Fragment{
|
public class BlocksFragment implements Fragment{
|
||||||
private Table desctable;
|
private Table desctable;
|
||||||
private Array<String> statlist = new Array<>();
|
private Array<String> statlist = new Array<>();
|
||||||
|
private boolean shown = true;
|
||||||
|
|
||||||
public void build(){
|
public void build(){
|
||||||
|
|
||||||
new table(){{
|
new table(){{
|
||||||
abottom();
|
abottom();
|
||||||
aright();
|
aright();
|
||||||
|
|
||||||
new table("button"){{
|
new table(){{
|
||||||
visible(()->player.recipe != null);
|
|
||||||
|
new table("button") {{
|
||||||
|
visible(() -> player.recipe != null);
|
||||||
desctable = get();
|
desctable = get();
|
||||||
fillX();
|
fillX();
|
||||||
}}.end().uniformX();
|
}}.end().uniformX();
|
||||||
|
|
||||||
row();
|
row();
|
||||||
|
|
||||||
new table("pane"){{
|
new table("pane") {{
|
||||||
get().setTouchable(Touchable.enabled);
|
touchable(Touchable.enabled);
|
||||||
int rows = 4;
|
int rows = 4;
|
||||||
int maxcol = 0;
|
int maxcol = 0;
|
||||||
float size = 48;
|
float size = 48;
|
||||||
@@ -49,21 +55,21 @@ public class BlocksFragment implements Fragment{
|
|||||||
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
||||||
Array<Recipe> recipes = new Array<Recipe>();
|
Array<Recipe> recipes = new Array<Recipe>();
|
||||||
|
|
||||||
for(Section sec : Section.values()){
|
for (Section sec : Section.values()) {
|
||||||
recipes.clear();
|
recipes.clear();
|
||||||
Recipe.getBy(sec, recipes);
|
Recipe.getBy(sec, recipes);
|
||||||
maxcol = Math.max((int)((float)recipes.size/rows+1), maxcol);
|
maxcol = Math.max((int) ((float) recipes.size / rows + 1), maxcol);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Section sec : Section.values()){
|
for (Section sec : Section.values()) {
|
||||||
recipes.clear();
|
recipes.clear();
|
||||||
Recipe.getBy(sec, recipes);
|
Recipe.getBy(sec, recipes);
|
||||||
|
|
||||||
Table table = new Table();
|
Table table = new Table();
|
||||||
|
|
||||||
ImageButton button = new ImageButton("icon-"+sec.name(), "toggle");
|
ImageButton button = new ImageButton("icon-" + sec.name(), "toggle");
|
||||||
button.clicked(()->{
|
button.clicked(() -> {
|
||||||
if(!table.isVisible() && player.recipe != null){
|
if (!table.isVisible() && player.recipe != null) {
|
||||||
player.recipe = null;
|
player.recipe = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -72,7 +78,7 @@ public class BlocksFragment implements Fragment{
|
|||||||
button.getImageCell().size(40).padBottom(4).padTop(2);
|
button.getImageCell().size(40).padBottom(4).padTop(2);
|
||||||
group.add(button);
|
group.add(button);
|
||||||
|
|
||||||
if(sec.ordinal() % 3 == 2 && sec.ordinal() > 0){
|
if (sec.ordinal() % 3 == 2 && sec.ordinal() > 0) {
|
||||||
row();
|
row();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,24 +87,24 @@ public class BlocksFragment implements Fragment{
|
|||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for(Recipe r : recipes){
|
for (Recipe r : recipes) {
|
||||||
TextureRegion region = Draw.hasRegion(r.result.name() + "-icon") ?
|
TextureRegion region = Draw.hasRegion(r.result.name() + "-icon") ?
|
||||||
Draw.region(r.result.name() + "-icon") : Draw.region(r.result.name());
|
Draw.region(r.result.name() + "-icon") : Draw.region(r.result.name());
|
||||||
ImageButton image = new ImageButton(region, "select");
|
ImageButton image = new ImageButton(region, "select");
|
||||||
|
|
||||||
image.clicked(()->{
|
image.clicked(() -> {
|
||||||
if(player.recipe == r){
|
if (player.recipe == r) {
|
||||||
player.recipe = null;
|
player.recipe = null;
|
||||||
}else{
|
} else {
|
||||||
player.recipe = r;
|
player.recipe = r;
|
||||||
updateRecipe();
|
updateRecipe();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
table.add(image).size(size+8).pad(2);
|
table.add(image).size(size + 8).pad(2);
|
||||||
image.getImageCell().size(size);
|
image.getImageCell().size(size);
|
||||||
|
|
||||||
image.update(()->{
|
image.update(() -> {
|
||||||
|
|
||||||
boolean canPlace = !control.getTutorial().active() || control.getTutorial().canPlace();
|
boolean canPlace = !control.getTutorial().active() || control.getTutorial().canPlace();
|
||||||
boolean has = (control.hasItems(r.requirements)) && canPlace;
|
boolean has = (control.hasItems(r.requirements)) && canPlace;
|
||||||
@@ -108,13 +114,13 @@ public class BlocksFragment implements Fragment{
|
|||||||
image.getImage().setColor(has ? Color.WHITE : Hue.lightness(0.33f));
|
image.getImage().setColor(has ? Color.WHITE : Hue.lightness(0.33f));
|
||||||
});
|
});
|
||||||
|
|
||||||
if(i % rows == rows-1)
|
if (i % rows == rows - 1)
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.setVisible(()-> button.isChecked());
|
table.setVisible(button::isChecked);
|
||||||
|
|
||||||
stack.add(table);
|
stack.add(table);
|
||||||
}
|
}
|
||||||
@@ -130,7 +136,13 @@ public class BlocksFragment implements Fragment{
|
|||||||
end();
|
end();
|
||||||
}}.right().bottom().uniformX();
|
}}.right().bottom().uniformX();
|
||||||
|
|
||||||
visible(()->!GameState.is(State.menu));
|
visible(() -> !GameState.is(State.menu) && shown);
|
||||||
|
|
||||||
|
}}.end();
|
||||||
|
|
||||||
|
//new imagebutton("icon-arrow-right", 10*2, () -> {
|
||||||
|
// shown = !shown;
|
||||||
|
//}).uniformY().fillY();
|
||||||
|
|
||||||
}}.end();
|
}}.end();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class HudFragment implements Fragment{
|
|||||||
|
|
||||||
itemtable = new table("button").end().top().left().fillX().size(-1).get();
|
itemtable = new table("button").end().top().left().fillX().size(-1).get();
|
||||||
itemtable.setTouchable(Touchable.enabled);
|
itemtable.setTouchable(Touchable.enabled);
|
||||||
itemtable.setVisible(()-> control.getMode() != GameMode.sandbox);
|
itemtable.setVisible(()-> !control.getMode().infiniteResources);
|
||||||
itemcell = get().getCell(itemtable);
|
itemcell = get().getCell(itemtable);
|
||||||
|
|
||||||
get().setVisible(()->!GameState.is(State.menu));
|
get().setVisible(()->!GameState.is(State.menu));
|
||||||
@@ -169,7 +169,7 @@ public class HudFragment implements Fragment{
|
|||||||
|
|
||||||
new label(()-> control.getEnemiesRemaining() > 0 ?
|
new label(()-> control.getEnemiesRemaining() > 0 ?
|
||||||
control.getEnemiesRemaining() + printEnemiesRemaining() :
|
control.getEnemiesRemaining() + printEnemiesRemaining() :
|
||||||
(control.getTutorial().active() || Vars.control.getMode() == GameMode.sandbox) ? "waiting..." : "Wave in " + (int) (control.getWaveCountdown() / 60f))
|
(control.getTutorial().active() || Vars.control.getMode().toggleWaves) ? "waiting..." : "Wave in " + (int) (control.getWaveCountdown() / 60f))
|
||||||
.minWidth(140).left();
|
.minWidth(140).left();
|
||||||
|
|
||||||
margin(12f);
|
margin(12f);
|
||||||
@@ -186,7 +186,7 @@ public class HudFragment implements Fragment{
|
|||||||
Vars.control.runWave();
|
Vars.control.runWave();
|
||||||
}).height(uheight).fillX().right().padTop(-8f).padBottom(-12f).padRight(-36)
|
}).height(uheight).fillX().right().padTop(-8f).padBottom(-12f).padRight(-36)
|
||||||
.padLeft(-10f).width(40f).update(l->{
|
.padLeft(-10f).width(40f).update(l->{
|
||||||
boolean vis = Vars.control.getMode() == GameMode.sandbox && Vars.control.getEnemiesRemaining() <= 0;
|
boolean vis = Vars.control.getMode().toggleWaves && Vars.control.getEnemiesRemaining() <= 0;
|
||||||
boolean paused = GameState.is(State.paused) || !vis;
|
boolean paused = GameState.is(State.paused) || !vis;
|
||||||
|
|
||||||
l.setVisible(vis);
|
l.setVisible(vis);
|
||||||
@@ -200,7 +200,7 @@ public class HudFragment implements Fragment{
|
|||||||
itemtable.clear();
|
itemtable.clear();
|
||||||
itemtable.left();
|
itemtable.left();
|
||||||
|
|
||||||
if(control.getMode() == GameMode.sandbox){
|
if(control.getMode().infiniteResources){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public class Block{
|
|||||||
|
|
||||||
protected static TextureRegion temp = new TextureRegion();
|
protected static TextureRegion temp = new TextureRegion();
|
||||||
|
|
||||||
|
public Tile[] temptiles = new Tile[4];
|
||||||
/**internal name*/
|
/**internal name*/
|
||||||
public final String name;
|
public final String name;
|
||||||
/**internal ID*/
|
/**internal ID*/
|
||||||
@@ -148,7 +149,7 @@ public class Block{
|
|||||||
byte i = tile.getDump();
|
byte i = tile.getDump();
|
||||||
byte pdump = (byte)(i % 4);
|
byte pdump = (byte)(i % 4);
|
||||||
|
|
||||||
Tile[] tiles = tile.getNearby();
|
Tile[] tiles = tile.getNearby(temptiles);
|
||||||
|
|
||||||
for(int j = 0; j < 4; j ++){
|
for(int j = 0; j < 4; j ++){
|
||||||
Tile other = tiles[i];
|
Tile other = tiles[i];
|
||||||
@@ -157,7 +158,6 @@ public class Block{
|
|||||||
tile.setDump((byte)((i+1)%4));
|
tile.setDump((byte)((i+1)%4));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tiles = tile.getNearby();
|
|
||||||
i++;
|
i++;
|
||||||
i %= 4;
|
i %= 4;
|
||||||
}
|
}
|
||||||
@@ -176,7 +176,7 @@ public class Block{
|
|||||||
protected boolean tryDump(Tile tile, int direction, Item todump){
|
protected boolean tryDump(Tile tile, int direction, Item todump){
|
||||||
int i = tile.getDump()%4;
|
int i = tile.getDump()%4;
|
||||||
|
|
||||||
Tile[] tiles = tile.getNearby();
|
Tile[] tiles = tile.getNearby(temptiles);
|
||||||
|
|
||||||
for(int j = 0; j < 4; j ++){
|
for(int j = 0; j < 4; j ++){
|
||||||
Tile other = tiles[i];
|
Tile other = tiles[i];
|
||||||
@@ -194,7 +194,6 @@ public class Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tiles = tile.getNearby();
|
|
||||||
i++;
|
i++;
|
||||||
i %= 4;
|
i %= 4;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
package io.anuke.mindustry.world;
|
package io.anuke.mindustry.world;
|
||||||
|
|
||||||
public enum GameMode{
|
public enum GameMode{
|
||||||
waves, sandbox;
|
waves,
|
||||||
|
sandbox{
|
||||||
|
{
|
||||||
|
infiniteResources = true;
|
||||||
|
toggleWaves = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
freebuild{
|
||||||
|
{
|
||||||
|
toggleWaves = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
public boolean infiniteResources;
|
||||||
|
public boolean toggleWaves;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,14 +42,16 @@ public class Maps implements Disposable{
|
|||||||
throw new RuntimeException("Failed to load maps!");
|
throw new RuntimeException("Failed to load maps!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!loadMapFile(Vars.customMapDirectory.child("maps.json"))){
|
if(!Vars.gwt) {
|
||||||
try{
|
if (!loadMapFile(Vars.customMapDirectory.child("maps.json"))) {
|
||||||
|
try {
|
||||||
Vars.customMapDirectory.child("maps.json").writeString("{}", false);
|
Vars.customMapDirectory.child("maps.json").writeString("{}", false);
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("Failed to create custom map directory!");
|
throw new RuntimeException("Failed to create custom map directory!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void removeMap(Map map){
|
public void removeMap(Map map){
|
||||||
maps.remove(map.id);
|
maps.remove(map.id);
|
||||||
|
|||||||
@@ -214,6 +214,10 @@ public class Tile{
|
|||||||
return Vars.world.getNearby(x, y);
|
return Vars.world.getNearby(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Tile[] getNearby(Tile[] copy){
|
||||||
|
return Vars.world.getNearby(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
public void changed(){
|
public void changed(){
|
||||||
if(entity != null){
|
if(entity != null){
|
||||||
if(entity.added) entity.remove();
|
if(entity.added) entity.remove();
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ public class TunnelConveyor extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean acceptItem(Item item, Tile dest, Tile source){
|
public boolean acceptItem(Item item, Tile dest, Tile source){
|
||||||
|
int rot = source.relativeTo(dest.x, dest.y);
|
||||||
|
if(rot != (dest.getRotation() + 2)%4) return false;
|
||||||
Tile tunnel = getDestTunnel(dest);
|
Tile tunnel = getDestTunnel(dest);
|
||||||
if(tunnel != null){
|
if(tunnel != null){
|
||||||
Tile to = tunnel.getNearby()[tunnel.getRotation()];
|
Tile to = tunnel.getNearby()[tunnel.getRotation()];
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ gwt {
|
|||||||
modules 'io.anuke.mindustry.GdxDefinition'
|
modules 'io.anuke.mindustry.GdxDefinition'
|
||||||
devModules 'io.anuke.mindustry.GdxDefinitionSuperdev'
|
devModules 'io.anuke.mindustry.GdxDefinitionSuperdev'
|
||||||
project.webAppDirName = 'webapp'
|
project.webAppDirName = 'webapp'
|
||||||
|
compiler.style = de.richsource.gradle.plugins.gwt.Style.PRETTY;
|
||||||
|
|
||||||
compiler {
|
compiler {
|
||||||
strict = true;
|
strict = true;
|
||||||
//enableClosureCompiler = true;
|
|
||||||
disableCastChecking = true;
|
disableCastChecking = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user