Improved menu, small fixes
@ -79,7 +79,7 @@ project(":core") {
|
||||
apply plugin: "java"
|
||||
|
||||
dependencies {
|
||||
//compile 'com.github.anuken:ucore:99b9102221'
|
||||
compile 'com.github.anuken:ucore:eb772dd77d'
|
||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
|
||||
}
|
||||
|
BIN
core/assets-raw/sprites/ui/text-exit.png
Normal file
After Width: | Height: | Size: 286 B |
BIN
core/assets-raw/sprites/ui/text-load.png
Normal file
After Width: | Height: | Size: 436 B |
BIN
core/assets-raw/sprites/ui/text-play.png
Normal file
After Width: | Height: | Size: 326 B |
BIN
core/assets-raw/sprites/ui/text-settings.png
Normal file
After Width: | Height: | Size: 367 B |
BIN
core/assets-raw/sprites/ui/text-sides-down.png
Normal file
After Width: | Height: | Size: 693 B |
BIN
core/assets-raw/sprites/ui/text-sides-over.png
Normal file
After Width: | Height: | Size: 700 B |
BIN
core/assets-raw/sprites/ui/text-sides.png
Normal file
After Width: | Height: | Size: 652 B |
BIN
core/assets-raw/sprites/ui/text-tutorial.png
Normal file
After Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 48 KiB |
BIN
core/assets/ui/title-font.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
@ -25,6 +25,7 @@ io.anuke.ucore.scene.Skin$TintedDrawable: {
|
||||
},
|
||||
io.anuke.ucore.scene.ui.Button$ButtonStyle: {
|
||||
default: {down: button-down, up: button },
|
||||
menu: {up: text-sides, over: text-sides-over, down: text-sides-down},
|
||||
toggle: {checked: button-down, down: button-down, up: button }
|
||||
},
|
||||
io.anuke.ucore.scene.ui.TextButton$TextButtonStyle: {
|
||||
|
@ -150,7 +150,9 @@ public class Renderer extends RendererModule{
|
||||
|
||||
renderPixelOverlay();
|
||||
|
||||
drawEnemyMarkers();
|
||||
if(Settings.getBool("indicators")){
|
||||
drawEnemyMarkers();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,7 +3,6 @@ package io.anuke.mindustry;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
import static io.anuke.ucore.scene.actions.Actions.*;
|
||||
|
||||
import com.badlogic.gdx.Application.ApplicationType;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Colors;
|
||||
@ -173,6 +172,7 @@ public class UI extends SceneModule{
|
||||
prefs.checkPref("fps", "Show FPS", false);
|
||||
prefs.checkPref("noshadows", "Disable shadows", false);
|
||||
prefs.checkPref("smoothcam", "Smooth Camera", true);
|
||||
prefs.checkPref("indicators", "Enemy Indicators", true);
|
||||
|
||||
prefs.hidden(()->{
|
||||
if(!GameState.is(State.menu)){
|
||||
@ -191,6 +191,13 @@ public class UI extends SceneModule{
|
||||
menu.hide();
|
||||
}
|
||||
});
|
||||
|
||||
if(!android){
|
||||
prefs.content().row();
|
||||
prefs.content().addButton("Controls", () -> {
|
||||
keys.show(scene);
|
||||
}).size(300f, 50f).pad(5f).units(Unit.dp);
|
||||
}
|
||||
|
||||
keys = new MindustryKeybindDialog();
|
||||
|
||||
@ -416,49 +423,27 @@ public class UI extends SceneModule{
|
||||
//menu table
|
||||
new table(){{
|
||||
|
||||
new table("pane"){{
|
||||
defaults().size(220, 48).pad(3);
|
||||
|
||||
new button("Play", () -> {
|
||||
levels.show();
|
||||
});
|
||||
new table(){{
|
||||
float scale = 4f;
|
||||
defaults().size(100*scale, 21*scale).pad(-10f).units(Unit.dp);
|
||||
|
||||
add(new MenuButton("text-play", ()-> levels.show()));
|
||||
row();
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
add(new MenuButton("text-tutorial", ()-> control.playMap(Map.tutorial)));
|
||||
row();
|
||||
|
||||
if(!android){
|
||||
new button("Controls", () -> {
|
||||
keys.show(scene);
|
||||
});
|
||||
|
||||
if(!gwt){
|
||||
add(new MenuButton("text-load", ()-> load.show()));
|
||||
row();
|
||||
}
|
||||
|
||||
if(Gdx.app.getType() != ApplicationType.WebGL && !android){
|
||||
new button("Exit", () -> {
|
||||
Gdx.app.exit();
|
||||
});
|
||||
}
|
||||
add(new MenuButton("text-settings", ()-> prefs.show()));
|
||||
row();
|
||||
|
||||
if(!gwt){
|
||||
add(new MenuButton("text-exit", ()-> Gdx.app.exit()));
|
||||
}
|
||||
get().pad(Unit.dp.inPixels(16));
|
||||
}};
|
||||
|
||||
|
@ -9,6 +9,8 @@ import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
public class Vars{
|
||||
//shorthand for whether or not this is running on android
|
||||
public static final boolean android = (Gdx.app.getType() == ApplicationType.Android);
|
||||
//shorthand for whether or not this is running on GWT
|
||||
public static final boolean gwt = (Gdx.app.getType() == ApplicationType.WebGL);
|
||||
//how far away from the player blocks can be placed
|
||||
public static final float placerange = 66;
|
||||
//respawn time in frames
|
||||
|
21
core/src/io/anuke/mindustry/ui/MenuButton.java
Normal file
@ -0,0 +1,21 @@
|
||||
package io.anuke.mindustry.ui;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.Scaling;
|
||||
|
||||
import io.anuke.ucore.function.Listenable;
|
||||
import io.anuke.ucore.scene.ui.Button;
|
||||
import io.anuke.ucore.scene.ui.Image;
|
||||
|
||||
public class MenuButton extends Button{
|
||||
|
||||
public MenuButton(String icon, Listenable clicked){
|
||||
super("menu");
|
||||
Image image = new Image(icon);
|
||||
image.setScaling(Scaling.fit);
|
||||
image.setScale(4f);
|
||||
image.setOrigin(Align.center);
|
||||
add(image);
|
||||
clicked(clicked);
|
||||
}
|
||||
}
|