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(berylliumWall, () -> {
|
||||||
node(berylliumWallLarge, () -> {
|
node(berylliumWallLarge, () -> {
|
||||||
|
|
||||||
|
|||||||
@@ -812,14 +812,16 @@ public class UnitType extends UnlockableContent{
|
|||||||
public void draw(Unit unit){
|
public void draw(Unit unit){
|
||||||
if(unit.inFogTo(Vars.player.team())) return;
|
if(unit.inFogTo(Vars.player.team())) return;
|
||||||
|
|
||||||
|
boolean isPayload = !unit.isAdded();
|
||||||
|
|
||||||
Mechc mech = unit instanceof Mechc ? (Mechc)unit : null;
|
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())){
|
if(unit.controller().isBeingControlled(player.unit())){
|
||||||
drawControl(unit);
|
drawControl(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(unit.isFlying() || visualElevation > 0){
|
if(!isPayload && (unit.isFlying() || visualElevation > 0)){
|
||||||
Draw.z(Math.min(Layer.darkness, z - 1f));
|
Draw.z(Math.min(Layer.darkness, z - 1f));
|
||||||
drawShadow(unit);
|
drawShadow(unit);
|
||||||
}
|
}
|
||||||
@@ -842,7 +844,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
drawTank((Unit & Tankc)unit);
|
drawTank((Unit & Tankc)unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(unit instanceof Legsc){
|
if(unit instanceof Legsc && !isPayload){
|
||||||
drawLegs((Unit & Legsc)unit);
|
drawLegs((Unit & Legsc)unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -903,9 +905,11 @@ public class UnitType extends UnlockableContent{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Ability a : unit.abilities){
|
if(!isPayload){
|
||||||
Draw.reset();
|
for(Ability a : unit.abilities){
|
||||||
a.draw(unit);
|
Draw.reset();
|
||||||
|
a.draw(unit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ public class PausedDialog extends BaseDialog{
|
|||||||
cont.defaults().width(dw).height(55).pad(5f);
|
cont.defaults().width(dw).height(55).pad(5f);
|
||||||
|
|
||||||
cont.button("@objective", Icon.info, () -> {
|
cont.button("@objective", Icon.info, () -> {
|
||||||
//TODO pause game, better dialog.
|
|
||||||
ui.fullText.show("@objective", state.rules.sector.preset.description);
|
ui.fullText.show("@objective", state.rules.sector.preset.description);
|
||||||
}).padTop(-60f).colspan(2)
|
}).padTop(-60f).colspan(2)
|
||||||
.visible(() -> state.rules.sector != null && state.rules.sector.preset != null && state.rules.sector.preset.description != null).row();
|
.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
|
//TODO should not happen
|
||||||
if(unit.type == null) return;
|
if(unit.type == null) return;
|
||||||
|
|
||||||
//TODO this would be more accurate but has all sorts of associated problems
|
//TODO this would be more accurate but has all sorts of associated problems (?)
|
||||||
if(false){
|
if(true){
|
||||||
unit.elevation = 0f;
|
unit.elevation = 0f;
|
||||||
//avoids drawing mining or building
|
//avoids drawing mining or building
|
||||||
unit.type.draw(unit);
|
unit.type.draw(unit);
|
||||||
|
|||||||
Reference in New Issue
Block a user