mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-22 13:48:25 +07:00
Slightly more accurate unit payloads
This commit is contained in:
@ -228,7 +228,7 @@ public class ErekirTechTree{
|
||||
});
|
||||
|
||||
|
||||
node(breach, Seq.with(new Research(siliconArcFurnace)), () -> {
|
||||
node(breach, Seq.with(new Research(siliconArcFurnace), new Research(fabricator)), () -> {
|
||||
node(berylliumWall, () -> {
|
||||
node(berylliumWallLarge, () -> {
|
||||
|
||||
|
@ -812,14 +812,16 @@ public class UnitType extends UnlockableContent{
|
||||
public void draw(Unit unit){
|
||||
if(unit.inFogTo(Vars.player.team())) return;
|
||||
|
||||
boolean isPayload = !unit.isAdded();
|
||||
|
||||
Mechc mech = unit instanceof Mechc ? (Mechc)unit : null;
|
||||
float z = unit.elevation > 0.5f ? (lowAltitude ? Layer.flyingUnitLow : Layer.flyingUnit) : groundLayer + Mathf.clamp(hitSize / 4000f, 0, 0.01f);
|
||||
float z = isPayload ? Draw.z() : unit.elevation > 0.5f ? (lowAltitude ? Layer.flyingUnitLow : Layer.flyingUnit) : groundLayer + Mathf.clamp(hitSize / 4000f, 0, 0.01f);
|
||||
|
||||
if(unit.controller().isBeingControlled(player.unit())){
|
||||
drawControl(unit);
|
||||
}
|
||||
|
||||
if(unit.isFlying() || visualElevation > 0){
|
||||
if(!isPayload && (unit.isFlying() || visualElevation > 0)){
|
||||
Draw.z(Math.min(Layer.darkness, z - 1f));
|
||||
drawShadow(unit);
|
||||
}
|
||||
@ -842,7 +844,7 @@ public class UnitType extends UnlockableContent{
|
||||
drawTank((Unit & Tankc)unit);
|
||||
}
|
||||
|
||||
if(unit instanceof Legsc){
|
||||
if(unit instanceof Legsc && !isPayload){
|
||||
drawLegs((Unit & Legsc)unit);
|
||||
}
|
||||
|
||||
@ -903,10 +905,12 @@ public class UnitType extends UnlockableContent{
|
||||
}
|
||||
}
|
||||
|
||||
if(!isPayload){
|
||||
for(Ability a : unit.abilities){
|
||||
Draw.reset();
|
||||
a.draw(unit);
|
||||
}
|
||||
}
|
||||
|
||||
Draw.reset();
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ public class PausedDialog extends BaseDialog{
|
||||
cont.defaults().width(dw).height(55).pad(5f);
|
||||
|
||||
cont.button("@objective", Icon.info, () -> {
|
||||
//TODO pause game, better dialog.
|
||||
ui.fullText.show("@objective", state.rules.sector.preset.description);
|
||||
}).padTop(-60f).colspan(2)
|
||||
.visible(() -> state.rules.sector != null && state.rules.sector.preset != null && state.rules.sector.preset.description != null).row();
|
||||
|
@ -141,8 +141,8 @@ public class UnitPayload implements Payload{
|
||||
//TODO should not happen
|
||||
if(unit.type == null) return;
|
||||
|
||||
//TODO this would be more accurate but has all sorts of associated problems
|
||||
if(false){
|
||||
//TODO this would be more accurate but has all sorts of associated problems (?)
|
||||
if(true){
|
||||
unit.elevation = 0f;
|
||||
//avoids drawing mining or building
|
||||
unit.type.draw(unit);
|
||||
|
Reference in New Issue
Block a user