Fixed #3657
This commit is contained in:
@@ -90,8 +90,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
public float prefRotation(){
|
public float prefRotation(){
|
||||||
if(activelyBuilding()){
|
if(activelyBuilding()){
|
||||||
return angleTo(buildPlan());
|
return angleTo(buildPlan());
|
||||||
}else if(mineTile() != null){
|
}else if(mineTile != null){
|
||||||
return angleTo(mineTile());
|
return angleTo(mineTile);
|
||||||
}else if(moving()){
|
}else if(moving()){
|
||||||
return vel().angle();
|
return vel().angle();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class PlanetRenderer implements Disposable{
|
|||||||
public final VertexBatch3D batch = new VertexBatch3D(20000, false, true, 0);
|
public final VertexBatch3D batch = new VertexBatch3D(20000, false, true, 0);
|
||||||
|
|
||||||
public float zoom = 1f;
|
public float zoom = 1f;
|
||||||
|
public float orbitAlpha = 1f;
|
||||||
|
|
||||||
private final Mesh[] outlines = new Mesh[10];
|
private final Mesh[] outlines = new Mesh[10];
|
||||||
public final PlaneBatch3D projector = new PlaneBatch3D();
|
public final PlaneBatch3D projector = new PlaneBatch3D();
|
||||||
@@ -168,7 +169,7 @@ public class PlanetRenderer implements Disposable{
|
|||||||
Vec3 center = planet.parent.position;
|
Vec3 center = planet.parent.position;
|
||||||
float radius = planet.orbitRadius;
|
float radius = planet.orbitRadius;
|
||||||
int points = (int)(radius * 10);
|
int points = (int)(radius * 10);
|
||||||
Angles.circleVectors(points, radius, (cx, cy) -> batch.vertex(Tmp.v32.set(center).add(cx, 0, cy), Pal.gray));
|
Angles.circleVectors(points, radius, (cx, cy) -> batch.vertex(Tmp.v32.set(center).add(cx, 0, cy), Pal.gray.write(Tmp.c1).a(orbitAlpha)));
|
||||||
batch.flush(Gl.lineLoop);
|
batch.flush(Gl.lineLoop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -629,8 +629,8 @@ public class DesktopInput extends InputHandler{
|
|||||||
unit.moveAt(movement);
|
unit.moveAt(movement);
|
||||||
}else{
|
}else{
|
||||||
unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len()));
|
unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len()));
|
||||||
if(!movement.isZero() && ground){
|
if(!movement.isZero()){
|
||||||
unit.vel.rotateTo(movement.angle(), unit.type.rotateSpeed);
|
unit.vel.rotateTo(movement.angle(), unit.type.rotateSpeed * Math.max(Time.delta, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -836,7 +836,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
if(type == null) return;
|
if(type == null) return;
|
||||||
|
|
||||||
boolean omni = unit.type.omniMovement;
|
boolean omni = unit.type.omniMovement;
|
||||||
boolean legs = unit.isGrounded();
|
boolean ground = unit.isGrounded();
|
||||||
boolean allowHealing = type.canHeal;
|
boolean allowHealing = type.canHeal;
|
||||||
boolean validHealTarget = allowHealing && target instanceof Building && ((Building)target).isValid() && target.team() == unit.team &&
|
boolean validHealTarget = allowHealing && target instanceof Building && ((Building)target).isValid() && target.team() == unit.team &&
|
||||||
((Building)target).damaged() && target.within(unit, type.range);
|
((Building)target).damaged() && target.within(unit, type.range);
|
||||||
@@ -908,8 +908,8 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
unit.moveAt(movement);
|
unit.moveAt(movement);
|
||||||
}else{
|
}else{
|
||||||
unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len()));
|
unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len()));
|
||||||
if(!movement.isZero() && legs){
|
if(!movement.isZero()){
|
||||||
unit.vel.rotateTo(movement.angle(), type.rotateSpeed);
|
unit.vel.rotateTo(movement.angle(), unit.type.rotateSpeed * Math.max(Time.delta, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -409,6 +409,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
|
planets.orbitAlpha = selectAlpha;
|
||||||
planets.render(PlanetDialog.this);
|
planets.render(PlanetDialog.this);
|
||||||
if(Core.scene.getDialog() == PlanetDialog.this){
|
if(Core.scene.getDialog() == PlanetDialog.this){
|
||||||
Core.scene.setScrollFocus(PlanetDialog.this);
|
Core.scene.setScrollFocus(PlanetDialog.this);
|
||||||
|
|||||||
Reference in New Issue
Block a user