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