Merge branch 'master' of https://github.com/Anuken/Mindustry into 4.0

This commit is contained in:
Anuken
2018-04-28 16:28:58 -04:00
114 changed files with 509 additions and 129 deletions

View File

@@ -44,6 +44,11 @@ public class ChangelogDialog extends FloatingDialog{
table.row();
table.add("$text.changelog.error.android").padTop(8);
}
if(Vars.ios){
table.row();
table.add("$text.changelog.error.ios").padTop(8);
}
}else{
for(VersionInfo info : versions){
Table in = new Table("clear");

View File

@@ -35,7 +35,7 @@ public class PausedDialog extends FloatingDialog{
if(!Net.active()) state.set(State.paused);
});
if(!android){
if(!mobile){
content().defaults().width(220).height(50);
content().addButton("$text.back", () -> {

View File

@@ -84,7 +84,7 @@ public class SettingsMenuDialog extends SettingsDialog{
menu.addButton("$text.settings.graphics", () -> visible(1));
menu.row();
menu.addButton("$text.settings.sound", () -> visible(2));
if(!Vars.android) {
if(!Vars.mobile) {
menu.row();
menu.addButton("$text.settings.controls", ui.controls::show);
}
@@ -142,7 +142,7 @@ public class SettingsMenuDialog extends SettingsDialog{
}
}
if(!android && !gwt) {
if(!mobile && !gwt) {
graphics.checkPref("vsync", true, b -> Gdx.graphics.setVSync(b));
graphics.checkPref("fullscreen", false, b -> {
if (b) {

View File

@@ -39,7 +39,7 @@ public class BlocksFragment implements Fragment{
private boolean shown = true;
private Recipe hoveredDescriptionRecipe;
private IntSet itemset = new IntSet();
public void build(){
InputHandler input = control.input();

View File

@@ -107,12 +107,12 @@ public class ChatFragment extends Table implements Fragment{
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
if(Vars.android) {
if(Vars.mobile) {
marginBottom(105f);
marginRight(240f);
}
if(Vars.android) {
if(Vars.mobile) {
addImageButton("icon-arrow-right", 14 * 2, this::toggle).size(46f, 51f).visible(() -> chatOpen).pad(2f);
}
}

View File

@@ -71,14 +71,14 @@ public class HudFragment implements Fragment{
}).get();
new imagebutton("icon-pause", isize, () -> {
if(android) DebugFragment.printDebugInfo();
if (Net.active() && android) {
if(mobile) DebugFragment.printDebugInfo();
if (Net.active() && mobile) {
ui.listfrag.visible = !ui.listfrag.visible;
} else {
state.set(state.is(State.paused) ? State.playing : State.paused);
}
}).update(i -> {
if (Net.active() && android) {
if (Net.active() && mobile) {
i.getStyle().imageUp = Core.skin.getDrawable("icon-players");
} else {
i.setDisabled(Net.active());
@@ -87,7 +87,7 @@ public class HudFragment implements Fragment{
}).get();
new imagebutton("icon-settings", isize, () -> {
if (Net.active() && android) {
if (Net.active() && mobile) {
if (ui.chatfrag.chatOpen()) {
ui.chatfrag.hide();
} else {
@@ -97,7 +97,7 @@ public class HudFragment implements Fragment{
ui.settings.show();
}
}).update(i -> {
if (Net.active() && android) {
if (Net.active() && mobile) {
i.getStyle().imageUp = Core.skin.getDrawable("icon-chat");
} else {
i.getStyle().imageUp = Core.skin.getDrawable("icon-settings");

View File

@@ -18,7 +18,7 @@ public class MenuFragment implements Fragment{
new table(){{
visible(() -> state.is(State.menu));
if(!android){
if(!mobile){
new table(){{
float w = 200f;

View File

@@ -29,7 +29,7 @@ public class PlacementFragment implements Fragment{
Label modelabel;
public void build(){
if(!android) return;
if(!mobile) return;
InputHandler input = control.input();

View File

@@ -63,7 +63,7 @@ public class PlayerListFragment implements Fragment{
}}.end();
update(t -> {
if(!android){
if(!mobile){
visible = Inputs.keyDown("player_list");
}
if(!(Net.active() && !state.is(State.menu))){

View File

@@ -11,8 +11,6 @@ import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.scene.ui.layout.Table;
import static io.anuke.mindustry.Vars.*;
public class ToolFragment implements Fragment{
private Table tools;
public int px, py, px2, py2;
@@ -50,7 +48,7 @@ public class ToolFragment implements Fragment{
Core.scene.add(tools);
tools.setVisible(() ->
!state.is(State.menu) && android && ((input.recipe != null && state.inventory.hasItems(input.recipe.requirements) &&
!state.is(State.menu) && mobile && ((input.recipe != null && state.inventory.hasItems(input.recipe.requirements) &&
input.placeMode == PlaceMode.cursor) || confirming)
);