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
|
info.title = Info
|
||||||
error.title = [crimson]An error has occured
|
error.title = [crimson]An error has occured
|
||||||
error.crashtitle = An error has occured
|
error.crashtitle = An error has occured
|
||||||
|
attackpvponly = [scarlet]Only available in Attack/PvP modes
|
||||||
blocks.input = Input
|
blocks.input = Input
|
||||||
blocks.output = Output
|
blocks.output = Output
|
||||||
blocks.booster = Booster
|
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;
|
import static io.anuke.mindustry.Vars.world;
|
||||||
|
|
||||||
public class Blocks implements ContentList{
|
public class Blocks implements ContentList{
|
||||||
|
public static final BooleanProvider padVisible = () -> state.rules.attackMode || state.rules.pvp || state.isEditor();
|
||||||
|
|
||||||
public static Block
|
public static Block
|
||||||
|
|
||||||
//environment
|
//environment
|
||||||
@@ -1587,8 +1589,6 @@ public class Blocks implements ContentList{
|
|||||||
//endregion
|
//endregion
|
||||||
//region units
|
//region units
|
||||||
|
|
||||||
BooleanProvider padVisible = () -> state.rules.attackMode || state.rules.pvp || state.isEditor();
|
|
||||||
|
|
||||||
draugFactory = new UnitFactory("draug-factory"){{
|
draugFactory = new UnitFactory("draug-factory"){{
|
||||||
requirements(Category.units, ItemStack.with(Items.copper, 30, Items.lead, 120));
|
requirements(Category.units, ItemStack.with(Items.copper, 30, Items.lead, 120));
|
||||||
type = UnitTypes.draug;
|
type = UnitTypes.draug;
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dialog show(){
|
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
|
@Override
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
setScaling(Scaling.none);
|
setScaling(Scaling.none);
|
||||||
}});
|
}});
|
||||||
visible(() -> generating && !updateEditorOnChange);
|
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);
|
t.pane(p -> filterTable = p).width(300f).get().setScrollingDisabled(true, false);
|
||||||
}).grow();
|
}).grow();
|
||||||
|
|
||||||
@@ -119,51 +119,57 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
filterTable.top();
|
filterTable.top();
|
||||||
|
|
||||||
for(GenerateFilter filter : filters){
|
for(GenerateFilter filter : filters){
|
||||||
filterTable.table(t -> {
|
//main container
|
||||||
t.add(filter.name()).padTop(5).color(Pal.accent).growX().left();
|
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 -> {
|
t.table(b -> {
|
||||||
b.left();
|
String style = "clear";
|
||||||
b.defaults().size(50f);
|
b.left();
|
||||||
b.addImageButton("icon-refresh-small", iconsizesmall, () -> {
|
b.defaults().size(50f);
|
||||||
filter.randomize();
|
b.addImageButton("icon-refresh-small", style, iconsizesmall, () -> {
|
||||||
update();
|
filter.randomize();
|
||||||
});
|
update();
|
||||||
|
});
|
||||||
|
|
||||||
b.addImageButton("icon-arrow-up-small", iconsizesmall, () -> {
|
b.addImageButton("icon-arrow-up-small", style, iconsizesmall, () -> {
|
||||||
int idx = filters.indexOf(filter);
|
int idx = filters.indexOf(filter);
|
||||||
filters.swap(idx, Math.max(0, idx - 1));
|
filters.swap(idx, Math.max(0, idx - 1));
|
||||||
rebuildFilters();
|
rebuildFilters();
|
||||||
update();
|
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, () -> {
|
}).fillX();
|
||||||
int idx = filters.indexOf(filter);
|
c.row();
|
||||||
filters.swap(idx, Math.min(filters.size - 1, idx + 1));
|
//all the options
|
||||||
rebuildFilters();
|
c.table(f -> {
|
||||||
update();
|
f.left();
|
||||||
});
|
for(FilterOption option : filter.options){
|
||||||
b.addImageButton("icon-trash-small", iconsizesmall, () -> {
|
option.changed = this::update;
|
||||||
filters.remove(filter);
|
|
||||||
rebuildFilters();
|
|
||||||
update();
|
|
||||||
});
|
|
||||||
}).growX();
|
|
||||||
}).fillX();
|
|
||||||
filterTable.row();
|
|
||||||
filterTable.table("underline", f -> {
|
|
||||||
f.left();
|
|
||||||
for(FilterOption option : filter.options){
|
|
||||||
option.changed = this::update;
|
|
||||||
|
|
||||||
f.table(t -> {
|
f.table(t -> {
|
||||||
t.left();
|
t.left();
|
||||||
option.build(t);
|
option.build(t);
|
||||||
}).growX().left();
|
}).growX().left();
|
||||||
f.row();
|
f.row();
|
||||||
}
|
}
|
||||||
}).pad(3).padTop(0).width(280f);
|
}).grow().left().pad(2);
|
||||||
|
}).width(280f).pad(3);
|
||||||
filterTable.row();
|
filterTable.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,9 +237,7 @@ public class MapView extends Element implements GestureListener{
|
|||||||
Draw.color(Pal.remove);
|
Draw.color(Pal.remove);
|
||||||
Lines.stroke(2f);
|
Lines.stroke(2f);
|
||||||
Lines.rect(centerx - sclwidth / 2 - 1, centery - sclheight / 2 - 1, sclwidth + 2, sclheight + 2);
|
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();
|
Draw.reset();
|
||||||
|
|
||||||
if(!ScissorStack.pushScissors(rect.set(x, y, width, height))){
|
if(!ScissorStack.pushScissors(rect.set(x, y, width, height))){
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
|
|
||||||
if(groups != null){
|
if(groups != null){
|
||||||
for(SpawnGroup group : groups){
|
for(SpawnGroup group : groups){
|
||||||
table.table("clear", t -> {
|
table.table("button", t -> {
|
||||||
t.margin(6f).defaults().pad(2).padLeft(5f).growX().left();
|
t.margin(0).defaults().pad(3).padLeft(5f).growX().left();
|
||||||
t.addButton(b -> {
|
t.addButton(b -> {
|
||||||
b.left();
|
b.left();
|
||||||
b.addImage(group.type.iconRegion).size(30f).padRight(3);
|
b.addImage(group.type.iconRegion).size(30f).padRight(3);
|
||||||
@@ -202,7 +202,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
t.remove();
|
t.remove();
|
||||||
updateWaves();
|
updateWaves();
|
||||||
}).growX().pad(-6f).padTop(5);
|
}).growX().pad(-6f).padTop(5);
|
||||||
}).width(340f).pad(5);
|
}).width(340f).pad(16);
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public class Pal{
|
|||||||
accentBack = Color.valueOf("d4816b"),
|
accentBack = Color.valueOf("d4816b"),
|
||||||
place = Color.valueOf("6335f8"),
|
place = Color.valueOf("6335f8"),
|
||||||
remove = Color.valueOf("e55454"),
|
remove = Color.valueOf("e55454"),
|
||||||
|
noplace = Color.valueOf("ffa697"),
|
||||||
removeBack = Color.valueOf("a73e3e"),
|
removeBack = Color.valueOf("a73e3e"),
|
||||||
placeRotate = accent,
|
placeRotate = accent,
|
||||||
breakInvalid = Color.valueOf("d44b3d"),
|
breakInvalid = Color.valueOf("d44b3d"),
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImageTextButton("$editor.openin", "icon-load-map", iconsize, () -> {
|
table.addImageTextButton("$editor.openin", "icon-load-map-small", iconsizesmall, () -> {
|
||||||
try{
|
try{
|
||||||
Vars.ui.editor.beginEditMap(map.file);
|
Vars.ui.editor.beginEditMap(map.file);
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
@@ -185,7 +185,7 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
}).fillX().height(54f).marginLeft(10);
|
}).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()), () -> {
|
ui.showConfirm("$confirm", Core.bundle.format("map.delete", map.name()), () -> {
|
||||||
world.maps.removeMap(map);
|
world.maps.removeMap(map);
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import io.anuke.arc.util.Align;
|
|||||||
import io.anuke.mindustry.content.TechTree;
|
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.Pal;
|
import io.anuke.mindustry.graphics.Pal;
|
||||||
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
import io.anuke.mindustry.ui.ItemsDisplay;
|
import io.anuke.mindustry.ui.ItemsDisplay;
|
||||||
import io.anuke.mindustry.ui.TreeLayout;
|
import io.anuke.mindustry.ui.TreeLayout;
|
||||||
@@ -266,7 +267,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
for(ItemStack req : node.requirements){
|
for(ItemStack req : node.requirements){
|
||||||
t.table(list -> {
|
t.table(list -> {
|
||||||
list.left();
|
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.add(req.item.localizedName()).color(Color.LIGHT_GRAY);
|
||||||
list.label(() -> " " + Math.min(data.getItem(req.item), req.amount) + " / " + req.amount)
|
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));
|
.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){
|
for(ZoneRequirement other : zone.zoneRequirements){
|
||||||
r.addImage("icon-terrain").padRight(4);
|
r.addImage("icon-terrain").padRight(4);
|
||||||
r.add(Core.bundle.format("zone.requirement", other.wave, other.zone.localizedName())).color(Color.LIGHT_GRAY);
|
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")
|
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);
|
||||||
.color(other.zone.bestWave() >= other.wave ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
|
||||||
r.row();
|
r.row();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -89,8 +88,7 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
for(Block block : zone.blockRequirements){
|
for(Block block : zone.blockRequirements){
|
||||||
r.addImage(block.icon(Icon.small)).size(8 * 3).padRight(4);
|
r.addImage(block.icon(Icon.small)).size(8 * 3).padRight(4);
|
||||||
r.add(block.localizedName).color(Color.LIGHT_GRAY);
|
r.add(block.localizedName).color(Color.LIGHT_GRAY);
|
||||||
r.addImage(data.isUnlocked(block) ? "icon-check" : "icon-cancel")
|
r.addImage(data.isUnlocked(block) ? "icon-check-small" : "icon-cancel-small", data.isUnlocked(block) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
||||||
.color(data.isUnlocked(block) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
|
||||||
r.row();
|
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.style.TextureRegionDrawable;
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
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.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.game.EventType.UnlockEvent;
|
import io.anuke.mindustry.game.EventType.UnlockEvent;
|
||||||
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
|
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
|
||||||
@@ -151,7 +152,8 @@ public class PlacementFragment extends Fragment{
|
|||||||
|
|
||||||
button.update(() -> { //color unplacable things gray
|
button.update(() -> { //color unplacable things gray
|
||||||
TileEntity core = player.getClosestCore();
|
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.forEach(elem -> elem.setColor(color));
|
||||||
button.setChecked(input.block == block);
|
button.setChecked(input.block == block);
|
||||||
});
|
});
|
||||||
@@ -201,6 +203,10 @@ public class PlacementFragment extends Fragment{
|
|||||||
header.addButton("?", "clear-partial", () -> ui.content.show(lastDisplay))
|
header.addButton("?", "clear-partial", () -> ui.content.show(lastDisplay))
|
||||||
.size(8 * 5).padTop(-5).padRight(-5).right().grow();
|
.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();
|
}).growX().left();
|
||||||
topTable.row();
|
topTable.row();
|
||||||
//add requirement table
|
//add requirement table
|
||||||
@@ -298,7 +304,7 @@ public class PlacementFragment extends Fragment{
|
|||||||
Array<Block> getByCategory(Category cat){
|
Array<Block> getByCategory(Category cat){
|
||||||
returnArray.clear();
|
returnArray.clear();
|
||||||
for(Block block : content.blocks()){
|
for(Block block : content.blocks()){
|
||||||
if(block.buildCategory == cat && block.isVisible()){
|
if(block.buildCategory == cat && (block.isVisible() || block.buildVisibility == Blocks.padVisible)){
|
||||||
returnArray.add(block);
|
returnArray.add(block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||