This commit is contained in:
Anuken
2019-07-06 12:22:10 -04:00
parent e3956ebcf2
commit 5ae1e59b5c
16 changed files with 70 additions and 59 deletions

View File

@@ -174,7 +174,7 @@ public class MapsDialog extends FloatingDialog{
table.row();
table.addImageTextButton("$editor.openin", "icon-load-map", iconsize, () -> {
table.addImageTextButton("$editor.openin", "icon-load-map-small", iconsizesmall, () -> {
try{
Vars.ui.editor.beginEditMap(map.file);
dialog.hide();
@@ -185,7 +185,7 @@ public class MapsDialog extends FloatingDialog{
}
}).fillX().height(54f).marginLeft(10);
table.addImageTextButton("$delete", "icon-trash-16", iconsize, () -> {
table.addImageTextButton("$delete", "icon-trash-16-small", iconsizesmall, () -> {
ui.showConfirm("$confirm", Core.bundle.format("map.delete", map.name()), () -> {
world.maps.removeMap(map);
dialog.hide();

View File

@@ -20,6 +20,7 @@ import io.anuke.arc.util.Align;
import io.anuke.mindustry.content.TechTree;
import io.anuke.mindustry.content.TechTree.TechNode;
import io.anuke.mindustry.graphics.Pal;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.ui.ItemsDisplay;
import io.anuke.mindustry.ui.TreeLayout;
@@ -266,7 +267,7 @@ public class TechTreeDialog extends FloatingDialog{
for(ItemStack req : node.requirements){
t.table(list -> {
list.left();
list.addImage(req.item.getContentIcon()).size(8 * 3).padRight(3);
list.addImage(req.item.icon(Item.Icon.medium)).size(8 * 3).padRight(3);
list.add(req.item.localizedName()).color(Color.LIGHT_GRAY);
list.label(() -> " " + Math.min(data.getItem(req.item), req.amount) + " / " + req.amount)
.update(l -> l.setColor(data.has(req.item, req.amount) ? Color.LIGHT_GRAY : Color.SCARLET));

View File

@@ -73,8 +73,7 @@ public class ZoneInfoDialog extends FloatingDialog{
for(ZoneRequirement other : zone.zoneRequirements){
r.addImage("icon-terrain").padRight(4);
r.add(Core.bundle.format("zone.requirement", other.wave, other.zone.localizedName())).color(Color.LIGHT_GRAY);
r.addImage(other.zone.bestWave() >= other.wave ? "icon-check" : "icon-cancel")
.color(other.zone.bestWave() >= other.wave ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
r.addImage(other.zone.bestWave() >= other.wave ? "icon-check-small" : "icon-cancel-small", other.zone.bestWave() >= other.wave ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
r.row();
}
});
@@ -89,8 +88,7 @@ public class ZoneInfoDialog extends FloatingDialog{
for(Block block : zone.blockRequirements){
r.addImage(block.icon(Icon.small)).size(8 * 3).padRight(4);
r.add(block.localizedName).color(Color.LIGHT_GRAY);
r.addImage(data.isUnlocked(block) ? "icon-check" : "icon-cancel")
.color(data.isUnlocked(block) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
r.addImage(data.isUnlocked(block) ? "icon-check-small" : "icon-cancel-small", data.isUnlocked(block) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
r.row();
}

View File

@@ -11,6 +11,7 @@ import io.anuke.arc.scene.event.Touchable;
import io.anuke.arc.scene.style.TextureRegionDrawable;
import io.anuke.arc.scene.ui.*;
import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.type.TileEntity;
import io.anuke.mindustry.game.EventType.UnlockEvent;
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
@@ -151,7 +152,8 @@ public class PlacementFragment extends Fragment{
button.update(() -> { //color unplacable things gray
TileEntity core = player.getClosestCore();
Color color = state.rules.infiniteResources || (core != null && (core.items.has(block.buildRequirements, state.rules.buildCostMultiplier) || state.rules.infiniteResources)) ? Color.WHITE : Color.GRAY;
Color color = block.buildVisibility == Blocks.padVisible && !block.buildVisibility.get() ? Pal.noplace :
state.rules.infiniteResources || (core != null && (core.items.has(block.buildRequirements, state.rules.buildCostMultiplier) || state.rules.infiniteResources)) ? Color.WHITE : Color.GRAY;
button.forEach(elem -> elem.setColor(color));
button.setChecked(input.block == block);
});
@@ -201,6 +203,10 @@ public class PlacementFragment extends Fragment{
header.addButton("?", "clear-partial", () -> ui.content.show(lastDisplay))
.size(8 * 5).padTop(-5).padRight(-5).right().grow();
}
if(lastDisplay.buildVisibility == Blocks.padVisible && !lastDisplay.buildVisibility.get()){
header.row();
header.add("$attackpvponly").width(230f).wrap().colspan(3).left();
}
}).growX().left();
topTable.row();
//add requirement table
@@ -298,7 +304,7 @@ public class PlacementFragment extends Fragment{
Array<Block> getByCategory(Category cat){
returnArray.clear();
for(Block block : content.blocks()){
if(block.buildCategory == cat && block.isVisible()){
if(block.buildCategory == cat && (block.isVisible() || block.buildVisibility == Blocks.padVisible)){
returnArray.add(block);
}
}