Merge fixes

This commit is contained in:
Anuken
2018-04-28 16:29:23 -04:00
parent e5f6b7f66c
commit 5b8ee48600
5 changed files with 6 additions and 34 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ import java.util.Locale;
public class Vars{ public class Vars{
public static final boolean testMobile = false; public static final boolean testMobile = false;
//shorthand for whether or not this is running on android //shorthand for whether or not this is running on android or ios
public static final boolean mobile = (Gdx.app.getType() == ApplicationType.Android) || public static final boolean mobile = (Gdx.app.getType() == ApplicationType.Android) ||
Gdx.app.getType() == ApplicationType.iOS || testMobile; Gdx.app.getType() == ApplicationType.iOS || testMobile;
public static final boolean ios = Gdx.app.getType() == ApplicationType.iOS; public static final boolean ios = Gdx.app.getType() == ApplicationType.iOS;
@@ -146,7 +146,7 @@ public class Recipes {
public static Array<Recipe> getBy(Section section, Array<Recipe> r){ public static Array<Recipe> getBy(Section section, Array<Recipe> r){
for(Recipe recipe : list){ for(Recipe recipe : list){
if(recipe.section == section && !(Vars.android && recipe.desktopOnly) && !(!debug && recipe.debugOnly)) { if(recipe.section == section && !(Vars.mobile && recipe.desktopOnly) && !(!debug && recipe.debugOnly)) {
r.add(recipe); r.add(recipe);
} }
} }
@@ -160,7 +160,7 @@ public class Renderer extends RendererModule{
if(!smoothcam){ if(!smoothcam){
setCamera(player.x, player.y); setCamera(player.x, player.y);
}else{ }else{
smoothCamera(player.x, player.y, android ? 0.3f : 0.14f); smoothCamera(player.x, player.y, mobile ? 0.3f : 0.14f);
} }
if(Settings.getBool("pixelate")) if(Settings.getBool("pixelate"))
+1 -29
View File
@@ -15,7 +15,6 @@ import io.anuke.ucore.scene.ui.ImageButton;
import io.anuke.ucore.scene.ui.Label; import io.anuke.ucore.scene.ui.Label;
import io.anuke.ucore.scene.ui.TextButton; import io.anuke.ucore.scene.ui.TextButton;
import io.anuke.ucore.util.Bundles; import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Tmp; import io.anuke.ucore.util.Tmp;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.*;
@@ -92,38 +91,11 @@ public class Tutorial{
} }
void move(boolean forward){ void move(boolean forward){
//TODO
if(forward && !canMove(forward)){
complete();
}else{
int current = stage.ordinal();
while(true){
current += Mathf.sign(forward);
if(current < 0 || current >= Stage.values().length){
break;
}else if(android == Stage.values()[current].androidOnly || android != Stage.values()[current].desktopOnly){
stage = Stage.values()[current];
stage.onSwitch();
break;
}
}
}
} }
boolean canMove(boolean forward){ boolean canMove(boolean forward){
int current = stage.ordinal();
while(true){
current += Mathf.sign(forward);
if(current < 0 || current >= Stage.values().length){
return false;
}else if(android == Stage.values()[current].androidOnly || android != Stage.values()[current].desktopOnly){
return true; return true;
}
}
} }
@@ -218,7 +218,7 @@ public class BlockRenderer{
public void handlePreview(Block block, float rotation, float drawx, float drawy, int tilex, int tiley) { public void handlePreview(Block block, float rotation, float drawx, float drawy, int tilex, int tiley) {
if(control.input().recipe != null && state.inventory.hasItems(control.input().recipe.requirements) if(control.input().recipe != null && state.inventory.hasItems(control.input().recipe.requirements)
&& control.input().validPlace(tilex, tiley, block) && (android || control.input().cursorNear())) { && control.input().validPlace(tilex, tiley, block) && (mobile || control.input().cursorNear())) {
if(block.isMultiblock()) { if(block.isMultiblock()) {
float halfBlockWidth = (block.size * tilesize) / 2; float halfBlockWidth = (block.size * tilesize) / 2;