Bugfixes
|
Before Width: | Height: | Size: 93 B After Width: | Height: | Size: 93 B |
|
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
|
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 385 B |
|
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 135 B |
|
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 378 B |
|
Before Width: | Height: | Size: 90 B After Width: | Height: | Size: 90 B |
|
Before Width: | Height: | Size: 117 B After Width: | Height: | Size: 117 B |
|
Before Width: | Height: | Size: 114 B After Width: | Height: | Size: 114 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 433 B After Width: | Height: | Size: 433 B |
|
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 423 B |
|
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 156 B |
|
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 409 B |
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 99 B After Width: | Height: | Size: 99 B |
|
Before Width: | Height: | Size: 97 B After Width: | Height: | Size: 97 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 354 B After Width: | Height: | Size: 354 B |
|
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 209 B |
|
Before Width: | Height: | Size: 98 B After Width: | Height: | Size: 98 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
@@ -2419,6 +2419,20 @@ vault
|
|||||||
orig: 96, 96
|
orig: 96, 96
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
|
arc
|
||||||
|
rotate: false
|
||||||
|
xy: 2013, 1570
|
||||||
|
size: 32, 32
|
||||||
|
orig: 32, 32
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
arc-heat
|
||||||
|
rotate: false
|
||||||
|
xy: 2013, 1536
|
||||||
|
size: 32, 32
|
||||||
|
orig: 32, 32
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
block-1
|
block-1
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1853, 748
|
xy: 1853, 748
|
||||||
@@ -2447,20 +2461,6 @@ block-4
|
|||||||
orig: 128, 128
|
orig: 128, 128
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
arc
|
|
||||||
rotate: false
|
|
||||||
xy: 2013, 1570
|
|
||||||
size: 32, 32
|
|
||||||
orig: 32, 32
|
|
||||||
offset: 0, 0
|
|
||||||
index: -1
|
|
||||||
arc-heat
|
|
||||||
rotate: false
|
|
||||||
xy: 2013, 1536
|
|
||||||
size: 32, 32
|
|
||||||
orig: 32, 32
|
|
||||||
offset: 0, 0
|
|
||||||
index: -1
|
|
||||||
cyclone
|
cyclone
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 291, 12
|
xy: 291, 12
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
@@ -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.ConsumeItemFilter;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.content;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
import static io.anuke.mindustry.Vars.state;
|
|
||||||
|
|
||||||
public class Blocks implements ContentList{
|
public class Blocks implements ContentList{
|
||||||
public static Block
|
public static Block
|
||||||
@@ -187,8 +186,9 @@ public class Blocks implements ContentList{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
ice = new Floor("ice"){{
|
ice = new Floor("ice"){{
|
||||||
dragMultiplier = 0.2f;
|
//TODO fix
|
||||||
speedMultiplier = 0.1f;
|
dragMultiplier = 1f;
|
||||||
|
speedMultiplier = 1f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
cliffs = new StaticWall("cliffs"){{
|
cliffs = new StaticWall("cliffs"){{
|
||||||
@@ -300,7 +300,7 @@ public class Blocks implements ContentList{
|
|||||||
//region crafting
|
//region crafting
|
||||||
|
|
||||||
graphitePress = new GenericCrafter("graphite-press"){{
|
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;
|
craftEffect = Fx.pulverizeMedium;
|
||||||
output = Items.graphite;
|
output = Items.graphite;
|
||||||
@@ -1029,7 +1029,7 @@ public class Blocks implements ContentList{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
launchPad = new LaunchPad("launch-pad"){{
|
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;
|
size = 3;
|
||||||
itemCapacity = 100;
|
itemCapacity = 100;
|
||||||
launchTime = 60f * 6;
|
launchTime = 60f * 6;
|
||||||
|
|||||||
@@ -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.Core;
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.Array;
|
||||||
import io.anuke.arc.collection.ObjectIntMap;
|
|
||||||
import io.anuke.arc.collection.ObjectSet;
|
import io.anuke.arc.collection.ObjectSet;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.graphics.g2d.Lines;
|
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.game.Saves.SaveSlot;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
import io.anuke.mindustry.io.SaveIO.SaveException;
|
import io.anuke.mindustry.io.SaveIO.SaveException;
|
||||||
import io.anuke.mindustry.type.Item;
|
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
import io.anuke.mindustry.type.ItemType;
|
|
||||||
import io.anuke.mindustry.type.Zone;
|
import io.anuke.mindustry.type.Zone;
|
||||||
|
import io.anuke.mindustry.ui.ItemsDisplay;
|
||||||
import io.anuke.mindustry.ui.TreeLayout;
|
import io.anuke.mindustry.ui.TreeLayout;
|
||||||
import io.anuke.mindustry.ui.TreeLayout.TreeNode;
|
import io.anuke.mindustry.ui.TreeLayout.TreeNode;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
@@ -93,20 +91,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
});
|
});
|
||||||
}).growX().height(50f).pad(-12).padTop(10);
|
}).growX().height(50f).pad(-12).padTop(10);
|
||||||
|
|
||||||
}}, new Table(){{
|
}}, new ItemsDisplay()).grow();
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hidden(Zone zone){
|
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.content.TechTree.TechNode;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
|
import io.anuke.mindustry.ui.ItemsDisplay;
|
||||||
import io.anuke.mindustry.ui.TreeLayout;
|
import io.anuke.mindustry.ui.TreeLayout;
|
||||||
import io.anuke.mindustry.ui.TreeLayout.TreeNode;
|
import io.anuke.mindustry.ui.TreeLayout.TreeNode;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
@@ -28,9 +29,10 @@ import io.anuke.mindustry.world.Block.Icon;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class TechTreeDialog extends FloatingDialog{
|
public class TechTreeDialog extends FloatingDialog{
|
||||||
|
private static final float nodeSize = 60f;
|
||||||
private ObjectSet<TechTreeNode> nodes = new ObjectSet<>();
|
private ObjectSet<TechTreeNode> nodes = new ObjectSet<>();
|
||||||
private TechTreeNode root = new TechTreeNode(TechTree.root, null);
|
private TechTreeNode root = new TechTreeNode(TechTree.root, null);
|
||||||
private static final float nodeSize = 60f;
|
private ItemsDisplay items;
|
||||||
|
|
||||||
public TechTreeDialog(){
|
public TechTreeDialog(){
|
||||||
super("");
|
super("");
|
||||||
@@ -40,8 +42,9 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
layout.gapBetweenNodes = 40f;
|
layout.gapBetweenNodes = 40f;
|
||||||
layout.layout(root);
|
layout.layout(root);
|
||||||
|
|
||||||
cont.setFillParent(true);
|
titleTable.remove();
|
||||||
cont.add(new View()).grow();
|
margin(0f);
|
||||||
|
cont.stack(new View(), items = new ItemsDisplay()).grow();
|
||||||
|
|
||||||
{ //debug code; TODO remove
|
{ //debug code; TODO remove
|
||||||
ObjectSet<Block> used = new ObjectSet<Block>().select(t -> true);
|
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();
|
l.visible = !locked && l.node.block.isVisible();
|
||||||
checkNodes(l);
|
checkNodes(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
items.rebuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
void showToast(String info){
|
void showToast(String info){
|
||||||
|
|||||||
@@ -73,8 +73,10 @@ public class PlacementFragment extends Fragment{
|
|||||||
void rebuild(){
|
void rebuild(){
|
||||||
currentCategory = Category.turret;
|
currentCategory = Category.turret;
|
||||||
Group group = toggler.getParent();
|
Group group = toggler.getParent();
|
||||||
|
int index = toggler.getZIndex();
|
||||||
toggler.remove();
|
toggler.remove();
|
||||||
build(group);
|
build(group);
|
||||||
|
toggler.setZIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean gridUpdate(InputHandler input){
|
boolean gridUpdate(InputHandler input){
|
||||||
|
|||||||
@@ -6,16 +6,16 @@ import io.anuke.arc.Core;
|
|||||||
import io.anuke.arc.Events;
|
import io.anuke.arc.Events;
|
||||||
import io.anuke.arc.Graphics.Cursor;
|
import io.anuke.arc.Graphics.Cursor;
|
||||||
import io.anuke.arc.Graphics.Cursor.SystemCursor;
|
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.Draw;
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.mindustry.content.Fx;
|
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.Player;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.entities.type.Unit;
|
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.EventType.BlockBuildEndEvent;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.mindustry.gen.Call;
|
import io.anuke.mindustry.gen.Call;
|
||||||
@@ -280,7 +280,7 @@ public class BuildBlock extends Block{
|
|||||||
public void setDeconstruct(Block previous){
|
public void setDeconstruct(Block previous){
|
||||||
this.previous = previous;
|
this.previous = previous;
|
||||||
this.progress = 1f;
|
this.progress = 1f;
|
||||||
if(previous.buildCost > 1f){
|
if(previous.buildCost >= 0.01f){
|
||||||
this.block = previous;
|
this.block = previous;
|
||||||
this.accumulator = new float[previous.buildRequirements.length];
|
this.accumulator = new float[previous.buildRequirements.length];
|
||||||
this.totalAccumulator = 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 io.anuke.mindustry.world.Tile;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.data;
|
import static io.anuke.mindustry.Vars.data;
|
||||||
|
import static io.anuke.mindustry.Vars.world;
|
||||||
|
|
||||||
public class LaunchPad extends StorageBlock{
|
public class LaunchPad extends StorageBlock{
|
||||||
protected final int timerLaunch = timers++;
|
protected final int timerLaunch = timers++;
|
||||||
@@ -31,7 +32,7 @@ public class LaunchPad extends StorageBlock{
|
|||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
TileEntity entity = tile.entity;
|
TileEntity entity = tile.entity;
|
||||||
|
|
||||||
if(entity.cons.valid()){
|
if(entity.cons.valid() && world.isZone()){
|
||||||
for(Item item : Vars.content.items()){
|
for(Item item : Vars.content.items()){
|
||||||
if(entity.items.get(item) >= itemCapacity && entity.timer.get(timerLaunch, launchTime)){
|
if(entity.items.get(item) >= itemCapacity && entity.timer.get(timerLaunch, launchTime)){
|
||||||
//TODO play animation of some sort
|
//TODO play animation of some sort
|
||||||
|
|||||||
@@ -11,7 +11,11 @@ import java.awt.image.BufferedImage
|
|||||||
|
|
||||||
def outFolder = "../core/assets-raw/sprites_out/"
|
def outFolder = "../core/assets-raw/sprites_out/"
|
||||||
def genFolder = "../core/assets-raw/sprites_out/generated/"
|
def genFolder = "../core/assets-raw/sprites_out/generated/"
|
||||||
|
def doAntialias = true
|
||||||
|
|
||||||
def antialias = {File file ->
|
def antialias = {File file ->
|
||||||
|
if(!doAntialias) return
|
||||||
|
|
||||||
def image = ImageIO.read(file)
|
def image = ImageIO.read(file)
|
||||||
def out = ImageIO.read(file)
|
def out = ImageIO.read(file)
|
||||||
def getRGB = { int ix, int iy ->
|
def getRGB = { int ix, int iy ->
|
||||||
|
|||||||
@@ -80,6 +80,14 @@ public class ImagePacker{
|
|||||||
return (AtlasRegion)regionCache.get(name);
|
return (AtlasRegion)regionCache.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AtlasRegion find(String name, TextureRegion def){
|
||||||
|
if(!regionCache.containsKey(name)){
|
||||||
|
return (AtlasRegion)def;
|
||||||
|
}
|
||||||
|
return (AtlasRegion)regionCache.get(name);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean has(String s) {
|
public boolean has(String s) {
|
||||||
return regionCache.containsKey(s);
|
return regionCache.containsKey(s);
|
||||||
|
|||||||