diff --git a/core/assets-raw/sprites/ui/underline-2.9.png b/core/assets-raw/sprites/ui/underline-2.9.png index f703111db2..24da68912a 100644 Binary files a/core/assets-raw/sprites/ui/underline-2.9.png and b/core/assets-raw/sprites/ui/underline-2.9.png differ diff --git a/core/assets-raw/sprites/ui/underline-disabled.9.png b/core/assets-raw/sprites/ui/underline-disabled.9.png index 753a3e9c24..778b428500 100644 Binary files a/core/assets-raw/sprites/ui/underline-disabled.9.png and b/core/assets-raw/sprites/ui/underline-disabled.9.png differ diff --git a/core/assets-raw/sprites/ui/underline-red.9.png b/core/assets-raw/sprites/ui/underline-red.9.png index 5a6bc60651..1237745208 100644 Binary files a/core/assets-raw/sprites/ui/underline-red.9.png and b/core/assets-raw/sprites/ui/underline-red.9.png differ diff --git a/core/assets-raw/sprites/ui/underline.9.png b/core/assets-raw/sprites/ui/underline.9.png index ce0a093570..516f6f82cc 100644 Binary files a/core/assets-raw/sprites/ui/underline.9.png and b/core/assets-raw/sprites/ui/underline.9.png differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 6f17bdde78..135014b867 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -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 diff --git a/core/assets/sprites/sprites4.png b/core/assets/sprites/sprites4.png index 730a5c7f8e..7a5fa9f88e 100644 Binary files a/core/assets/sprites/sprites4.png and b/core/assets/sprites/sprites4.png differ diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java index 361ae465d9..03ef92ed63 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -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; diff --git a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java index e363ecfa03..af2f80a176 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java @@ -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 diff --git a/core/src/io/anuke/mindustry/editor/MapGenerateDialog.java b/core/src/io/anuke/mindustry/editor/MapGenerateDialog.java index c669cd943c..466359c744 100644 --- a/core/src/io/anuke/mindustry/editor/MapGenerateDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapGenerateDialog.java @@ -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(); } diff --git a/core/src/io/anuke/mindustry/editor/MapView.java b/core/src/io/anuke/mindustry/editor/MapView.java index 79e141fe34..4802d7f855 100644 --- a/core/src/io/anuke/mindustry/editor/MapView.java +++ b/core/src/io/anuke/mindustry/editor/MapView.java @@ -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))){ diff --git a/core/src/io/anuke/mindustry/editor/WaveInfoDialog.java b/core/src/io/anuke/mindustry/editor/WaveInfoDialog.java index 6b4c2e80d0..3c6e4edf4b 100644 --- a/core/src/io/anuke/mindustry/editor/WaveInfoDialog.java +++ b/core/src/io/anuke/mindustry/editor/WaveInfoDialog.java @@ -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{ diff --git a/core/src/io/anuke/mindustry/graphics/Pal.java b/core/src/io/anuke/mindustry/graphics/Pal.java index 2647ab068c..40c4867abc 100644 --- a/core/src/io/anuke/mindustry/graphics/Pal.java +++ b/core/src/io/anuke/mindustry/graphics/Pal.java @@ -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"), diff --git a/core/src/io/anuke/mindustry/ui/dialogs/MapsDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/MapsDialog.java index a8cf4708b9..d167fddd53 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/MapsDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/MapsDialog.java @@ -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(); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/TechTreeDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/TechTreeDialog.java index 4fb91b6e7c..d26477693a 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/TechTreeDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/TechTreeDialog.java @@ -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)); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/ZoneInfoDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/ZoneInfoDialog.java index 77154d0c6a..635f4dd2e0 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/ZoneInfoDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/ZoneInfoDialog.java @@ -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(); } diff --git a/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java b/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java index 9fe42faa45..f3d47d61e8 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java @@ -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 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); } }