Fixes for new placement system
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 208 B |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 78 KiB |
@@ -37,7 +37,7 @@ public class AndroidInput extends InputHandler{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean touchUp(int screenX, int screenY, int pointer, int button){
|
public boolean touchUp(int screenX, int screenY, int pointer, int button){
|
||||||
//if(ui.hasMouse()) return false;
|
if(brokeBlock) return false;
|
||||||
|
|
||||||
brokeBlock = false;
|
brokeBlock = false;
|
||||||
if(placing && pointer == 0 && !player.placeMode.pan){
|
if(placing && pointer == 0 && !player.placeMode.pan){
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class GestureHandler extends GestureAdapter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean tap (float x, float y, int count, int button) {
|
public boolean tap (float x, float y, int count, int button) {
|
||||||
if(ui.hasMouse()) return false;
|
if(ui.hasMouse() || input.brokeBlock) return false;
|
||||||
|
|
||||||
if(!player.placeMode.pan || player.recipe == null){
|
if(!player.placeMode.pan || player.recipe == null){
|
||||||
input.mousex = x;
|
input.mousex = x;
|
||||||
@@ -58,7 +58,7 @@ public class GestureHandler extends GestureAdapter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean pinch (Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2) {
|
public boolean pinch (Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2) {
|
||||||
if(player.recipe == null)
|
if(player.recipe == null && !player.breakMode.lockCamera)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(pinch1.x < 0){
|
if(pinch1.x < 0){
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import com.badlogic.gdx.utils.Align;
|
|||||||
import io.anuke.mindustry.core.GameState;
|
import io.anuke.mindustry.core.GameState;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.input.PlaceMode;
|
import io.anuke.mindustry.input.PlaceMode;
|
||||||
|
import io.anuke.ucore.scene.builders.button;
|
||||||
import io.anuke.ucore.scene.builders.imagebutton;
|
import io.anuke.ucore.scene.builders.imagebutton;
|
||||||
import io.anuke.ucore.scene.builders.table;
|
import io.anuke.ucore.scene.builders.table;
|
||||||
import io.anuke.ucore.scene.event.Touchable;
|
import io.anuke.ucore.scene.event.Touchable;
|
||||||
import io.anuke.ucore.scene.ui.ButtonGroup;
|
import io.anuke.ucore.scene.ui.ButtonGroup;
|
||||||
import io.anuke.ucore.scene.ui.Image;
|
|
||||||
import io.anuke.ucore.scene.ui.ImageButton;
|
import io.anuke.ucore.scene.ui.ImageButton;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
@@ -26,19 +26,19 @@ public class PlacementFragment implements Fragment{
|
|||||||
visible(()->player.recipe != null && !GameState.is(State.menu));
|
visible(()->player.recipe != null && !GameState.is(State.menu));
|
||||||
abottom();
|
abottom();
|
||||||
aleft();
|
aleft();
|
||||||
|
/*
|
||||||
Image image = new Image("icon-arrow");
|
Image image = new Image("icon-arrow");
|
||||||
image.setVisible(() -> player.recipe != null && player.recipe.result.rotate);
|
|
||||||
image.update(() -> {
|
image.update(() -> {
|
||||||
image.setRotation(player.rotation*90);
|
image.setRotation(player.rotation*90);
|
||||||
image.setOrigin(Align.center);
|
image.setOrigin(Align.center);
|
||||||
});
|
});
|
||||||
|
|
||||||
new table("pane"){{
|
new table("pane"){{
|
||||||
|
visible(() -> player.recipe != null && player.recipe.result.rotate);
|
||||||
add(image).size(40f).units(Unit.dp);
|
add(image).size(40f).units(Unit.dp);
|
||||||
}}.size(54f).units(Unit.dp).end();
|
}}.size(54f).units(Unit.dp).end();
|
||||||
|
|
||||||
row();
|
row();*/
|
||||||
|
|
||||||
new table(){{
|
new table(){{
|
||||||
touchable(Touchable.enabled);
|
touchable(Touchable.enabled);
|
||||||
@@ -65,18 +65,21 @@ public class PlacementFragment implements Fragment{
|
|||||||
|
|
||||||
row();
|
row();
|
||||||
|
|
||||||
|
Color color = Color.GRAY;//Colors.get("accent"); //Color.valueOf("4d4d4d")
|
||||||
|
|
||||||
new imagebutton("icon-cancel", Unit.dp.inPixels(14*3), ()->{
|
new imagebutton("icon-cancel", Unit.dp.inPixels(14*3), ()->{
|
||||||
player.recipe = null;
|
player.recipe = null;
|
||||||
}).imageColor(Color.valueOf("4d4d4d"))
|
}).imageColor(color)
|
||||||
.visible(()->player.recipe != null);
|
.visible(()->player.recipe != null);
|
||||||
|
|
||||||
new imagebutton("icon-rotate-left", Unit.dp.inPixels(14*3), ()->{
|
new button("", ()->{}).get().setTouchable(Touchable.disabled);;
|
||||||
player.rotation = Mathf.mod(player.rotation + 1, 4);
|
|
||||||
}).imageColor(Color.valueOf("4d4d4d")).visible(() -> player.recipe != null);
|
|
||||||
|
|
||||||
new imagebutton("icon-rotate-right", Unit.dp.inPixels(14*3), ()->{
|
new imagebutton("icon-arrow", Unit.dp.inPixels(14*3), ()->{
|
||||||
player.rotation = Mathf.mod(player.rotation - 1, 4);
|
player.rotation = Mathf.mod(player.rotation + 1, 4);
|
||||||
}).imageColor(Color.valueOf("4d4d4d")).visible(() -> player.recipe != null);
|
}).imageColor(color).visible(() -> player.recipe != null).update(image ->{
|
||||||
|
image.getImage().setRotation(player.rotation*90);
|
||||||
|
image.getImage().setOrigin(Align.center);
|
||||||
|
});
|
||||||
|
|
||||||
}}.left().end();
|
}}.left().end();
|
||||||
}}.end();
|
}}.end();
|
||||||
|
|||||||
Reference in New Issue
Block a user