Removed all tmps, multithreading now functional

This commit is contained in:
Anuken
2018-02-06 18:48:10 -05:00
parent 2fafb327c2
commit 59285f76c4
21 changed files with 92 additions and 81 deletions
@@ -1,6 +1,7 @@
package io.anuke.mindustry.ui.dialogs;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Vector2;
import io.anuke.mindustry.game.Difficulty;
import io.anuke.mindustry.game.GameMode;
import io.anuke.mindustry.world.Map;
@@ -16,7 +17,6 @@ import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.ucore.scene.utils.Elements;
import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Tmp;
import static io.anuke.mindustry.Vars.*;
@@ -133,13 +133,15 @@ public class LevelDialog extends FloatingDialog{
});
}).width(images+16).padBottom(-10f).grow().get();
}
Vector2 hit = new Vector2();
image.addListener(new ClickListener(){
public void clicked(InputEvent event, float x, float y){
image.localToStageCoordinates(Tmp.v1.set(x, y));
image.localToStageCoordinates(hit.set(x, y));
if(delete[0] != null && (delete[0].getClickListener().isOver() || delete[0].getClickListener().isPressed()
|| (Core.scene.hit(Tmp.v1.x, Tmp.v1.y, true) != null &&
Core.scene.hit(Tmp.v1.x, Tmp.v1.y, true).isDescendantOf(delete[0])))){
|| (Core.scene.hit(hit.x, hit.y, true) != null &&
Core.scene.hit(hit.x, hit.y, true).isDescendantOf(delete[0])))){
return;
}
@@ -2,7 +2,6 @@ package io.anuke.mindustry.ui.fragments;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.net.Net;
import io.anuke.ucore.scene.builders.button;
@@ -50,7 +49,7 @@ public class DebugFragment implements Fragment {
row();
new button("infammo", "toggle", () -> infiniteAmmo = !infiniteAmmo);
row();
new button("wave", () -> logic.runWave());
new button("wave", () -> state.wavetime = 0f);
row();
new button("clear", () -> {
enemyGroup.clear();
@@ -58,9 +57,7 @@ public class DebugFragment implements Fragment {
netClient.clearRecieved();
});
row();
new button("spawn", () -> {try{ Net.connect("localhost", Vars.port); }catch (Exception e){e.printStackTrace();}});
row();
new button("stuff", () -> netClient.test());
new button("spawn", () -> {});
row();
}}.end();
@@ -194,7 +194,7 @@ public class HudFragment implements Fragment{
private void playButton(float uheight){
new imagebutton("icon-play", 30f, () -> {
logic.runWave();
state.wavetime = 0f;
}).height(uheight).fillX().right().padTop(-8f).padBottom(-12f).padRight(-36).width(40f).update(l->{
boolean vis = state.enemies <= 0 && (Net.server() || !Net.active());
boolean paused = state.is(State.paused) || !vis;