Mobile placement guide / Bugfixes / Switched mobile test to arg

This commit is contained in:
Anuken
2018-07-02 13:06:52 -04:00
parent e9436426b7
commit cf0a25fdfc
9 changed files with 101 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ import io.anuke.ucore.util.OS;
import java.util.Locale;
public class Vars{
public static final boolean testMobile = false;
public static boolean testMobile;
//shorthand for whether or not this is running on android or ios
public static boolean mobile;
public static boolean ios;

View File

@@ -49,7 +49,7 @@ public class Liquids implements ContentList {
cryofluid = new Liquid("cryofluid", Color.SKY) {
{
heatCapacity = 0.75f;
temperature = 0.5f;
temperature = 0.4f;
tier = 1;
effect = StatusEffects.freezing;
}

View File

@@ -6,8 +6,9 @@ public enum Difficulty {
easy(4f, 2f, 1f),
normal(2f, 1f, 1f),
hard(1.5f, 0.5f, 0.75f),
insane(0.5f, 0.25f, 0.5f),
purge(0.25f, 0.01f, 0.25f);
insane(0.5f, 0.25f, 0.5f);
//purge removed due to new wave system
/*purge(0.25f, 0.01f, 0.25f)*/;
/**The scaling of how many waves it takes for one more enemy of a type to appear.
* For example: with enemeyScaling = 2 and the default scaling being 2, it would take 4 waves for

View File

@@ -10,6 +10,7 @@ import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectSet;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.fx.Fx;
import io.anuke.mindustry.core.GameState.State;
@@ -22,6 +23,7 @@ import io.anuke.mindustry.graphics.Shaders;
import io.anuke.mindustry.input.PlaceUtils.NormalizeDrawResult;
import io.anuke.mindustry.input.PlaceUtils.NormalizeResult;
import io.anuke.mindustry.type.Recipe;
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.*;
@@ -49,6 +51,8 @@ public class AndroidInput extends InputHandler implements GestureListener{
private Vector2 vector = new Vector2();
private float initzoom = -1;
private boolean zoomed = false;
/**Set of completed guides.*/
private ObjectSet<String> guides = new ObjectSet<>();
/**Position where the player started dragging a line.*/
private int lineStartX, lineStartY;
@@ -182,6 +186,22 @@ public class AndroidInput extends InputHandler implements GestureListener{
}
}
void showGuide(String type){
if(!guides.contains(type) && !Settings.getBool(type, false)){
FloatingDialog dialog = new FloatingDialog("$text." + type + ".title");
dialog.addCloseButton();
dialog.content().left();
dialog.content().add("$text." + type).growX().wrap();
dialog.content().row();
dialog.content().addCheck("$text.showagain", false, checked -> {
Settings.putBool(type, checked);
Settings.save();
}).growX().left();
dialog.show();
guides.add(type);
}
}
//endregion
//region UI and drawing
@@ -213,6 +233,9 @@ public class AndroidInput extends InputHandler implements GestureListener{
new imagebutton("icon-break", "toggle", 16 * 2f, () -> {
mode = mode == breaking ? recipe == null ? none : placing : breaking;
lastRecipe = recipe;
if(mode == breaking){
showGuide("deconstruction");
}
}).update(l -> l.setChecked(mode == breaking));
}}.end();
@@ -264,6 +287,11 @@ public class AndroidInput extends InputHandler implements GestureListener{
return selection.size > 0 || removals.size > 0 || lineMode || player.target != null;
}
@Override
public boolean isPlacing() {
return super.isPlacing() && mode == placing;
}
@Override
public void drawOutlined(){
@@ -567,6 +595,10 @@ public class AndroidInput extends InputHandler implements GestureListener{
mode = placing;
}
if(recipe != null){
showGuide("construction");
}
//automatically switch to placing after a new recipe is selected
if(lastRecipe != recipe && mode == breaking && recipe != null){
mode = placing;

View File

@@ -16,6 +16,7 @@ public class Liquid implements UnlockableContent{
public final Color color;
public final String name;
public final String description;
public final int id;
/**0-1, 0 is completely inflammable, anything above that may catch fire when exposed to heat, 0.5+ is very flammable.*/
@@ -42,6 +43,7 @@ public class Liquid implements UnlockableContent{
this.color = new Color(color);
this.id = liquids.size;
this.description = Bundles.getOrNull("liquid." + name + ".description");
Liquid.liquids.add(this);
}

View File

@@ -106,6 +106,37 @@ public class ContentDisplay {
public static void displayLiquid(Table table, Liquid liquid){
table.table(title -> {
title.addImage(liquid.getContentIcon()).size(8 * 6);
title.add("[accent]" + liquid.localizedName()).padLeft(5);
});
table.row();
table.addImage("white").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.row();
if(liquid.description != null){
table.add(liquid.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row();
table.addImage("white").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.row();
}
table.left().defaults().fillX();
table.add(Bundles.format("text.item.explosiveness", (int)(liquid.explosiveness * 100)));
table.row();
table.add(Bundles.format("text.item.flammability", (int)(liquid.flammability * 100)));
table.row();
table.add(Bundles.format("text.liquid.heatcapacity", (int)(liquid.heatCapacity * 100)));
table.row();
table.add(Bundles.format("text.liquid.temperature", (int)(liquid.temperature * 100)));
table.row();
table.add(Bundles.format("text.liquid.viscosity", (int)(liquid.viscosity * 100)));
table.row();
}
public static void displayMech(Table table, Mech mech){

View File

@@ -18,6 +18,8 @@ public class LoadingFragment implements Fragment {
public void build(Group parent) {
table = new table("loadDim"){{
add().height(70f).row();
touchable(Touchable.enabled);
get().addImage("white").growX()
.height(3f).pad(4f).growX().get().setColor(Palette.accent);