mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-04 15:27:19 +07:00
Various bugfixes / Updated uCore
This commit is contained in:
@ -25,7 +25,7 @@ allprojects {
|
||||
appName = 'Mindustry'
|
||||
gdxVersion = '1.9.8'
|
||||
roboVMVersion = '2.3.0'
|
||||
uCoreVersion = '8919cb7b6881d040fb720149779fcf58c1927893'
|
||||
uCoreVersion = '2385d794f2cd3db2fb25d320f2223fa2148c25a0'
|
||||
|
||||
getVersionString = {
|
||||
String buildVersion = getBuildVersion()
|
||||
|
@ -4,9 +4,8 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.utils.TimeUtils;
|
||||
import io.anuke.ucore.core.Settings;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.util.Threads.ThreadInfoProvider;
|
||||
|
||||
public class ThreadHandler implements ThreadInfoProvider{
|
||||
public class ThreadHandler{
|
||||
private long lastFrameTime;
|
||||
|
||||
public ThreadHandler(){
|
||||
@ -52,14 +51,4 @@ public class ThreadHandler implements ThreadInfoProvider{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnLogicThread() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnGraphicsThread() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ import io.anuke.ucore.scene.ui.TextField.TextFieldFilter;
|
||||
import io.anuke.ucore.scene.ui.TooltipManager;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
import io.anuke.ucore.util.Threads;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
import static io.anuke.ucore.scene.actions.Actions.*;
|
||||
@ -240,8 +239,6 @@ public class UI extends SceneModule{
|
||||
}
|
||||
|
||||
public void showInfoFade(String info){
|
||||
Threads.assertGraphics();
|
||||
|
||||
Table table = new Table();
|
||||
table.setFillParent(true);
|
||||
table.actions(Actions.fadeOut(7f, Interpolation.fade), Actions.removeActor());
|
||||
@ -250,8 +247,6 @@ public class UI extends SceneModule{
|
||||
}
|
||||
|
||||
public void showInfo(String info){
|
||||
Threads.assertGraphics();
|
||||
|
||||
new Dialog("", "dialog"){{
|
||||
getCell(content()).growX();
|
||||
content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
|
||||
@ -260,8 +255,6 @@ public class UI extends SceneModule{
|
||||
}
|
||||
|
||||
public void showInfo(String info, Runnable clicked){
|
||||
Threads.assertGraphics();
|
||||
|
||||
new Dialog("", "dialog"){{
|
||||
getCell(content()).growX();
|
||||
content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
|
||||
|
@ -13,7 +13,6 @@ import io.anuke.ucore.function.Consumer;
|
||||
import io.anuke.ucore.function.Predicate;
|
||||
import io.anuke.ucore.util.EnumSet;
|
||||
import io.anuke.ucore.util.Geometry;
|
||||
import io.anuke.ucore.util.Threads;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
@ -63,45 +62,20 @@ public class Units{
|
||||
|
||||
/**Can be called from any thread.*/
|
||||
public static boolean anyEntities(Rectangle rect){
|
||||
if(Threads.isLogic()){
|
||||
boolResult = false;
|
||||
boolResult = false;
|
||||
|
||||
Units.getNearby(rect, unit -> {
|
||||
if(boolResult) return;
|
||||
if(!unit.isFlying()){
|
||||
unit.getHitbox(hitrect);
|
||||
Units.getNearby(rect, unit -> {
|
||||
if(boolResult) return;
|
||||
if(!unit.isFlying()){
|
||||
unit.getHitbox(hitrect);
|
||||
|
||||
if(hitrect.overlaps(rect)){
|
||||
boolResult = true;
|
||||
}
|
||||
if(hitrect.overlaps(rect)){
|
||||
boolResult = true;
|
||||
}
|
||||
});
|
||||
|
||||
return boolResult;
|
||||
}else{
|
||||
boolResultGraphics = false;
|
||||
|
||||
for(EntityGroup<? extends BaseUnit> g : unitGroups){
|
||||
g.forEach(u -> {
|
||||
if(u.isFlying()) return;
|
||||
u.getHitbox(rectGraphics);
|
||||
if(rectGraphics.overlaps(rect)){
|
||||
boolResultGraphics = true;
|
||||
}
|
||||
});
|
||||
if(boolResultGraphics) return true;
|
||||
}
|
||||
});
|
||||
|
||||
playerGroup.forEach(u -> {
|
||||
if(u.isFlying()) return;
|
||||
u.getHitbox(rectGraphics);
|
||||
if(rectGraphics.overlaps(rect)){
|
||||
boolResultGraphics = true;
|
||||
}
|
||||
});
|
||||
|
||||
return boolResultGraphics;
|
||||
}
|
||||
return boolResult;
|
||||
}
|
||||
|
||||
/**Returns whether there are any entities on this tile, with the hitbox expanded.*/
|
||||
|
@ -300,10 +300,6 @@ public interface BuilderTrait extends Entity{
|
||||
|
||||
float x1 = tmptr[0].x, y1 = tmptr[0].y,
|
||||
x3 = tmptr[1].x, y3 = tmptr[1].y;
|
||||
Translator close = Geometry.findClosest(unit.x, unit.y, tmptr);
|
||||
float x2 = close.x, y2 = close.y;
|
||||
|
||||
Draw.alpha(0.3f + Mathf.absin(Timers.time(), 0.9f, 0.2f));
|
||||
|
||||
Draw.alpha(1f);
|
||||
|
||||
|
@ -20,7 +20,6 @@ import io.anuke.ucore.function.Consumer;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
import io.anuke.ucore.util.Log;
|
||||
import io.anuke.ucore.util.Pooling;
|
||||
import io.anuke.ucore.util.Threads;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -51,7 +50,6 @@ public class Net{
|
||||
public static void showError(Throwable e){
|
||||
|
||||
if(!headless){
|
||||
Threads.assertGraphics();
|
||||
|
||||
Throwable t = e;
|
||||
while(t.getCause() != null){
|
||||
|
@ -97,7 +97,7 @@ public class PlayerListFragment extends Fragment{
|
||||
button.labelWrap("[#" + player.color.toString().toUpperCase() + "]" + player.name).width(170f).pad(10);
|
||||
button.add().grow();
|
||||
|
||||
button.addImage("icon-admin").size(14 * 2).visible(() -> player.isAdmin && !(!player.isLocal && Net.server())).padRight(5);
|
||||
button.addImage("icon-admin").size(14 * 2).visible(() -> player.isAdmin && !(!player.isLocal && Net.server())).padRight(5).get().updateVisibility();
|
||||
|
||||
if((Net.server() || players[0].isAdmin) && !player.isLocal && (!player.isAdmin || Net.server())){
|
||||
button.add().growY();
|
||||
|
@ -17,7 +17,6 @@ import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class Build{
|
||||
private static final Rectangle rect = new Rectangle();
|
||||
private static final Rectangle hitrect = new Rectangle();
|
||||
|
||||
/**Returns block type that was broken, or null if unsuccesful.*/
|
||||
public static void beginBreak(Team team, int x, int y){
|
||||
|
@ -25,7 +25,6 @@ import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.scene.ui.Image;
|
||||
import io.anuke.ucore.scene.ui.layout.Cell;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
import io.anuke.ucore.util.Threads;
|
||||
|
||||
import static io.anuke.mindustry.Vars.content;
|
||||
public class Drill extends Block{
|
||||
@ -221,7 +220,7 @@ public class Drill extends Block{
|
||||
@Override
|
||||
public boolean canPlaceOn(Tile tile){
|
||||
if(isMultiblock()){
|
||||
for(Tile other : tile.getLinkedTilesAs(this, Threads.isLogic() ? tempTiles : drawTiles)){
|
||||
for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){
|
||||
if(isValid(other)){
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user