This commit is contained in:
Anuken 2018-11-26 22:47:54 -05:00
parent ef85d1d83e
commit dcea8ae64f
45 changed files with 1136 additions and 1064 deletions

View file

@ -25,7 +25,7 @@ allprojects {
appName = 'Mindustry'
gdxVersion = '1.9.9'
roboVMVersion = '2.3.0'
uCoreVersion = 'f73e538757ac66ff62d7f25d93011142b6abb8df'
uCoreVersion = '7eb80a9765557d025d589f28fa1910dffa3fc8ed'
getVersionString = {
String buildVersion = getBuildVersion()

View file

@ -1,5 +1,6 @@
{
duplicatePadding: true,
combineSubdirectories: true,
flattenPaths: true
flattenPaths: true,
fast: true
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 267 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 284 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 282 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 248 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 238 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 234 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 238 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 B

After

Width:  |  Height:  |  Size: 135 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

View file

@ -351,6 +351,7 @@ text.category.items = Items
text.category.crafting = Crafting
text.category.shooting = Shooting
text.category.optional = Optional Enhancements
setting.indicators.name = Ally Indicators
setting.autotarget.name = Auto-Target
setting.fpscap.name = Max FPS
setting.fpscap.none = None

View file

@ -38,7 +38,7 @@ void main() {
else if(m > 0.35) gl_FragColor.rgb = p4;
else gl_FragColor.rgb = vec3(0.0);
gl_FragColor.rgb *= 0.75;
gl_FragColor.rgb *= 0.5;
gl_FragColor.a = mod(abs(float(coords.x)) + abs(float(coords.y)), 110.0) < 35.0 ? 1.0 : 0.0;
}

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Before After
Before After

View file

@ -12,22 +12,23 @@ TintedDrawable: {
invis: {name: white, color: {r: 0, g: 0, b: 0, a: 0} }
loadDim: {name: white, color: {r: 0, g: 0, b: 0, a: 0.8} },
chatfield: {name: white, color: {r: 0, g: 0, b: 0, a: 0.2}},
clear: {name: white, color: {r: 0.1, g: 0.1, b: 0.1, a: 0.75}},
dark: {name: white, color: {hex: "#000000ff"}},
none: {name: white, color: {r: 0, g: 0, b: 0, a: 0}},
clear-over: {name: white, color: { hex: "#ffffff82" }},
clear-alpha: {name: white, color: { hex: "#ffd37fff" }},
clear-down: {name: white, color: { hex: "#ffd37fff" }}
flat: {name: white, color: {r: 0.0, g: 0.0, b: 0.0, a: 0.42}},
flat-over: {name: white, color: { hex: "#ffffff82" }},
flat-alpha: {name: white, color: { hex: "#ffd37fff" }},
flat-down: {name: white, color: { hex: "#ffd37fff" }}
},
ButtonStyle: {
default: {down: button-down, up: button },
toggle: {checked: button-down, down: button-down, up: button }
},
TextButtonStyle: {
default: {over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: gray, down: button-down, up: button, transition: 0 },
default: {over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: gray, down: button-down, up: button},
clear: {over: flat-over, font: default-font, fontColor: white, disabledFontColor: gray, down: pane, up: flat},
discord: {font: default-font, fontColor: white, up: discord-banner},
info: {font: default-font, fontColor: white, up: info-banner},
clear: {down: clear-down, up: clear, over: clear-over, font: default-font, fontColor: white, disabledFontColor: gray },
clear-partial: {down: white, up: button-select, over: clear-down, font: default-font, fontColor: white, disabledFontColor: gray },
clear-partial: {down: white, up: button-select, over: flat-down, font: default-font, fontColor: white, disabledFontColor: gray },
empty: {font: default-font},
toggle: {font: default-font, fontColor: white, checked: button-down, down: button-down, up: button, over: button-over, disabled: button, disabledFontColor: gray }
},
@ -39,24 +40,22 @@ ImageButtonStyle: {
static-down: {up: button-down },
toggle: {checked: button-down, down: button-down, up: button, imageDisabledColor: gray, imageUpColor: white },
select: {checked: button-select, up: none },
clear: {down: clear-down, up: clear, over: clear-over},
clear-partial: {down: clear-down, up: none, over: clear-over},
clear-toggle: {down: clear-down, checked: clear-down, up: clear, over: clear-over},
clear-toggle-partial: {down: clear-down, checked: clear-down, up: none, over: clear-over},
clear: {down: flat-down, up: flat, over: flat-over},
clear-full: {down: white, up: button-select, over: flat-down},
clear-partial: {down: flat-down, up: none, over: flat-over},
clear-toggle: {down: flat-down, checked: flat-down, up: flat, over: flat-over},
clear-toggle-partial: {down: flat-down, checked: flat-down, up: none, over: flat-over},
},
ScrollPaneStyle: {
default: {background: border, vScroll: scroll, vScrollKnob: scroll-knob-vertical-black},
horizontal: {background: border, vScroll: scroll, vScrollKnob: scroll-knob-vertical, hScroll: scroll-horizontal, hScrollKnob: scroll-knob-horizontal},
volume: {background: button, vScroll: scroll, vScrollKnob: scroll-knob-vertical-black},
clear: {vScroll: scroll, vScrollKnob: scroll-knob-vertical-black},
clear-black: {vScroll: scroll, vScrollKnob: scroll-knob-vertical-black}
default: {vScroll: scroll, vScrollKnob: scroll-knob-vertical-black},
horizontal: {vScroll: scroll, vScrollKnob: scroll-knob-vertical, hScroll: scroll-horizontal, hScrollKnob: scroll-knob-horizontal},
},
WindowStyle: {
default: {titleFont: default-font, titleFontColor: accent },
dialog: {stageBackground: dialogDim, titleFont: default-font, background: window-empty, titleFontColor: accent }
},
KeybindDialogStyle: {
default: {keyColor: accent, keyNameColor: white, controllerColor: lightgray, paneStyle: clear},
default: {keyColor: accent, keyNameColor: white, controllerColor: lightgray},
},
SliderStyle: {
default-horizontal: {background: slider, knob: slider-knob, knobOver: slider-knob-over, knobDown: slider-knob-down},
@ -67,8 +66,8 @@ LabelStyle: {
small: {font: default-font, fontColor: white }
},
TextFieldStyle: {
default: {font: default-font-chat, fontColor: white, disabledFontColor: gray, selection: selection, background: button, cursor: cursor, messageFont: default-font, messageFontColor: gray }
textarea: {font: default-font-chat, fontColor: white, disabledFontColor: gray, selection: selection, background: textarea, cursor: cursor, messageFont: default-font, messageFontColor: gray }
default: {font: default-font-chat, fontColor: white, disabledFontColor: gray, selection: selection, background: underline, cursor: cursor, messageFont: default-font, messageFontColor: gray }
textarea: {font: default-font-chat, fontColor: white, disabledFontColor: gray, selection: selection, background: underline, cursor: cursor, messageFont: default-font, messageFontColor: gray }
},
CheckBoxStyle: {
default: {checkboxOn: check-on, checkboxOff: check-off, checkboxOnOver: check-on-over, checkboxOver: check-over, font: default-font, fontColor: white, disabledFontColor: gray }

View file

@ -14,7 +14,7 @@ public class AmmoTypes implements ContentList{
bulletDenseBig, bulletPyratiteBig, bulletThoriumBig,
shock, bombExplosive, bombIncendiary, bombOil, shellCarbide, flamerThermite, weaponMissile, weaponMissileSwarm, bulletMech,
healBlaster, bulletGlaive,
/*flakCopper, */flakExplosive, flakPlastic, flakSurge,
flakExplosive, flakPlastic, flakSurge,
missileExplosive, missileIncindiary, missileSurge,
artilleryDense, artilleryPlastic, artilleryHoming, artilleryIncindiary, artilleryExplosive, unitArtillery,
basicFlame, lancerLaser, lightning, meltdownLaser, burstLaser,

View file

@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Align;
@ -58,7 +59,9 @@ public class MapEditorDialog extends Dialog implements Disposable{
private ButtonGroup<ImageButton> blockgroup;
public MapEditorDialog(){
super("$text.mapeditor", "dialog");
super("", "dialog");
background("dark");
editor = new MapEditor();
view = new MapView(editor);
@ -227,6 +230,11 @@ public class MapEditorDialog extends Dialog implements Disposable{
});
}
@Override
protected void drawBackground(Batch batch, float parentAlpha, float x, float y){
drawDefaultBackground(batch, parentAlpha, x, y);
}
private void save(){
String name = editor.getTags().get("name", "");
@ -352,7 +360,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
table(cont -> {
cont.left();
cont.table("button", mid -> {
cont.table(mid -> {
mid.top();
Table tools = new Table().top();
@ -360,7 +368,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
ButtonGroup<ImageButton> group = new ButtonGroup<>();
Consumer<EditorTool> addTool = tool -> {
ImageButton button = new ImageButton("icon-" + tool.name(), "toggle");
ImageButton button = new ImageButton("icon-" + tool.name(), "clear-toggle");
button.clicked(() -> view.setTool(tool));
button.resizeImage(16 * 2f);
button.update(() -> button.setChecked(view.getTool() == tool));
@ -368,21 +376,21 @@ public class MapEditorDialog extends Dialog implements Disposable{
if(tool == EditorTool.pencil)
button.setChecked(true);
tools.add(button).padBottom(-5.1f);
tools.add(button);
};
tools.defaults().size(size, size + 4f).padBottom(-5.1f);
tools.defaults().size(size, size + 4f);
tools.addImageButton("icon-menu-large", 16 * 2f, menu::show);
tools.addImageButton("icon-menu-large", "clear", 16 * 2f, menu::show);
ImageButton grid = tools.addImageButton("icon-grid", "toggle", 16 * 2f, () -> view.setGrid(!view.isGrid())).get();
ImageButton grid = tools.addImageButton("icon-grid", "clear-toggle", 16 * 2f, () -> view.setGrid(!view.isGrid())).get();
addTool.accept(EditorTool.zoom);
tools.row();
ImageButton undo = tools.addImageButton("icon-undo", 16 * 2f, () -> view.undo()).get();
ImageButton redo = tools.addImageButton("icon-redo", 16 * 2f, () -> view.redo()).get();
ImageButton undo = tools.addImageButton("icon-undo", "clear", 16 * 2f, () -> view.undo()).get();
ImageButton redo = tools.addImageButton("icon-redo", "clear", 16 * 2f, () -> view.redo()).get();
addTool.accept(EditorTool.pick);
@ -404,7 +412,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
addTool.accept(EditorTool.fill);
addTool.accept(EditorTool.elevation);
ImageButton rotate = tools.addImageButton("icon-arrow-16", 16 * 2f, () -> editor.setDrawRotation((editor.getDrawRotation() + 1) % 4)).get();
ImageButton rotate = tools.addImageButton("icon-arrow-16", "clear", 16 * 2f, () -> editor.setDrawRotation((editor.getDrawRotation() + 1) % 4)).get();
rotate.getImage().update(() -> {
rotate.getImage().setRotation(editor.getDrawRotation() * 90);
rotate.getImage().setOrigin(Align.center);
@ -412,8 +420,8 @@ public class MapEditorDialog extends Dialog implements Disposable{
tools.row();
tools.table("button", t -> t.add("$text.editor.teams"))
.colspan(3).height(40).width(size * 3f);
tools.table("underline", t -> t.add("$text.editor.teams"))
.colspan(3).height(40).width(size * 3f).padBottom(3);
tools.row();
@ -422,14 +430,14 @@ public class MapEditorDialog extends Dialog implements Disposable{
int i = 0;
for(Team team : Team.all){
ImageButton button = new ImageButton("white", "toggle");
button.margin(4f, 4f, 10f, 4f);
ImageButton button = new ImageButton("white", "clear-toggle-partial");
button.margin(4f);
button.getImageCell().grow();
button.getStyle().imageUpColor = team.color;
button.clicked(() -> editor.setDrawTeam(team));
button.update(() -> button.setChecked(editor.getDrawTeam() == team));
teamgroup.add(button);
tools.add(button).padBottom(-5.1f);
tools.add(button);
if(i++ % 3 == 2) tools.row();
}
@ -438,7 +446,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
mid.row();
mid.table("button", t -> {
mid.table("underline", t -> {
Slider slider = new Slider(0, MapEditor.brushSizes.length - 1, 1, false);
slider.moved(f -> editor.setBrushSize(MapEditor.brushSizes[(int) (float) f]));
@ -450,28 +458,27 @@ public class MapEditorDialog extends Dialog implements Disposable{
mid.row();
mid.table("button", t -> t.add("$text.editor.elevation"))
mid.table("underline", t -> t.add("$text.editor.elevation"))
.colspan(3).height(40).width(size * 3f);
mid.row();
mid.table("button", t -> {
mid.table("underline", t -> {
t.margin(0);
t.addImageButton("icon-arrow-left", 16 * 2f, () -> editor.setDrawElevation(editor.getDrawElevation() - 1))
t.addImageButton("icon-arrow-left", "clear-partial", 16 * 2f, () -> editor.setDrawElevation(editor.getDrawElevation() - 1))
.disabled(b -> editor.getDrawElevation() <= -1).size(size);
t.label(() -> editor.getDrawElevation() == -1 ? "$text.editor.slope" : (editor.getDrawElevation() + ""))
.size(size).get().setAlignment(Align.center, Align.center);
t.addImageButton("icon-arrow-right", 16 * 2f, () -> editor.setDrawElevation(editor.getDrawElevation() + 1))
t.addImageButton("icon-arrow-right", "clear-partial", 16 * 2f, () -> editor.setDrawElevation(editor.getDrawElevation() + 1))
.disabled(b -> editor.getDrawElevation() >= 63).size(size);
}).colspan(3).height(size).padTop(-5).width(size * 3f);
}).colspan(3).height(size).width(size * 3f);
}).margin(0).left().growY();
cont.table("button", t -> t.add(view).grow())
.margin(5).marginBottom(10).grow();
cont.table(t -> t.add(view).grow()).grow();
cont.table(this::addBlockSelection).right().growY();
@ -525,7 +532,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
private void addBlockSelection(Table table){
Table content = new Table();
pane = new ScrollPane(content, "volume");
pane = new ScrollPane(content);
pane.setFadeScrollBars(false);
pane.setOverscroll(true, false);
ButtonGroup<ImageButton> group = new ButtonGroup<>();
@ -552,7 +559,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
stack.add(new Image(region));
}
ImageButton button = new ImageButton("white", "toggle");
ImageButton button = new ImageButton("white", "clear-toggle");
button.clicked(() -> editor.setDrawBlock(block));
button.resizeImage(8 * 4f);
button.getImageCell().setActor(stack);
@ -560,7 +567,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
button.getImage().remove();
button.update(() -> button.setChecked(editor.getDrawBlock() == block));
group.add(button);
content.add(button).pad(4f).size(53f, 58f);
content.add(button).size(60f);
if(i++ % 3 == 2){
content.row();
@ -569,9 +576,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
group.getButtons().get(2).setChecked(true);
Table extra = new Table("button");
extra.labelWrap(() -> editor.getDrawBlock().formalName).width(220f).center();
table.add(extra).growX();
table.table("underline", extra -> extra.labelWrap(() -> editor.getDrawBlock().formalName).width(220f).center()).growX();
table.row();
table.add(pane).growY().fillX();
}

View file

@ -270,8 +270,8 @@ public class MapView extends Element implements GestureListener{
Graphics.beginClip(x, y, width, height);
Draw.color(Color.LIGHT_GRAY);
Lines.stroke(-2f);
Draw.color(Palette.remove);
Lines.stroke(2f);
Lines.rect(centerx - sclwidth / 2 - 1, centery - sclheight / 2 - 1, sclwidth + 2, sclheight + 2);
editor.renderer().draw(centerx - sclwidth / 2, centery - sclheight / 2, sclwidth, sclheight);
Draw.reset();

View file

@ -2,6 +2,7 @@ package io.anuke.mindustry.graphics;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.blocks.Blocks;
@ -12,16 +13,21 @@ import io.anuke.mindustry.input.InputHandler;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.meta.BlockBar;
import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.core.Settings;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Tmp;
import static io.anuke.mindustry.Vars.*;
public class OverlayRenderer{
private static final float indicatorLength = 14f;
private static final Rectangle rect = new Rectangle();
private float buildFadeTime;
public void drawBottom(){
@ -45,6 +51,21 @@ public class OverlayRenderer{
public void drawTop(){
for(Player player : playerGroup.all()){
if(Settings.getBool("indicators") && player != players[0] && player.getTeam() == players[0].getTeam()){
if(!rect.setSize(Core.camera.viewportWidth * Core.camera.zoom * 0.9f, Core.camera.viewportHeight * Core.camera.zoom * 0.9f)
.setCenter(Core.camera.position.x, Core.camera.position.y).contains(player.x, player.y)){
Tmp.v1.set(player.x, player.y).sub(Core.camera.position.x, Core.camera.position.y).setLength(indicatorLength);
Draw.color(player.getTeam().color);
Lines.stroke(2f);
Lines.lineAngle(Core.camera.position.x + Tmp.v1.x, Core.camera.position.y + Tmp.v1.y, Tmp.v1.angle(), 4f);
Draw.reset();
}
}
}
for(Player player : players){
if(player.isDead()) continue; //dead players don't draw

View file

@ -356,13 +356,12 @@ public class Net{
Gdx.net.sendHttpRequest(req, new HttpResponseListener(){
@Override
public void handleHttpResponse(HttpResponse httpResponse){
String result = httpResponse.getResultAsString();
Gdx.app.postRunnable(() -> listener.accept(result));
listener.accept(httpResponse.getResultAsString());
}
@Override
public void failed(Throwable t){
Gdx.app.postRunnable(() -> failure.accept(t));
failure.accept(t);
}
@Override

View file

@ -22,7 +22,7 @@ public class MenuButton extends TextButton{
table(t -> {
t.addImage(icon).size(14 * 3);
t.update(() -> t.setBackground(getClickListener().isOver() || getClickListener().isVisualPressed() ? "button-over" : "button"));
t.update(() -> t.setBackground(getClickListener().isVisualPressed() ? "button-down" : getClickListener().isOver() ? "button-over" : "button"));
}).size(s - 5, s);

View file

@ -16,10 +16,9 @@ import static io.anuke.mindustry.Vars.*;
public class Minimap extends Table{
public Minimap(){
super("button");
super("pane");
margin(5);
marginBottom(10);
TextureRegion r = new TextureRegion();

View file

@ -42,14 +42,14 @@ public class AboutDialog extends FloatingDialog{
float w = UIUtils.portrait() ? 330f : 600f;
Table in = new Table();
ScrollPane pane = new ScrollPane(in, "clear");
ScrollPane pane = new ScrollPane(in);
for(LinkEntry link : Links.getLinks()){
if((ios || OS.isMac) && bannedItems.contains(link.name)){ //because Apple doesn't like me mentioning things
continue;
}
Table table = new Table("button");
Table table = new Table("underline-2");
table.margin(0);
table.table(img -> {
img.addImage("white").height(h - 5).width(40f).color(link.color);
@ -58,7 +58,7 @@ public class AboutDialog extends FloatingDialog{
}).expandY();
table.table(i -> {
i.background("button");
i.background("button-edge-3");
i.addImage("icon-" + link.name).size(14 * 3f);
}).size(h - 5, h);

View file

@ -24,7 +24,7 @@ public class AdminsDialog extends FloatingDialog{
Table table = new Table();
ScrollPane pane = new ScrollPane(table, "clear");
ScrollPane pane = new ScrollPane(table);
pane.setFadeScrollBars(false);
if(netServer.admins.getAdmins().size == 0){

View file

@ -25,7 +25,7 @@ public class BansDialog extends FloatingDialog{
Table table = new Table();
ScrollPane pane = new ScrollPane(table, "clear");
ScrollPane pane = new ScrollPane(table);
pane.setFadeScrollBars(false);
if(netServer.admins.getBanned().size == 0){

View file

@ -38,7 +38,7 @@ public class ChangelogDialog extends FloatingDialog{
void setup(){
Table table = new Table();
ScrollPane pane = new ScrollPane(table, "clear");
ScrollPane pane = new ScrollPane(table);
content().clear();
content().add(pane).grow();
@ -60,7 +60,7 @@ public class ChangelogDialog extends FloatingDialog{
desc = desc.replace("Android", "Mobile");
Table in = new Table("clear");
Table in = new Table("underline");
in.top().left().margin(10);
in.add("[accent]" + info.name + "[LIGHT_GRAY] | " + info.date);

View file

@ -25,10 +25,10 @@ public class ColorPickDialog extends Dialog{
for(int i = 0; i < playerColors.length; i++){
Color color = playerColors[i];
ImageButton button = table.addImageButton("white", "toggle", 34, () -> {
ImageButton button = table.addImageButton("white", "clear-toggle", 34, () -> {
cons.accept(color);
hide();
}).size(44, 48).pad(0).padBottom(-5.1f).get();
}).size(48).get();
button.setChecked(players[0].color.equals(color));
button.getStyle().imageUpColor = color;

View file

@ -20,7 +20,7 @@ public class ContentInfoDialog extends FloatingDialog{
content.displayInfo(table);
ScrollPane pane = new ScrollPane(table, "clear-black");
ScrollPane pane = new ScrollPane(table);
content().add(pane);
show();

View file

@ -23,7 +23,7 @@ import static io.anuke.mindustry.Vars.*;
public class CustomGameDialog extends FloatingDialog{
public CustomGameDialog(){
super("$text.level.select");
super("$text.customgame");
addCloseButton();
shown(this::setup);
@ -35,7 +35,7 @@ public class CustomGameDialog extends FloatingDialog{
Table maps = new Table();
maps.marginRight(14);
ScrollPane pane = new ScrollPane(maps, "clear-black");
ScrollPane pane = new ScrollPane(maps);
pane.setFadeScrollBars(false);
int maxwidth = (Gdx.graphics.getHeight() > Gdx.graphics.getHeight() ? 2 : 4);
@ -52,7 +52,7 @@ public class CustomGameDialog extends FloatingDialog{
if(mode.hidden) continue;
modes.addButton("$mode." + mode.name() + ".name", "toggle", () -> state.mode = mode)
.update(b -> b.setChecked(state.mode == mode)).group(group).size(140f, 54f).padBottom(-5);
.update(b -> b.setChecked(state.mode == mode)).group(group).size(140f, 54f);
if(i++ % 2 == 1) modes.row();
}
selmode.add(modes);
@ -139,7 +139,7 @@ public class CustomGameDialog extends FloatingDialog{
d.setFillParent(false);
Table table = new Table();
table.defaults().pad(1f);
ScrollPane pane = new ScrollPane(table, "clear");
ScrollPane pane = new ScrollPane(table);
pane.setFadeScrollBars(false);
table.row();
for(GameMode mode : GameMode.values()){

View file

@ -34,13 +34,13 @@ public class HostDialog extends FloatingDialog{
ui.listfrag.rebuild();
}).grow().pad(8).get().setMaxLength(40);
ImageButton button = t.addImageButton("white", 40, () -> {
ImageButton button = t.addImageButton("white", "clear-full", 40, () -> {
new ColorPickDialog().show(color -> {
player.color.set(color);
Settings.putInt("color-0", Color.rgba8888(color));
Settings.save();
});
}).size(50f, 54f).get();
}).size(54f).get();
button.update(() -> button.getStyle().imageUpColor = player.color);
}).width(w).height(70f).pad(4).colspan(3);

View file

@ -96,7 +96,7 @@ public class JoinDialog extends FloatingDialog{
//why are java lambdas this bad
TextButton[] buttons = {null};
TextButton button = buttons[0] = remote.addButton("[accent]" + server.displayIP(), "clear", () -> {
TextButton button = buttons[0] = remote.addButton("[accent]" + server.displayIP(), () -> {
if(!buttons[0].childrenPressed()){
connect(server.ip, server.port);
}
@ -194,7 +194,7 @@ public class JoinDialog extends FloatingDialog{
hosts.row();
hosts.add(local).width(w);
ScrollPane pane = new ScrollPane(hosts, "clear");
ScrollPane pane = new ScrollPane(hosts);
pane.setFadeScrollBars(false);
pane.setScrollingDisabled(true, false);
@ -210,19 +210,19 @@ public class JoinDialog extends FloatingDialog{
Settings.save();
}).grow().pad(8).get().setMaxLength(maxNameLength);
ImageButton button = t.addImageButton("white", 40, () -> {
ImageButton button = t.addImageButton("white", "clear-full", 40, () -> {
new ColorPickDialog().show(color -> {
player.color.set(color);
Settings.putInt("color-0", Color.rgba8888(color));
Settings.save();
});
}).size(50f, 54f).get();
}).size(54f).get();
button.update(() -> button.getStyle().imageUpColor = player.color);
}).width(w).height(70f).pad(4);
content().row();
content().add(pane).width(w + 38).pad(0);
content().row();
content().addCenteredImageTextButton("$text.server.add", "icon-add", "clear", 14 * 3, () -> {
content().addCenteredImageTextButton("$text.server.add", "icon-add", 14 * 3, () -> {
renaming = null;
add.show();
}).marginLeft(6).width(w).height(80f).update(button -> {
@ -273,7 +273,7 @@ public class JoinDialog extends FloatingDialog{
local.row();
TextButton button = local.addButton("[accent]" + host.name, "clear", () -> connect(host.address, port))
TextButton button = local.addButton("[accent]" + host.name, () -> connect(host.address, port))
.width(w).height(80f).pad(4f).get();
button.left();
button.row();

View file

@ -24,7 +24,7 @@ public class LanguageDialog extends FloatingDialog{
private void setup(){
Table langs = new Table();
langs.marginRight(24f).marginLeft(24f);
ScrollPane pane = new ScrollPane(langs, "clear");
ScrollPane pane = new ScrollPane(langs);
pane.setFadeScrollBars(false);
ButtonGroup<TextButton> group = new ButtonGroup<>();
@ -38,7 +38,7 @@ public class LanguageDialog extends FloatingDialog{
Log.info("Setting locale: {0}", loc.toString());
ui.showInfo("$text.language.restart");
});
langs.add(button).group(group).update(t -> t.setChecked(loc.equals(getLocale()))).size(400f, 50f).row();
langs.add(button).group(group).update(t -> t.setChecked(loc.equals(getLocale()))).size(400f, 50f).pad(2).row();
}
content().add(pane);

View file

@ -45,7 +45,7 @@ public class LoadDialog extends FloatingDialog{
content().clear();
slots = new Table();
pane = new ScrollPane(slots, "clear-black");
pane = new ScrollPane(slots);
pane.setFadeScrollBars(false);
pane.setScrollingDisabled(true, false);
@ -146,7 +146,7 @@ public class LoadDialog extends FloatingDialog{
if(!valids){
slots.row();
slots.addButton("$text.save.none", "clear", () -> {
slots.addButton("$text.save.none", () -> {
}).disabled(true).fillX().margin(20f).minWidth(340f).height(80f).pad(4f);
}
@ -154,7 +154,7 @@ public class LoadDialog extends FloatingDialog{
if(ios) return;
slots.addImageTextButton("$text.save.import", "icon-add", "clear", 14 * 3, () -> {
slots.addImageTextButton("$text.save.import", "icon-add", 14 * 3, () -> {
Platform.instance.showFileChooser(Bundles.get("text.save.import"), "Mindustry Save", file -> {
if(SaveIO.isSaveValid(file)){
try{

View file

@ -4,8 +4,8 @@ import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.Scaling;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.core.Platform;
import io.anuke.mindustry.maps.Map;
import io.anuke.mindustry.io.MapIO;
import io.anuke.mindustry.maps.Map;
import io.anuke.mindustry.maps.MapMeta;
import io.anuke.mindustry.maps.MapTileData;
import io.anuke.mindustry.ui.BorderImage;
@ -73,7 +73,7 @@ public class MapsDialog extends FloatingDialog{
Table maps = new Table();
maps.marginRight(24);
ScrollPane pane = new ScrollPane(maps, "clear-black");
ScrollPane pane = new ScrollPane(maps);
pane.setFadeScrollBars(false);
int maxwidth = 4;
@ -88,7 +88,7 @@ public class MapsDialog extends FloatingDialog{
TextButton button = maps.addButton("", "clear", () -> showMapInfo(map)).width(mapsize).pad(8).get();
button.clearChildren();
button.margin(6);
button.margin(9);
button.add(map.meta.tags.get("name", map.name)).growX().center().get().setEllipsis(true);
button.row();
button.addImage("white").growX().pad(4).color(Color.GRAY);
@ -121,7 +121,7 @@ public class MapsDialog extends FloatingDialog{
Table t = new Table();
t.margin(6);
ScrollPane pane = new ScrollPane(t, "clear-black");
ScrollPane pane = new ScrollPane(t);
desc.add(pane).grow();
t.top();
@ -146,7 +146,7 @@ public class MapsDialog extends FloatingDialog{
table.row();
table.addImageTextButton("$text.editor.openin", "icon-load-map", "clear", 16 * 2, () -> {
table.addImageTextButton("$text.editor.openin", "icon-load-map", 16 * 2, () -> {
try{
Vars.ui.editor.beginEditMap(map.stream.get());
dialog.hide();
@ -155,15 +155,15 @@ public class MapsDialog extends FloatingDialog{
e.printStackTrace();
ui.showError("$text.error.mapnotfound");
}
}).fillX().height(50f).marginLeft(6);
}).fillX().height(54f).marginLeft(10);
table.addImageTextButton("$text.delete", "icon-trash-16", "clear", 16 * 2, () -> {
table.addImageTextButton("$text.delete", "icon-trash-16", 16 * 2, () -> {
ui.showConfirm("$text.confirm", Bundles.format("text.map.delete", map.name), () -> {
world.maps.removeMap(map);
dialog.hide();
setup();
});
}).fillX().height(50f).marginLeft(6).disabled(!map.custom).touchable(map.custom ? Touchable.enabled : Touchable.disabled);
}).fillX().height(54f).marginLeft(10).disabled(!map.custom).touchable(map.custom ? Touchable.enabled : Touchable.disabled);
dialog.show();
}

View file

@ -22,7 +22,7 @@ public class SaveDialog extends LoadDialog{
public void addSetup(){
slots.row();
slots.addImageTextButton("$text.save.new", "icon-add", "clear", 14 * 3, () ->
slots.addImageTextButton("$text.save.new", "icon-add",14 * 3, () ->
ui.showTextInput("$text.save", "$text.save.newslot", "", text -> {
ui.loadGraphics("$text.saving", () -> {
control.saves.addSave(text);

View file

@ -95,7 +95,7 @@ public class SettingsMenuDialog extends SettingsDialog{
prefs.clearChildren();
prefs.add(menu);
ScrollPane pane = new ScrollPane(prefs, "clear");
ScrollPane pane = new ScrollPane(prefs);
pane.addCaptureListener(new InputListener(){
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button){
@ -148,21 +148,21 @@ public class SettingsMenuDialog extends SettingsDialog{
dialog.setFillParent(false);
dialog.content().defaults().size(230f, 60f).pad(3);
dialog.addCloseButton();
dialog.content().addButton("$text.settings.clearsectors", "clear", () -> {
dialog.content().addButton("$text.settings.clearsectors", () -> {
ui.showConfirm("$text.confirm", "$text.settings.clear.confirm", () -> {
world.sectors.clear();
dialog.hide();
});
});
dialog.content().row();
dialog.content().addButton("$text.settings.clearunlocks", "clear", () -> {
dialog.content().addButton("$text.settings.clearunlocks", () -> {
ui.showConfirm("$text.confirm", "$text.settings.clear.confirm", () -> {
control.unlocks.reset();
dialog.hide();
});
});
dialog.content().row();
dialog.content().addButton("$text.settings.clearall", "clear", () -> {
dialog.content().addButton("$text.settings.clearall", () -> {
ui.showConfirm("$text.confirm", "$text.settings.clearall.confirm", () -> {
Map<String, Object> map = new HashMap<>();
for(String value : Settings.prefs().get().keySet()){
@ -208,6 +208,7 @@ public class SettingsMenuDialog extends SettingsDialog{
}
graphics.checkPref("fps", false);
graphics.checkPref("indicators", true);
graphics.checkPref("lasers", true);
graphics.checkPref("minimap", !mobile); //minimap is disabled by default on mobile devices
}

View file

@ -32,7 +32,7 @@ public class UnlocksDialog extends FloatingDialog{
Table table = new Table();
table.margin(20);
ScrollPane pane = new ScrollPane(table, "clear-black");
ScrollPane pane = new ScrollPane(table);
Array<Content>[] allContent = content.getContentMap();
@ -65,9 +65,8 @@ public class UnlocksDialog extends FloatingDialog{
if(control.unlocks.isUnlocked(unlock)){
image.clicked(() -> Vars.ui.content.show(unlock));
image.addListener(new Tooltip<>(new Table("clear"){{
image.addListener(new Tooltip<>(new Table("button"){{
add(unlock.localizedName());
margin(4);
}}));
}

View file

@ -106,7 +106,7 @@ public class PlacementFragment extends Fragment{
};
//top table with hover info
frame.table("clear", top -> {
frame.table("button-edge-2", top -> {
topTable = top;
top.add(new Table()).growX().update(topTable -> {
if((tileDisplayBlock() == null && lastDisplay == getSelected()) ||
@ -160,16 +160,15 @@ public class PlacementFragment extends Fragment{
topTable.labelWrap(lastDisplay.getDisplayName(hoverTile)).left().width(190f).padLeft(5);
}
});
top.row();
top.addImage("blank").growX().color(Palette.accent).height(3f);
}).colspan(3).fillX().visible(() -> getSelected() != null || tileDisplayBlock() != null).touchable(Touchable.enabled);
frame.row();
frame.table("clear", blocksSelect -> {
frame.addImage("blank").color(Palette.accent).colspan(3).height(3*2).growX();
frame.row();
frame.table("pane-2", blocksSelect -> {
blocksSelect.table(blocks -> blockTable = blocks).grow();
blocksSelect.row();
blocksSelect.table(input::buildUI).growX();
}).fillY().bottom().touchable(Touchable.enabled);
frame.addImage("blank").width(3f).fillY().color(Palette.accent);
frame.table(categories -> {
categories.defaults().size(50f);

View file

@ -45,10 +45,10 @@ public class PlayerListFragment extends Fragment{
}
});
cont.table("pane", pane -> {
cont.table("clear", pane -> {
pane.label(() -> Bundles.format(playerGroup.size() == 1 ? "text.players.single" : "text.players", playerGroup.size()));
pane.row();
pane.pane("clear", content).grow().get().setScrollingDisabled(true, false);
pane.pane(content).grow().get().setScrollingDisabled(true, false);
pane.row();
pane.table("pane", menu -> {