Fixed #4319
This commit is contained in:
@@ -74,7 +74,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
|
|
||||||
Events.on(WorldLoadEvent.class, event -> {
|
Events.on(WorldLoadEvent.class, event -> {
|
||||||
if(Mathf.zero(player.x) && Mathf.zero(player.y)){
|
if(Mathf.zero(player.x) && Mathf.zero(player.y)){
|
||||||
Building core = state.teams.closestCore(0, 0, player.team());
|
Building core = player.bestCore();
|
||||||
if(core != null){
|
if(core != null){
|
||||||
player.set(core);
|
player.set(core);
|
||||||
camera.position.set(core);
|
camera.position.set(core);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import mindustry.gen.*;
|
|||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.graphics.g3d.*;
|
import mindustry.graphics.g3d.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||||
|
|
||||||
import static arc.Core.*;
|
import static arc.Core.*;
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
@@ -36,6 +37,7 @@ public class Renderer implements ApplicationListener{
|
|||||||
/** minZoom = zooming out, maxZoom = zooming in */
|
/** minZoom = zooming out, maxZoom = zooming in */
|
||||||
public float minZoom = 1.5f, maxZoom = 6f;
|
public float minZoom = 1.5f, maxZoom = 6f;
|
||||||
|
|
||||||
|
private @Nullable CoreBuild landCore;
|
||||||
//TODO unused
|
//TODO unused
|
||||||
private FxProcessor fx = new FxProcessor();
|
private FxProcessor fx = new FxProcessor();
|
||||||
private Color clearColor = new Color(0f, 0f, 0f, 1f);
|
private Color clearColor = new Color(0f, 0f, 0f, 1f);
|
||||||
@@ -62,6 +64,10 @@ public class Renderer implements ApplicationListener{
|
|||||||
if(settings.getBool("bloom", !ios)){
|
if(settings.getBool("bloom", !ios)){
|
||||||
setupBloom();
|
setupBloom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Events.on(WorldLoadEvent.class, e -> {
|
||||||
|
landCore = player.bestCore();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -284,25 +290,25 @@ public class Renderer implements ApplicationListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawLanding(){
|
private void drawLanding(){
|
||||||
if(landTime > 0 && player.closestCore() != null){
|
CoreBuild entity = landCore == null ? player.bestCore() : landCore;
|
||||||
|
if(landTime > 0 && entity != null){
|
||||||
float fract = landTime / Fx.coreLand.lifetime;
|
float fract = landTime / Fx.coreLand.lifetime;
|
||||||
Building entity = player.closestCore();
|
|
||||||
|
|
||||||
TextureRegion reg = entity.block.icon(Cicon.full);
|
TextureRegion reg = entity.block.icon(Cicon.full);
|
||||||
float scl = Scl.scl(4f) / camerascale;
|
float scl = Scl.scl(4f) / camerascale;
|
||||||
float s = reg.width * Draw.scl * scl * 4f * fract;
|
float s = reg.width * Draw.scl * scl * 4f * fract;
|
||||||
|
|
||||||
Draw.color(Pal.lightTrail);
|
Draw.color(Pal.lightTrail);
|
||||||
Draw.rect("circle-shadow", entity.getX(), entity.getY(), s, s);
|
Draw.rect("circle-shadow", entity.x, entity.y, s, s);
|
||||||
|
|
||||||
Angles.randLenVectors(1, (1f- fract), 100, 1000f * scl * (1f-fract), (x, y, fin, fout) -> {
|
Angles.randLenVectors(1, (1f- fract), 100, 1000f * scl * (1f-fract), (x, y, fin, fout) -> {
|
||||||
Lines.stroke(scl * fin);
|
Lines.stroke(scl * fin);
|
||||||
Lines.lineAngle(entity.getX() + x, entity.getY() + y, Mathf.angle(x, y), (fin * 20 + 1f) * scl);
|
Lines.lineAngle(entity.x + x, entity.y + y, Mathf.angle(x, y), (fin * 20 + 1f) * scl);
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.color();
|
Draw.color();
|
||||||
Draw.mixcol(Color.white, fract);
|
Draw.mixcol(Color.white, fract);
|
||||||
Draw.rect(reg, entity.getX(), entity.getY(), reg.width * Draw.scl * scl, reg.height * Draw.scl * scl, fract * 135f);
|
Draw.rect(reg, entity.x, entity.y, reg.width * Draw.scl * scl, reg.height * Draw.scl * scl, fract * 135f);
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=78fdeeda71a4bb2d46e81d936beccf8727d95388
|
archash=f89e6a465fe9d139bd192960c2ebdff33c2af86a
|
||||||
|
|||||||
Reference in New Issue
Block a user