UI
Before Width: | Height: | Size: 144 B After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.1 KiB |
@ -375,6 +375,7 @@ no = No
|
||||
info.title = Info
|
||||
error.title = [crimson]An error has occured
|
||||
error.crashtitle = An error has occured
|
||||
attackpvponly = [scarlet]Only available in Attack/PvP modes
|
||||
blocks.input = Input
|
||||
blocks.output = Output
|
||||
blocks.booster = Booster
|
||||
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
@ -31,6 +31,8 @@ import static io.anuke.mindustry.Vars.state;
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
public class Blocks implements ContentList{
|
||||
public static final BooleanProvider padVisible = () -> state.rules.attackMode || state.rules.pvp || state.isEditor();
|
||||
|
||||
public static Block
|
||||
|
||||
//environment
|
||||
@ -1587,8 +1589,6 @@ public class Blocks implements ContentList{
|
||||
//endregion
|
||||
//region units
|
||||
|
||||
BooleanProvider padVisible = () -> state.rules.attackMode || state.rules.pvp || state.isEditor();
|
||||
|
||||
draugFactory = new UnitFactory("draug-factory"){{
|
||||
requirements(Category.units, ItemStack.with(Items.copper, 30, Items.lead, 120));
|
||||
type = UnitTypes.draug;
|
||||
|
@ -334,7 +334,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
|
||||
@Override
|
||||
public Dialog show(){
|
||||
return super.show(Core.scene, Actions.sequence(Actions.alpha(0f), Actions.scaleTo(1f, 1f), Actions.fadeIn(0.3f)));
|
||||
return super.show(Core.scene, Actions.sequence());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -92,7 +92,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
setScaling(Scaling.none);
|
||||
}});
|
||||
visible(() -> generating && !updateEditorOnChange);
|
||||
}}).size(mobile ? 300f : 400f).padRight(6);
|
||||
}}).size(mobile ? 300f : 400f).padRight(10);
|
||||
t.pane(p -> filterTable = p).width(300f).get().setScrollingDisabled(true, false);
|
||||
}).grow();
|
||||
|
||||
@ -119,51 +119,57 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
filterTable.top();
|
||||
|
||||
for(GenerateFilter filter : filters){
|
||||
filterTable.table(t -> {
|
||||
t.add(filter.name()).padTop(5).color(Pal.accent).growX().left();
|
||||
//main container
|
||||
filterTable.table("button", c -> {
|
||||
//icons to perform actions
|
||||
c.table(t -> {
|
||||
t.add(filter.name()).padTop(5).color(Pal.accent).growX().left();
|
||||
|
||||
t.row();
|
||||
t.row();
|
||||
|
||||
t.table(b -> {
|
||||
b.left();
|
||||
b.defaults().size(50f);
|
||||
b.addImageButton("icon-refresh-small", iconsizesmall, () -> {
|
||||
filter.randomize();
|
||||
update();
|
||||
});
|
||||
t.table(b -> {
|
||||
String style = "clear";
|
||||
b.left();
|
||||
b.defaults().size(50f);
|
||||
b.addImageButton("icon-refresh-small", style, iconsizesmall, () -> {
|
||||
filter.randomize();
|
||||
update();
|
||||
});
|
||||
|
||||
b.addImageButton("icon-arrow-up-small", iconsizesmall, () -> {
|
||||
int idx = filters.indexOf(filter);
|
||||
filters.swap(idx, Math.max(0, idx - 1));
|
||||
rebuildFilters();
|
||||
update();
|
||||
b.addImageButton("icon-arrow-up-small", style, iconsizesmall, () -> {
|
||||
int idx = filters.indexOf(filter);
|
||||
filters.swap(idx, Math.max(0, idx - 1));
|
||||
rebuildFilters();
|
||||
update();
|
||||
});
|
||||
b.addImageButton("icon-arrow-down-small",style, iconsizesmall, () -> {
|
||||
int idx = filters.indexOf(filter);
|
||||
filters.swap(idx, Math.min(filters.size - 1, idx + 1));
|
||||
rebuildFilters();
|
||||
update();
|
||||
});
|
||||
b.addImageButton("icon-trash-small", style, iconsizesmall, () -> {
|
||||
filters.remove(filter);
|
||||
rebuildFilters();
|
||||
update();
|
||||
});
|
||||
});
|
||||
b.addImageButton("icon-arrow-down-small", iconsizesmall, () -> {
|
||||
int idx = filters.indexOf(filter);
|
||||
filters.swap(idx, Math.min(filters.size - 1, idx + 1));
|
||||
rebuildFilters();
|
||||
update();
|
||||
});
|
||||
b.addImageButton("icon-trash-small", iconsizesmall, () -> {
|
||||
filters.remove(filter);
|
||||
rebuildFilters();
|
||||
update();
|
||||
});
|
||||
}).growX();
|
||||
}).fillX();
|
||||
filterTable.row();
|
||||
filterTable.table("underline", f -> {
|
||||
f.left();
|
||||
for(FilterOption option : filter.options){
|
||||
option.changed = this::update;
|
||||
}).fillX();
|
||||
c.row();
|
||||
//all the options
|
||||
c.table(f -> {
|
||||
f.left();
|
||||
for(FilterOption option : filter.options){
|
||||
option.changed = this::update;
|
||||
|
||||
f.table(t -> {
|
||||
t.left();
|
||||
option.build(t);
|
||||
}).growX().left();
|
||||
f.row();
|
||||
}
|
||||
}).pad(3).padTop(0).width(280f);
|
||||
f.table(t -> {
|
||||
t.left();
|
||||
option.build(t);
|
||||
}).growX().left();
|
||||
f.row();
|
||||
}
|
||||
}).grow().left().pad(2);
|
||||
}).width(280f).pad(3);
|
||||
filterTable.row();
|
||||
}
|
||||
|
||||
|
@ -237,9 +237,7 @@ public class MapView extends Element implements GestureListener{
|
||||
Draw.color(Pal.remove);
|
||||
Lines.stroke(2f);
|
||||
Lines.rect(centerx - sclwidth / 2 - 1, centery - sclheight / 2 - 1, sclwidth + 2, sclheight + 2);
|
||||
if(Core.scene.getKeyboardFocus() != null && isDescendantOf(Core.scene.getKeyboardFocus())){
|
||||
editor.renderer().draw(centerx - sclwidth / 2, centery - sclheight / 2, sclwidth, sclheight);
|
||||
}
|
||||
editor.renderer().draw(centerx - sclwidth / 2, centery - sclheight / 2, sclwidth, sclheight);
|
||||
Draw.reset();
|
||||
|
||||
if(!ScissorStack.pushScissors(rect.set(x, y, width, height))){
|
||||
|
@ -134,8 +134,8 @@ public class WaveInfoDialog extends FloatingDialog{
|
||||
|
||||
if(groups != null){
|
||||
for(SpawnGroup group : groups){
|
||||
table.table("clear", t -> {
|
||||
t.margin(6f).defaults().pad(2).padLeft(5f).growX().left();
|
||||
table.table("button", t -> {
|
||||
t.margin(0).defaults().pad(3).padLeft(5f).growX().left();
|
||||
t.addButton(b -> {
|
||||
b.left();
|
||||
b.addImage(group.type.iconRegion).size(30f).padRight(3);
|
||||
@ -202,7 +202,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
||||
t.remove();
|
||||
updateWaves();
|
||||
}).growX().pad(-6f).padTop(5);
|
||||
}).width(340f).pad(5);
|
||||
}).width(340f).pad(16);
|
||||
table.row();
|
||||
}
|
||||
}else{
|
||||
|
@ -56,6 +56,7 @@ public class Pal{
|
||||
accentBack = Color.valueOf("d4816b"),
|
||||
place = Color.valueOf("6335f8"),
|
||||
remove = Color.valueOf("e55454"),
|
||||
noplace = Color.valueOf("ffa697"),
|
||||
removeBack = Color.valueOf("a73e3e"),
|
||||
placeRotate = accent,
|
||||
breakInvalid = Color.valueOf("d44b3d"),
|
||||
|
@ -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();
|
||||
|
@ -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));
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|