Implemented basic client/server connection and title font
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package io.anuke.mindustry.ui;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Colors;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.Scaling;
|
||||
|
||||
@@ -9,13 +11,9 @@ import io.anuke.ucore.scene.ui.Image;
|
||||
|
||||
public class MenuButton extends Button{
|
||||
|
||||
public MenuButton(String icon, PressGroup group, Listenable clicked){
|
||||
public MenuButton(String text, PressGroup group, Listenable clicked){
|
||||
super("menu");
|
||||
Image image = new Image(icon);
|
||||
image.setScaling(Scaling.fit);
|
||||
image.setScale(4f);
|
||||
image.setOrigin(Align.center);
|
||||
add(image);
|
||||
add(text, "title", 4);
|
||||
clicked(clicked);
|
||||
group.add(this);
|
||||
}
|
||||
|
||||
@@ -79,15 +79,10 @@ public class MenuDialog extends FloatingDialog{
|
||||
content().row();
|
||||
|
||||
content().addButton("$text.quit", () -> {
|
||||
new ConfirmDialog("$text.confirm", "$text.quit.confirm", () -> {
|
||||
Vars.ui.showConfirm("$text.confirm", "$text.quit.confirm", () -> {
|
||||
hide();
|
||||
GameState.set(State.menu);
|
||||
}){
|
||||
{
|
||||
for(Cell<?> cell : getButtonTable().getCells())
|
||||
cell.pad(3).size(180, 44);
|
||||
}
|
||||
}.show();
|
||||
});
|
||||
});
|
||||
|
||||
}else{
|
||||
@@ -111,13 +106,10 @@ public class MenuDialog extends FloatingDialog{
|
||||
new imagebutton("icon-load", isize, () -> load.show()).text("$text.load").padTop(4f);
|
||||
|
||||
new imagebutton("icon-quit", isize, () -> {
|
||||
new ConfirmDialog("$text.confirm", "$text.quit.confirm", () -> {
|
||||
Vars.ui.showConfirm("$text.confirm", "$text.quit.confirm", () -> {
|
||||
hide();
|
||||
GameState.set(State.menu);
|
||||
}){{
|
||||
for(Cell<?> cell : getButtonTable().getCells())
|
||||
cell.pad(3).size(180, 44);
|
||||
}}.show();
|
||||
});
|
||||
}).text("Quit").padTop(4f);
|
||||
|
||||
for(Element e : content().getChildren()){
|
||||
|
||||
@@ -25,25 +25,30 @@ public class MenuFragment implements Fragment{
|
||||
float scale = 4f;
|
||||
defaults().size(100*scale, 21*scale).pad(-10f);
|
||||
|
||||
add(new MenuButton("text-play", group, ui::showLevels));
|
||||
add(new MenuButton("$text.play", group, ui::showLevels));
|
||||
row();
|
||||
|
||||
add(new MenuButton("text-tutorial", group, ()-> control.playMap(world.maps().getMap("tutorial"))));
|
||||
row();
|
||||
|
||||
|
||||
if(!gwt){
|
||||
add(new MenuButton("text-load", group, ui::showLoadGame));
|
||||
row();
|
||||
|
||||
add(new MenuButton("text-editor", group, ui::showEditor));
|
||||
add(new MenuButton("$text.joingame", group, ui::showJoinGame));
|
||||
row();
|
||||
}
|
||||
|
||||
add(new MenuButton("text-settings", group, ui::showPrefs));
|
||||
add(new MenuButton("$text.tutorial", group, ()-> control.playMap(world.maps().getMap("tutorial"))));
|
||||
row();
|
||||
|
||||
if(!gwt){
|
||||
add(new MenuButton("text-exit", group, Gdx.app::exit));
|
||||
add(new MenuButton("$text.loadgame", group, ui::showLoadGame));
|
||||
row();
|
||||
|
||||
add(new MenuButton("$text.editor", group, ui::showEditor));
|
||||
row();
|
||||
}
|
||||
|
||||
add(new MenuButton("$text.settings", group, ui::showPrefs));
|
||||
row();
|
||||
|
||||
if(!gwt){
|
||||
add(new MenuButton("$text.quit", group, Gdx.app::exit));
|
||||
}
|
||||
get().margin(16);
|
||||
}}.end();
|
||||
|
||||
Reference in New Issue
Block a user