Mobile and desktop UI changes
BIN
core/assets-raw/sprites/ui/icon-info.png
Normal file
After Width: | Height: | Size: 185 B |
BIN
core/assets-raw/sprites/ui/icon-load.png
Normal file
After Width: | Height: | Size: 195 B |
BIN
core/assets-raw/sprites/ui/icon-play-2.png
Normal file
After Width: | Height: | Size: 208 B |
BIN
core/assets-raw/sprites/ui/icon-tools.png
Normal file
After Width: | Height: | Size: 216 B |
BIN
core/assets-raw/sprites/ui/icon-tutorial.png
Normal file
After Width: | Height: | Size: 222 B |
BIN
core/assets-raw/sprites/ui/pane-button.9.png
Normal file
After Width: | Height: | Size: 172 B |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
@ -21,7 +21,7 @@ com.badlogic.gdx.graphics.Color: {
|
||||
},
|
||||
io.anuke.ucore.scene.Skin$TintedDrawable: {
|
||||
dialogDim: {name: white, color: {r: 0, g: 0, b: 0, a: 0.9} }
|
||||
loadDim: {name: white, color: {r: 0, g: 0, b: 0, a: 0.7} }
|
||||
loadDim: {name: white, color: {r: 0, g: 0, b: 0, a: 0.8} }
|
||||
},
|
||||
io.anuke.ucore.scene.ui.Button$ButtonStyle: {
|
||||
default: {down: button-down, up: button },
|
||||
|
@ -393,8 +393,7 @@ public class UI extends SceneModule{
|
||||
atop();
|
||||
aright();
|
||||
|
||||
new table(){{
|
||||
get().background("button");
|
||||
new table("button"){{
|
||||
|
||||
new label(()->"[orange]Wave " + control.getWave()).scale(fontscale*2f).left();
|
||||
|
||||
@ -410,66 +409,90 @@ public class UI extends SceneModule{
|
||||
|
||||
get().setVisible(play);
|
||||
}}.end();
|
||||
|
||||
//menu table
|
||||
new table(){{
|
||||
|
||||
new table("pane"){{
|
||||
defaults().size(220, 48).pad(3);
|
||||
|
||||
if(!android){
|
||||
//menu table
|
||||
new table(){{
|
||||
|
||||
new button("Play", () -> {
|
||||
levels.show();
|
||||
});
|
||||
|
||||
row();
|
||||
|
||||
new button("Tutorial", ()->{
|
||||
//TODO show loading, etc
|
||||
control.playMap(Map.tutorial);
|
||||
});
|
||||
|
||||
if(Gdx.app.getType() != ApplicationType.WebGL){
|
||||
row();
|
||||
|
||||
new button("Load Game", () -> {
|
||||
load.show();
|
||||
});
|
||||
}
|
||||
|
||||
row();
|
||||
|
||||
new button("Settings", () -> {
|
||||
prefs.show(scene);
|
||||
});
|
||||
|
||||
row();
|
||||
|
||||
if(!android){
|
||||
new button("Controls", () -> {
|
||||
keys.show(scene);
|
||||
new table("pane"){{
|
||||
defaults().size(220, 48).pad(3);
|
||||
|
||||
new button("Play", () -> {
|
||||
levels.show();
|
||||
});
|
||||
|
||||
row();
|
||||
}
|
||||
|
||||
if(Gdx.app.getType() != ApplicationType.WebGL && !android){
|
||||
new button("Exit", () -> {
|
||||
Gdx.app.exit();
|
||||
|
||||
new button("Tutorial", ()->{
|
||||
control.playMap(Map.tutorial);
|
||||
});
|
||||
}
|
||||
|
||||
if(Gdx.app.getType() != ApplicationType.WebGL){
|
||||
row();
|
||||
|
||||
new button("Load Game", () -> {
|
||||
load.show();
|
||||
});
|
||||
}
|
||||
|
||||
row();
|
||||
|
||||
new button("Settings", () -> {
|
||||
prefs.show(scene);
|
||||
});
|
||||
|
||||
row();
|
||||
|
||||
if(!android){
|
||||
new button("Controls", () -> {
|
||||
keys.show(scene);
|
||||
});
|
||||
|
||||
row();
|
||||
}
|
||||
|
||||
if(Gdx.app.getType() != ApplicationType.WebGL && !android){
|
||||
new button("Exit", () -> {
|
||||
Gdx.app.exit();
|
||||
});
|
||||
}
|
||||
|
||||
get().pad(Unit.dp.inPixels(16));
|
||||
}};
|
||||
|
||||
visible(nplay);
|
||||
}}.end();
|
||||
}else{
|
||||
new table(){{
|
||||
defaults().size(120f).pad(5).units(Unit.dp);
|
||||
float isize = Unit.dp.inPixels(14f*4);
|
||||
|
||||
get().pad(Unit.dp.inPixels(16));
|
||||
}};
|
||||
new imagebutton("icon-play-2", isize, () -> {
|
||||
levels.show();
|
||||
}).text("Play").padTop(4f);
|
||||
|
||||
new imagebutton("icon-tutorial", isize, ()->{
|
||||
control.playMap(Map.tutorial);
|
||||
}).text("Tutorial").padTop(4f);
|
||||
|
||||
new imagebutton("icon-load", isize, () -> {
|
||||
load.show();
|
||||
}).text("Load").padTop(4f);
|
||||
|
||||
visible(nplay);
|
||||
}}.end();
|
||||
new imagebutton("icon-tools", isize, () -> {
|
||||
prefs.show(scene);
|
||||
}).text("Settings").padTop(4f);
|
||||
|
||||
visible(nplay);
|
||||
}}.end();
|
||||
}
|
||||
|
||||
//settings icon
|
||||
new table(){{
|
||||
atop().aright();
|
||||
new imagebutton("icon-settings", Unit.dp.inPixels(40f), ()->{
|
||||
new imagebutton("icon-info", Unit.dp.inPixels(30f), ()->{
|
||||
about.show();
|
||||
}).get().pad(14).padTop(8);
|
||||
}).get().pad(14);
|
||||
}}.end().visible(nplay);
|
||||
|
||||
if(debug){
|
||||
@ -547,11 +570,17 @@ public class UI extends SceneModule{
|
||||
|
||||
loadingtable = new table("loadDim"){{
|
||||
get().setTouchable(Touchable.enabled);
|
||||
new table("button"){{
|
||||
new label("[orange]Loading..."){{
|
||||
get().setName("namelabel");
|
||||
}}.scale(2f*Vars.fontscale).pad(Unit.dp.inPixels(10));
|
||||
}}.end();
|
||||
//new table(){{
|
||||
get().addImage("white").growX()
|
||||
.height(3f).pad(4f).growX().units(Unit.dp).get().setColor(Color.ORANGE);
|
||||
row();
|
||||
new label("[orange]Loading..."){{
|
||||
get().setName("namelabel");
|
||||
}}.pad(10).units(Unit.dp);
|
||||
row();
|
||||
get().addImage("white").growX()
|
||||
.height(3f).pad(4f).growX().units(Unit.dp).get().setColor(Color.ORANGE);
|
||||
//}}.end();
|
||||
}}.end().get();
|
||||
|
||||
loadingtable.setVisible(false);
|
||||
|
@ -5,7 +5,6 @@ import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import io.anuke.ucore.scene.ui.Dialog;
|
||||
import io.anuke.ucore.scene.ui.Image;
|
||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
|
||||
public class FloatingDialog extends Dialog{
|
||||
@ -15,8 +14,8 @@ public class FloatingDialog extends Dialog{
|
||||
setFillParent(true);
|
||||
title().setAlignment(Align.center);
|
||||
getTitleTable().row();
|
||||
getTitleTable().add(new Image("white"))
|
||||
.growX().height(3f).pad(4f).units(Unit.dp).get().setColor(Color.ORANGE);
|
||||
getTitleTable().addImage("white", Color.ORANGE)
|
||||
.growX().height(3f).pad(4f).units(Unit.dp);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,7 +14,7 @@ import io.anuke.ucore.scene.ui.ScrollPane;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
|
||||
public class LevelDialog extends FloatingDialog{
|
||||
public class LevelDialog extends FloatingDialog{
|
||||
private Map selectedMap = Map.delta;
|
||||
private TextureRegion region = new TextureRegion();
|
||||
|
||||
@ -41,10 +41,10 @@ public class LevelDialog extends FloatingDialog{
|
||||
maps.row();
|
||||
}
|
||||
|
||||
Table inset = new Table("pane");
|
||||
Table inset = new Table("pane-button");
|
||||
inset.add("[orange]"+map.name()).pad(3f).units(Unit.dp);
|
||||
inset.row();
|
||||
inset.add((StringSupplier)(()->"High Score: [lime]" + Settings.getInt("hiscore" + map.name())))
|
||||
inset.add((StringSupplier)(()->"High Score: [orange]" + Settings.getInt("hiscore" + map.name())))
|
||||
.pad(3f).units(Unit.dp);
|
||||
inset.pack();
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.anuke.mindustry.ui;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.Timer;
|
||||
import com.badlogic.gdx.utils.Timer.Task;
|
||||
@ -41,19 +42,23 @@ public class LoadDialog extends FloatingDialog{
|
||||
final int slot = i;
|
||||
|
||||
TextButton button = new TextButton("[orange]Slot " + (i + 1));
|
||||
button.getLabelCell().top().left().growX();
|
||||
button.row();
|
||||
button.pad(Unit.dp.inPixels(10));
|
||||
button.getLabelCell().top().left().growX();
|
||||
|
||||
button.row();
|
||||
|
||||
Label info = new Label("[gray]" + (!SaveIO.isSaveValid(i) ? "<empty>" : "Wave " +
|
||||
SaveIO.getWave(slot)+"\nLast Saved: " + SaveIO.getTimeString(i)));
|
||||
info.setAlignment(Align.center, Align.center);
|
||||
|
||||
button.add(info).padBottom(2).padTop(6);
|
||||
button.getLabel().setFontScale(Unit.dp.inPixels(0.75f));
|
||||
button.row();
|
||||
button.addImage("white", Color.GRAY)
|
||||
.growX().height(3f).pad(4f).units(Unit.dp);
|
||||
button.row();
|
||||
modifyButton(button, slot);
|
||||
|
||||
content().add(button).size(400, 80).units(Unit.dp).pad(2);
|
||||
content().add(button).size(400, 86).units(Unit.dp).pad(2);
|
||||
content().row();
|
||||
}
|
||||
|
||||
|
@ -37,10 +37,6 @@ public class UpgradeDialog extends FloatingDialog{
|
||||
GameState.set(State.paused);
|
||||
});
|
||||
|
||||
getButtonTable().addButton("Ok", ()->{
|
||||
hide();
|
||||
}).size(96, 50).pad(5);
|
||||
|
||||
Table weptab = new Table();
|
||||
weptab.pad(20);
|
||||
|
||||
@ -75,7 +71,7 @@ public class UpgradeDialog extends FloatingDialog{
|
||||
|
||||
i++;
|
||||
|
||||
weptab.add(button).width(250);
|
||||
weptab.add(button).width(220);
|
||||
|
||||
Table tiptable = new Table();
|
||||
|
||||
|