Defined first 12 zones
This commit is contained in:
+4
-4
@@ -15,10 +15,10 @@ import io.anuke.arc.scene.utils.UIUtils;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class UnlocksDialog extends FloatingDialog{
|
||||
public class DatabaseDialog extends FloatingDialog{
|
||||
|
||||
public UnlocksDialog(){
|
||||
super("$unlocks");
|
||||
public DatabaseDialog(){
|
||||
super("database");
|
||||
|
||||
shouldPause = true;
|
||||
addCloseButton();
|
||||
@@ -58,7 +58,7 @@ public class UnlocksDialog extends FloatingDialog{
|
||||
|
||||
if(unlock.isHidden()) continue;
|
||||
|
||||
Image image = data.isUnlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-locked");
|
||||
Image image = data.isUnlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-tree-locked");
|
||||
image.addListener(new HandCursorListener());
|
||||
list.add(image).size(size).pad(3);
|
||||
|
||||
@@ -2,8 +2,8 @@ package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.collection.ObjectIntMap;
|
||||
import io.anuke.arc.scene.ui.TextButton;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.io.SaveIO.SaveException;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
@@ -32,7 +32,7 @@ public class DeployDialog extends FloatingDialog{
|
||||
top().left().margin(10);
|
||||
|
||||
ObjectIntMap<Item> items = data.items();
|
||||
for(Item item : Vars.content.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);
|
||||
@@ -45,23 +45,31 @@ public class DeployDialog extends FloatingDialog{
|
||||
|
||||
if(control.saves.getZoneSlot() == null){
|
||||
|
||||
for(Zone zone : Vars.content.zones()){
|
||||
if(data.isUnlocked(zone)){
|
||||
table(t -> {
|
||||
t.addButton(zone.localizedName(), () -> {
|
||||
data.removeItems(zone.deployCost);
|
||||
hide();
|
||||
world.playZone(zone);
|
||||
}).size(150f).disabled(b -> !data.hasItems(zone.deployCost));
|
||||
t.row();
|
||||
t.table(req -> {
|
||||
req.left();
|
||||
for(ItemStack stack : zone.deployCost){
|
||||
req.addImage(stack.item.region).size(8 * 3);
|
||||
req.add(stack.amount + "").left();
|
||||
}
|
||||
}).pad(3).growX();
|
||||
}).pad(3);
|
||||
int i = 0;
|
||||
for(Zone zone : content.zones()){
|
||||
table(t -> {
|
||||
TextButton button = t.addButton(zone.localizedName(), () -> {
|
||||
data.removeItems(zone.deployCost);
|
||||
hide();
|
||||
world.playZone(zone);
|
||||
}).size(150f).disabled(b -> !data.hasItems(zone.deployCost) || !data.isUnlocked(zone)).get();
|
||||
|
||||
button.row();
|
||||
button.table(req -> {
|
||||
for(ItemStack stack : zone.deployCost){
|
||||
req.addImage(stack.item.region).size(8 * 3);
|
||||
req.add(stack.amount + "").left();
|
||||
}
|
||||
}).pad(3).growX();
|
||||
|
||||
button.row();
|
||||
button.addImage("icon-zone-locked").visible(() -> !data.isUnlocked(zone));
|
||||
|
||||
button.update(() -> button.setText(data.isUnlocked(zone) ? zone.localizedName() : "???"));
|
||||
}).pad(3);
|
||||
|
||||
if(++i % 4 == 0){
|
||||
row();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
||||
@@ -169,7 +169,7 @@ public class TechTreeDialog extends FloatingDialog{
|
||||
button.tapped(() -> moved = false);
|
||||
button.setSize(nodeSize, nodeSize);
|
||||
button.update(() -> {
|
||||
button.setPosition(node.x + panX + width/2f, node.y + panY + height/2f - 0.5f, Align.center);
|
||||
button.setPosition(node.x + panX + width/2f, node.y + panY + height/2f, Align.center);
|
||||
button.getStyle().up = Core.scene.skin.getDrawable(!locked(node) ? "content-background" : "content-background-locked");
|
||||
((TextureRegionDrawable)button.getStyle().imageUp)
|
||||
.setRegion(node.visible ? node.node.block.icon(Icon.medium) : Core.atlas.find("icon-tree-locked"));
|
||||
|
||||
@@ -127,12 +127,6 @@ public class MenuFragment extends Fragment{
|
||||
|
||||
out.row();
|
||||
|
||||
out.add(new MenuButton("icon-menu", "$changelog.title", ui.changelog::show));
|
||||
|
||||
out.add(new MenuButton("icon-unlocks", "$unlocks", ui.unlocks::show));
|
||||
|
||||
out.row();
|
||||
|
||||
out.add(new MenuButton("icon-exit", "$quit", Core.app::exit)).width(bw).colspan(2);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user