2 new categories, less space used

This commit is contained in:
Anuken
2018-11-18 14:10:02 -05:00
parent ff62f075d0
commit 0efaa11553
13 changed files with 986 additions and 1040 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 98 KiB

+1 -2
View File
@@ -14,12 +14,11 @@ TintedDrawable: {
chatfield: {name: white, color: {r: 0, g: 0, b: 0, a: 0.2}}, chatfield: {name: white, color: {r: 0, g: 0, b: 0, a: 0.2}},
clear: {name: white, color: {r: 0.1, g: 0.1, b: 0.1, a: 0.75}}, clear: {name: white, color: {r: 0.1, g: 0.1, b: 0.1, a: 0.75}},
none: {name: white, color: {r: 0, g: 0, b: 0, a: 0}}, none: {name: white, color: {r: 0, g: 0, b: 0, a: 0}},
clear-over: {name: white, color: { hex: "#ffd37f82" } }, clear-over: {name: white, color: { hex: "#ffffff82" } },
clear-down: {name: white, color: { hex: "#ffd37fff" } } clear-down: {name: white, color: { hex: "#ffd37fff" } }
}, },
ButtonStyle: { ButtonStyle: {
default: {down: button-down, up: button }, default: {down: button-down, up: button },
menu: {up: text-sides, over: text-sides-over, down: text-sides-down},
toggle: {checked: button-down, down: button-down, up: button } toggle: {checked: button-down, down: button-down, up: button }
}, },
TextButtonStyle: { TextButtonStyle: {
@@ -43,12 +43,15 @@ public class Recipes implements ContentList{
new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4)); new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4));
//projectors //projectors
new Recipe(defense, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 180)); new Recipe(effect, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 180));
new Recipe(defense, DefenseBlocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250)); new Recipe(effect, DefenseBlocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(defense, DefenseBlocks.forceProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250)); new Recipe(effect, DefenseBlocks.forceProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
//extra blocks new Recipe(effect, StorageBlocks.unloader, new ItemStack(Items.densealloy, 50), new ItemStack(Items.silicon, 60));
new Recipe(defense, DefenseBlocks.shockMine, new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 25)) new Recipe(effect, StorageBlocks.container, new ItemStack(Items.densealloy, 200));
new Recipe(effect, StorageBlocks.vault, new ItemStack(Items.densealloy, 500), new ItemStack(Items.thorium, 250));
new Recipe(effect, DefenseBlocks.shockMine, new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 25))
.setDependencies(Items.blastCompound); .setDependencies(Items.blastCompound);
//TURRETS //TURRETS
@@ -70,11 +73,11 @@ public class Recipes implements ContentList{
new Recipe(distribution, DistributionBlocks.titaniumconveyor, new ItemStack(Items.copper, 2), new ItemStack(Items.titanium, 1)); new Recipe(distribution, DistributionBlocks.titaniumconveyor, new ItemStack(Items.copper, 2), new ItemStack(Items.titanium, 1));
new Recipe(distribution, DistributionBlocks.phaseConveyor, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.densealloy, 20)); new Recipe(distribution, DistributionBlocks.phaseConveyor, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.densealloy, 20));
//starter lead transportation //starter transport
new Recipe(distribution, DistributionBlocks.junction, new ItemStack(Items.copper, 2)).setAlwaysUnlocked(true); new Recipe(distribution, DistributionBlocks.junction, new ItemStack(Items.copper, 2)).setAlwaysUnlocked(true);
new Recipe(distribution, DistributionBlocks.router, new ItemStack(Items.copper, 6)).setAlwaysUnlocked(true); new Recipe(distribution, DistributionBlocks.router, new ItemStack(Items.copper, 6)).setAlwaysUnlocked(true);
//advanced densealloy transporation //advanced densealloy transporat
new Recipe(distribution, DistributionBlocks.distributor, new ItemStack(Items.densealloy, 8), new ItemStack(Items.copper, 8)); new Recipe(distribution, DistributionBlocks.distributor, new ItemStack(Items.densealloy, 8), new ItemStack(Items.copper, 8));
new Recipe(distribution, DistributionBlocks.sorter, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 4)); new Recipe(distribution, DistributionBlocks.sorter, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 4));
new Recipe(distribution, DistributionBlocks.overflowGate, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 8)); new Recipe(distribution, DistributionBlocks.overflowGate, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 8));
@@ -131,9 +134,6 @@ public class Recipes implements ContentList{
new Recipe(power, PowerBlocks.thoriumReactor, new ItemStack(Items.lead, 600), new ItemStack(Items.silicon, 400), new ItemStack(Items.densealloy, 300), new ItemStack(Items.thorium, 300)); new Recipe(power, PowerBlocks.thoriumReactor, new ItemStack(Items.lead, 600), new ItemStack(Items.silicon, 400), new ItemStack(Items.densealloy, 300), new ItemStack(Items.thorium, 300));
new Recipe(power, PowerBlocks.rtgGenerator, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 150), new ItemStack(Items.phasefabric, 50), new ItemStack(Items.plastanium, 150), new ItemStack(Items.thorium, 100)); new Recipe(power, PowerBlocks.rtgGenerator, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 150), new ItemStack(Items.phasefabric, 50), new ItemStack(Items.plastanium, 150), new ItemStack(Items.thorium, 100));
new Recipe(distribution, StorageBlocks.unloader, new ItemStack(Items.densealloy, 50), new ItemStack(Items.silicon, 60));
new Recipe(distribution, StorageBlocks.container, new ItemStack(Items.densealloy, 200));
new Recipe(distribution, StorageBlocks.vault, new ItemStack(Items.densealloy, 500), new ItemStack(Items.thorium, 250));
//core disabled due to being broken //core disabled due to being broken
/*new Recipe(distribution, StorageBlocks.core, /*new Recipe(distribution, StorageBlocks.core,
new ItemStack(Items.copper, 2000), new ItemStack(Items.densealloy, 1500), new ItemStack(Items.copper, 2000), new ItemStack(Items.densealloy, 1500),
@@ -153,16 +153,16 @@ public class Recipes implements ContentList{
//UNITS //UNITS
//bodies //upgrades
new Recipe(units, UpgradeBlocks.dartPad, new ItemStack(Items.lead, 150), new ItemStack(Items.copper, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240)).setVisible(RecipeVisibility.desktopOnly); new Recipe(upgrade, UpgradeBlocks.dartPad, new ItemStack(Items.lead, 150), new ItemStack(Items.copper, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240)).setVisible(RecipeVisibility.desktopOnly);
new Recipe(units, UpgradeBlocks.tridentPad, new ItemStack(Items.lead, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200)); new Recipe(upgrade, UpgradeBlocks.tridentPad, new ItemStack(Items.lead, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200));
new Recipe(units, UpgradeBlocks.javelinPad, new ItemStack(Items.lead, 350), new ItemStack(Items.silicon, 450), new ItemStack(Items.titanium, 500), new ItemStack(Items.plastanium, 400), new ItemStack(Items.phasefabric, 200)); new Recipe(upgrade, UpgradeBlocks.javelinPad, new ItemStack(Items.lead, 350), new ItemStack(Items.silicon, 450), new ItemStack(Items.titanium, 500), new ItemStack(Items.plastanium, 400), new ItemStack(Items.phasefabric, 200));
new Recipe(units, UpgradeBlocks.glaivePad, new ItemStack(Items.lead, 450), new ItemStack(Items.silicon, 650), new ItemStack(Items.titanium, 700), new ItemStack(Items.plastanium, 600), new ItemStack(Items.surgealloy, 200)); new Recipe(upgrade, UpgradeBlocks.glaivePad, new ItemStack(Items.lead, 450), new ItemStack(Items.silicon, 650), new ItemStack(Items.titanium, 700), new ItemStack(Items.plastanium, 600), new ItemStack(Items.surgealloy, 200));
new Recipe(units, UpgradeBlocks.alphaPad, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 100), new ItemStack(Items.copper, 150)).setVisible(RecipeVisibility.mobileOnly); new Recipe(upgrade, UpgradeBlocks.alphaPad, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 100), new ItemStack(Items.copper, 150)).setVisible(RecipeVisibility.mobileOnly);
new Recipe(units, UpgradeBlocks.tauPad, new ItemStack(Items.lead, 250), new ItemStack(Items.densealloy, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250)); new Recipe(upgrade, UpgradeBlocks.tauPad, new ItemStack(Items.lead, 250), new ItemStack(Items.densealloy, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250));
new Recipe(units, UpgradeBlocks.deltaPad, new ItemStack(Items.lead, 350), new ItemStack(Items.densealloy, 350), new ItemStack(Items.copper, 400), new ItemStack(Items.silicon, 450), new ItemStack(Items.thorium, 300)); new Recipe(upgrade, UpgradeBlocks.deltaPad, new ItemStack(Items.lead, 350), new ItemStack(Items.densealloy, 350), new ItemStack(Items.copper, 400), new ItemStack(Items.silicon, 450), new ItemStack(Items.thorium, 300));
new Recipe(units, UpgradeBlocks.omegaPad, new ItemStack(Items.lead, 450), new ItemStack(Items.densealloy, 550), new ItemStack(Items.silicon, 650), new ItemStack(Items.thorium, 600), new ItemStack(Items.surgealloy, 240)); new Recipe(upgrade, UpgradeBlocks.omegaPad, new ItemStack(Items.lead, 450), new ItemStack(Items.densealloy, 550), new ItemStack(Items.silicon, 650), new ItemStack(Items.thorium, 600), new ItemStack(Items.surgealloy, 240));
//actual unit related stuff //actual unit related stuff
new Recipe(units, UnitBlocks.spiritFactory, new ItemStack(Items.copper, 70), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 130)); new Recipe(units, UnitBlocks.spiritFactory, new ItemStack(Items.copper, 70), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 130));
@@ -16,5 +16,9 @@ public enum Category{
/**Blocks that craft things.*/ /**Blocks that craft things.*/
crafting, crafting,
/**Blocks that create units.*/ /**Blocks that create units.*/
units units,
/**Things that upgrade the player such as mech pads.*/
upgrade,
/**Things for storage or passive effects.*/
effect
} }
@@ -1,52 +0,0 @@
package io.anuke.mindustry.ui;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.OreBlock;
import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.scene.style.TextureRegionDrawable;
import io.anuke.ucore.scene.ui.Image;
import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.world;
public class SelectionTable extends Table{
Tile lastTile;
public SelectionTable(){
super("clear");
margin(5f);
update(() -> {
Block result;
Tile tile = world.tileWorld(Graphics.mouseWorld().x, Graphics.mouseWorld().y);
if(tile != null){
tile = tile.target();
result = tile.block().synthetic() ? tile.block() : tile.floor() instanceof OreBlock ? tile.floor() : null;
}else{
result = null;
}
if(result != null){
lastTile = tile;
}
getTranslation().y = Mathf.lerp(getTranslation().y, result == null ? -getHeight() : 0f, 0.2f);
});
Image image = new Image(new TextureRegionDrawable(new TextureRegion(Draw.region("clear"))));
image.update(() ->
((TextureRegionDrawable)image.getDrawable()).setRegion(lastTile == null ? Draw.getBlankRegion() :
lastTile.block().getDisplayIcon(lastTile)));
add(image).size(8*5).padRight(4);
label(() -> lastTile == null ? "" : lastTile.block().getDisplayName(lastTile));
pack();
getTranslation().y = - getHeight();
}
}
@@ -16,7 +16,6 @@ import io.anuke.mindustry.net.Packets.AdminAction;
import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.type.Recipe;
import io.anuke.mindustry.ui.IntFormat; import io.anuke.mindustry.ui.IntFormat;
import io.anuke.mindustry.ui.Minimap; import io.anuke.mindustry.ui.Minimap;
import io.anuke.mindustry.ui.SelectionTable;
import io.anuke.mindustry.ui.dialogs.FloatingDialog; import io.anuke.mindustry.ui.dialogs.FloatingDialog;
import io.anuke.ucore.core.*; import io.anuke.ucore.core.*;
import io.anuke.ucore.graphics.Hue; import io.anuke.ucore.graphics.Hue;
@@ -33,7 +32,7 @@ import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.*;
public class HudFragment extends Fragment{ public class HudFragment extends Fragment{
public final BlocksFragment blockfrag = new BlocksFragment(); public final PlacementFragment blockfrag = new PlacementFragment();
private ImageButton menu, flip; private ImageButton menu, flip;
private Stack wavetable; private Stack wavetable;
@@ -1,5 +1,6 @@
package io.anuke.mindustry.ui.fragments; package io.anuke.mindustry.ui.fragments;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Interpolation; import com.badlogic.gdx.math.Interpolation;
import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
@@ -14,14 +15,15 @@ import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.OreBlock; import io.anuke.mindustry.world.blocks.OreBlock;
import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.scene.Group; import io.anuke.ucore.scene.Group;
import io.anuke.ucore.scene.event.Touchable;
import io.anuke.ucore.scene.ui.ButtonGroup; import io.anuke.ucore.scene.ui.ButtonGroup;
import io.anuke.ucore.scene.ui.ImageButton; import io.anuke.ucore.scene.ui.ImageButton;
import io.anuke.ucore.scene.ui.layout.Table; import io.anuke.ucore.scene.ui.layout.Table;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.*;
public class BlocksFragment extends Fragment{ public class PlacementFragment extends Fragment{
final int rowWidth = 3; final int rowWidth = 4;
Category currentCategory = Category.turret; Category currentCategory = Category.turret;
Block hovered; Block hovered;
@@ -34,7 +36,6 @@ public class BlocksFragment extends Fragment{
InputHandler input = control.input(0); InputHandler input = control.input(0);
parent.fill(frame -> { parent.fill(frame -> {
//rebuilds the top table with the selected recipe
//rebuilds the category table with the correct recipes //rebuilds the category table with the correct recipes
Runnable rebuildCategory = () -> { Runnable rebuildCategory = () -> {
@@ -61,13 +62,14 @@ public class BlocksFragment extends Fragment{
button.replaceImage(new ImageStack(recipe.result.getCompactIcon())); button.replaceImage(new ImageStack(recipe.result.getCompactIcon()));
button.hovered(() -> hovered = recipe.result); if(!mobile){
button.hovered(() -> hovered = recipe.result);
button.exited(() -> { button.exited(() -> {
if(hovered == recipe.result){ if(hovered == recipe.result){
hovered = null; hovered = null;
} }
}); });
}
} }
}; };
@@ -98,7 +100,7 @@ public class BlocksFragment extends Fragment{
req.table(line -> { req.table(line -> {
line.left(); line.left();
line.addImage(stack.item.region).size(8*2); line.addImage(stack.item.region).size(8*2);
line.add(stack.item.localizedName()).padLeft(2).left().get().setFontScale(0.5f); line.add(stack.item.localizedName()).color(Color.LIGHT_GRAY).padLeft(2).left();
line.labelWrap(() -> { line.labelWrap(() -> {
TileEntity core = players[0].getClosestCore(); TileEntity core = players[0].getClosestCore();
if(core == null || state.mode.infiniteResources) return "*/*"; if(core == null || state.mode.infiniteResources) return "*/*";
@@ -107,7 +109,7 @@ public class BlocksFragment extends Fragment{
String color = (amount < stack.amount / 2f ? "[red]" : amount < stack.amount ? "[accent]" : "[white]"); String color = (amount < stack.amount / 2f ? "[red]" : amount < stack.amount ? "[accent]" : "[white]");
return color + ui.formatAmount(amount) + "[white]/" + stack.amount; return color + ui.formatAmount(amount) + "[white]/" + stack.amount;
}).padLeft(5).get().setFontScale(0.5f); }).padLeft(5);
}).left(); }).left();
req.row(); req.row();
} }
@@ -121,10 +123,10 @@ public class BlocksFragment extends Fragment{
}); });
top.row(); top.row();
top.addImage("blank").growX().color(Palette.accent).height(3f); top.addImage("blank").growX().color(Palette.accent).height(3f);
}).colspan(2).fillX().visible(() -> getSelected() != null || tileDisplayBlock() != null); }).colspan(3).fillX().visible(() -> getSelected() != null || tileDisplayBlock() != null).touchable(Touchable.enabled);
frame.row(); frame.row();
frame.table(categories -> { frame.table(categories -> {
categories.defaults().size(45f); categories.defaults().size(48f);
ButtonGroup<ImageButton> group = new ButtonGroup<>(); ButtonGroup<ImageButton> group = new ButtonGroup<>();
@@ -134,11 +136,12 @@ public class BlocksFragment extends Fragment{
rebuildCategory.run(); rebuildCategory.run();
}).group(group); }).group(group);
categories.row(); if(cat.ordinal() %2 == 1) categories.row();
} }
}); }).touchable(Touchable.enabled);
frame.addImage("blank").width(3f).fillY().color(Palette.accent);
frame.table("clear", blocks -> blockTable = blocks).fillY().bottom(); frame.table("clear", blocks -> blockTable = blocks).fillY().bottom().touchable(Touchable.enabled);
rebuildCategory.run(); rebuildCategory.run();
}); });