Closes Anuken/Mindustry-Suggestions/issues/5967
This commit is contained in:
@@ -116,7 +116,7 @@ public class Blocks{
|
||||
|
||||
//transport
|
||||
conveyor, titaniumConveyor, plastaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, router,
|
||||
overflowGate, underflowGate, massDriver,
|
||||
overflowGate, underflowGate, unloader, massDriver,
|
||||
|
||||
//transport - alternate
|
||||
duct, armoredDuct, ductRouter, overflowDuct, underflowDuct, ductBridge, ductUnloader,
|
||||
@@ -143,7 +143,7 @@ public class Blocks{
|
||||
cliffCrusher, largeCliffCrusher, plasmaBore, largePlasmaBore, impactDrill, eruptionDrill,
|
||||
|
||||
//storage
|
||||
coreShard, coreFoundation, coreNucleus, vault, container, unloader,
|
||||
coreShard, coreFoundation, coreNucleus, vault, container,
|
||||
//storage - erekir
|
||||
coreBastion, coreCitadel, coreAcropolis, reinforcedContainer, reinforcedVault,
|
||||
|
||||
@@ -2154,6 +2154,12 @@ public class Blocks{
|
||||
invert = true;
|
||||
}};
|
||||
|
||||
unloader = new Unloader("unloader"){{
|
||||
requirements(Category.distribution, with(Items.titanium, 25, Items.silicon, 30));
|
||||
speed = 60f / 11f;
|
||||
group = BlockGroup.transportation;
|
||||
}};
|
||||
|
||||
massDriver = new MassDriver("mass-driver"){{
|
||||
requirements(Category.distribution, with(Items.titanium, 125, Items.silicon, 75, Items.lead, 125, Items.thorium, 50));
|
||||
size = 3;
|
||||
@@ -3218,13 +3224,6 @@ public class Blocks{
|
||||
scaledHealth = 55;
|
||||
}};
|
||||
|
||||
//TODO move tabs?
|
||||
unloader = new Unloader("unloader"){{
|
||||
requirements(Category.effect, with(Items.titanium, 25, Items.silicon, 30));
|
||||
speed = 60f / 11f;
|
||||
group = BlockGroup.transportation;
|
||||
}};
|
||||
|
||||
reinforcedContainer = new StorageBlock("reinforced-container"){{
|
||||
requirements(Category.effect, with(Items.tungsten, 30, Items.graphite, 40));
|
||||
size = 2;
|
||||
|
||||
@@ -1172,6 +1172,24 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
Draw.draw(Layer.groundUnit - 1, () -> {
|
||||
drawCommanded(false);
|
||||
});
|
||||
|
||||
Draw.draw(Layer.overlayUI, () -> {
|
||||
drawCommandedTargets();
|
||||
});
|
||||
}
|
||||
|
||||
public void drawCommandedTargets(){
|
||||
if(commandMode){
|
||||
for(Unit unit : selectedUnits){
|
||||
if(unit.controller() instanceof CommandAI ai){
|
||||
var cmd = ai.currentCommand();
|
||||
|
||||
if(ai.attackTarget != null && cmd.drawTarget){
|
||||
Drawf.target(ai.attackTarget.getX(), ai.attackTarget.getY(), 6f, Pal.remove);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void drawCommanded(boolean flying){
|
||||
@@ -1183,7 +1201,6 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
//happens sometimes
|
||||
selectedUnits.removeAll(u -> !u.allowCommand());
|
||||
|
||||
//draw command overlay UI
|
||||
for(Unit unit : selectedUnits){
|
||||
|
||||
Color color = unit.controller() instanceof LogicAI ? Team.malis.color : Pal.accent;
|
||||
@@ -1194,10 +1211,6 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
var cmd = ai.currentCommand();
|
||||
lastPos = ai.attackTarget != null ? ai.attackTarget : ai.targetPos;
|
||||
|
||||
if(flying && ai.attackTarget != null && cmd.drawTarget){
|
||||
Drawf.target(ai.attackTarget.getX(), ai.attackTarget.getY(), 6f, Pal.remove);
|
||||
}
|
||||
|
||||
if(unit.isFlying() != flying) continue;
|
||||
|
||||
//draw target line
|
||||
|
||||
@@ -415,7 +415,7 @@ public class DataPatcher{
|
||||
}catch(Throwable e){
|
||||
warn("Failed to read value @.@ = @: (type = @ elementType = @)\n@", object, field, value, metadata.type, metadata.elementType, Strings.getSimpleMessages(e));
|
||||
}
|
||||
parser.listeners.pop();
|
||||
parser.listeners.pop();
|
||||
}else{
|
||||
//assign each field manually
|
||||
var childFields = parser.getJson().getFields(prevValue.getClass().isAnonymousClass() ? prevValue.getClass().getSuperclass() : prevValue.getClass());
|
||||
|
||||
Reference in New Issue
Block a user