Bugfixes
This commit is contained in:
@@ -28,8 +28,7 @@ import io.anuke.mindustry.world.blocks.units.UnitFactory;
|
||||
import io.anuke.mindustry.world.consumers.ConsumeItemFilter;
|
||||
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
||||
|
||||
import static io.anuke.mindustry.Vars.content;
|
||||
import static io.anuke.mindustry.Vars.state;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class Blocks implements ContentList{
|
||||
public static Block
|
||||
@@ -187,8 +186,9 @@ public class Blocks implements ContentList{
|
||||
}};
|
||||
|
||||
ice = new Floor("ice"){{
|
||||
dragMultiplier = 0.2f;
|
||||
speedMultiplier = 0.1f;
|
||||
//TODO fix
|
||||
dragMultiplier = 1f;
|
||||
speedMultiplier = 1f;
|
||||
}};
|
||||
|
||||
cliffs = new StaticWall("cliffs"){{
|
||||
@@ -300,7 +300,7 @@ public class Blocks implements ContentList{
|
||||
//region crafting
|
||||
|
||||
graphitePress = new GenericCrafter("graphite-press"){{
|
||||
requirements(Category.crafting, ItemStack.with(Items.copper, 300, Items.lead, 50));
|
||||
requirements(Category.crafting, ItemStack.with(Items.copper, 200, Items.lead, 60));
|
||||
|
||||
craftEffect = Fx.pulverizeMedium;
|
||||
output = Items.graphite;
|
||||
@@ -1029,7 +1029,7 @@ public class Blocks implements ContentList{
|
||||
}};
|
||||
|
||||
launchPad = new LaunchPad("launch-pad"){{
|
||||
requirements(Category.effect, ItemStack.with(Items.copper, 500, Items.titanium, 200, Items.silicon, 200, Items.lead, 200));
|
||||
requirements(Category.effect, () -> world.isZone(), ItemStack.with(Items.copper, 500, Items.titanium, 200, Items.silicon, 200, Items.lead, 200));
|
||||
size = 3;
|
||||
itemCapacity = 100;
|
||||
launchTime = 60f * 6;
|
||||
|
||||
38
core/src/io/anuke/mindustry/ui/ItemsDisplay.java
Normal file
38
core/src/io/anuke/mindustry/ui/ItemsDisplay.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package io.anuke.mindustry.ui;
|
||||
|
||||
import io.anuke.arc.collection.ObjectIntMap;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.ItemType;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
import static io.anuke.mindustry.Vars.content;
|
||||
import static io.anuke.mindustry.Vars.data;
|
||||
|
||||
public class ItemsDisplay extends Table{
|
||||
private static final NumberFormat format = NumberFormat.getNumberInstance(Locale.getDefault());
|
||||
|
||||
public ItemsDisplay(){
|
||||
rebuild();
|
||||
}
|
||||
|
||||
public void rebuild(){
|
||||
clear();
|
||||
top().left();
|
||||
|
||||
table("flat", t -> {
|
||||
t.margin(4);
|
||||
ObjectIntMap<Item> items = data.items();
|
||||
for(Item item : content.items()){
|
||||
if(item.type == ItemType.material && data.isUnlocked(item)){
|
||||
t.label(() -> format.format(items.get(item, 0))).left();
|
||||
t.addImage(item.region).size(8*3).padLeft(4).padRight(4);
|
||||
t.add("[LIGHT_GRAY]" + item.localizedName()).left();
|
||||
t.row();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.collection.ObjectIntMap;
|
||||
import io.anuke.arc.collection.ObjectSet;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.Lines;
|
||||
@@ -16,10 +15,9 @@ import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.game.Saves.SaveSlot;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.io.SaveIO.SaveException;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.type.ItemType;
|
||||
import io.anuke.mindustry.type.Zone;
|
||||
import io.anuke.mindustry.ui.ItemsDisplay;
|
||||
import io.anuke.mindustry.ui.TreeLayout;
|
||||
import io.anuke.mindustry.ui.TreeLayout.TreeNode;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
@@ -93,20 +91,7 @@ public class DeployDialog extends FloatingDialog{
|
||||
});
|
||||
}).growX().height(50f).pad(-12).padTop(10);
|
||||
|
||||
}}, new Table(){{
|
||||
top().left().margin(10);
|
||||
|
||||
ObjectIntMap<Item> items = data.items();
|
||||
for(Item item : content.items()){
|
||||
if(item.type == ItemType.material && data.isUnlocked(item)){
|
||||
label(() -> items.get(item, 0) + "").left();
|
||||
addImage(item.region).size(8*4).pad(4);
|
||||
add("[LIGHT_GRAY]" + item.localizedName()).left();
|
||||
row();
|
||||
}
|
||||
}
|
||||
|
||||
}}).grow();
|
||||
}}, new ItemsDisplay()).grow();
|
||||
}
|
||||
|
||||
boolean hidden(Zone zone){
|
||||
|
||||
@@ -20,6 +20,7 @@ import io.anuke.mindustry.content.TechTree;
|
||||
import io.anuke.mindustry.content.TechTree.TechNode;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.ui.ItemsDisplay;
|
||||
import io.anuke.mindustry.ui.TreeLayout;
|
||||
import io.anuke.mindustry.ui.TreeLayout.TreeNode;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
@@ -28,9 +29,10 @@ import io.anuke.mindustry.world.Block.Icon;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class TechTreeDialog extends FloatingDialog{
|
||||
private static final float nodeSize = 60f;
|
||||
private ObjectSet<TechTreeNode> nodes = new ObjectSet<>();
|
||||
private TechTreeNode root = new TechTreeNode(TechTree.root, null);
|
||||
private static final float nodeSize = 60f;
|
||||
private ItemsDisplay items;
|
||||
|
||||
public TechTreeDialog(){
|
||||
super("");
|
||||
@@ -40,8 +42,9 @@ public class TechTreeDialog extends FloatingDialog{
|
||||
layout.gapBetweenNodes = 40f;
|
||||
layout.layout(root);
|
||||
|
||||
cont.setFillParent(true);
|
||||
cont.add(new View()).grow();
|
||||
titleTable.remove();
|
||||
margin(0f);
|
||||
cont.stack(new View(), items = new ItemsDisplay()).grow();
|
||||
|
||||
{ //debug code; TODO remove
|
||||
ObjectSet<Block> used = new ObjectSet<Block>().select(t -> true);
|
||||
@@ -74,6 +77,8 @@ public class TechTreeDialog extends FloatingDialog{
|
||||
l.visible = !locked && l.node.block.isVisible();
|
||||
checkNodes(l);
|
||||
}
|
||||
|
||||
items.rebuild();
|
||||
}
|
||||
|
||||
void showToast(String info){
|
||||
|
||||
@@ -73,8 +73,10 @@ public class PlacementFragment extends Fragment{
|
||||
void rebuild(){
|
||||
currentCategory = Category.turret;
|
||||
Group group = toggler.getParent();
|
||||
int index = toggler.getZIndex();
|
||||
toggler.remove();
|
||||
build(group);
|
||||
toggler.setZIndex(index);
|
||||
}
|
||||
|
||||
boolean gridUpdate(InputHandler input){
|
||||
|
||||
@@ -6,16 +6,16 @@ import io.anuke.arc.Core;
|
||||
import io.anuke.arc.Events;
|
||||
import io.anuke.arc.Graphics.Cursor;
|
||||
import io.anuke.arc.Graphics.Cursor.SystemCursor;
|
||||
import io.anuke.mindustry.entities.Effects;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.mindustry.content.Fx;
|
||||
import io.anuke.mindustry.entities.Effects;
|
||||
import io.anuke.mindustry.entities.effect.RubbleDecal;
|
||||
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;
|
||||
import io.anuke.mindustry.entities.type.Player;
|
||||
import io.anuke.mindustry.entities.type.TileEntity;
|
||||
import io.anuke.mindustry.entities.type.Unit;
|
||||
import io.anuke.mindustry.entities.effect.RubbleDecal;
|
||||
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;
|
||||
import io.anuke.mindustry.game.EventType.BlockBuildEndEvent;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
@@ -280,7 +280,7 @@ public class BuildBlock extends Block{
|
||||
public void setDeconstruct(Block previous){
|
||||
this.previous = previous;
|
||||
this.progress = 1f;
|
||||
if(previous.buildCost > 1f){
|
||||
if(previous.buildCost >= 0.01f){
|
||||
this.block = previous;
|
||||
this.accumulator = new float[previous.buildRequirements.length];
|
||||
this.totalAccumulator = new float[previous.buildRequirements.length];
|
||||
|
||||
@@ -9,6 +9,7 @@ import io.anuke.mindustry.type.ItemType;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
|
||||
import static io.anuke.mindustry.Vars.data;
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
public class LaunchPad extends StorageBlock{
|
||||
protected final int timerLaunch = timers++;
|
||||
@@ -31,7 +32,7 @@ public class LaunchPad extends StorageBlock{
|
||||
public void update(Tile tile){
|
||||
TileEntity entity = tile.entity;
|
||||
|
||||
if(entity.cons.valid()){
|
||||
if(entity.cons.valid() && world.isZone()){
|
||||
for(Item item : Vars.content.items()){
|
||||
if(entity.items.get(item) >= itemCapacity && entity.timer.get(timerLaunch, launchTime)){
|
||||
//TODO play animation of some sort
|
||||
|
||||
Reference in New Issue
Block a user