mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-17 23:02:26 -08:00
Portrait alignment fixes
This commit is contained in:
parent
e3bee43163
commit
04dcc262ee
5 changed files with 789 additions and 785 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 313 B |
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
|
|
@ -13,7 +13,7 @@ import io.anuke.mindustry.entities.TileEntity;
|
|||
import io.anuke.mindustry.game.Content;
|
||||
import io.anuke.mindustry.game.ContentDatabase;
|
||||
import io.anuke.mindustry.game.EventType.*;
|
||||
import io.anuke.mindustry.input.AndroidInput;
|
||||
import io.anuke.mindustry.input.MobileInput;
|
||||
import io.anuke.mindustry.input.DefaultKeybinds;
|
||||
import io.anuke.mindustry.input.DesktopInput;
|
||||
import io.anuke.mindustry.input.InputHandler;
|
||||
|
|
@ -194,7 +194,7 @@ public class Control extends Module{
|
|||
InputHandler input;
|
||||
|
||||
if(mobile){
|
||||
input = new AndroidInput(player);
|
||||
input = new MobileInput(player);
|
||||
}else{
|
||||
input = new DesktopInput(player);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import io.anuke.ucore.util.Mathf;
|
|||
import static io.anuke.mindustry.Vars.*;
|
||||
import static io.anuke.mindustry.input.PlaceMode.*;
|
||||
|
||||
public class AndroidInput extends InputHandler implements GestureListener{
|
||||
public class MobileInput extends InputHandler implements GestureListener{
|
||||
private static Rectangle r1 = new Rectangle(), r2 = new Rectangle();
|
||||
|
||||
/**Maximum speed the player can pan.*/
|
||||
|
|
@ -78,7 +78,7 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
|||
/**Last placed request. Used for drawing block overlay.*/
|
||||
private PlaceRequest lastPlaced;
|
||||
|
||||
public AndroidInput(Player player){
|
||||
public MobileInput(Player player){
|
||||
super(player);
|
||||
Inputs.addProcessor(new GestureDetector(20, 0.5f, 0.4f, 0.15f, this));
|
||||
}
|
||||
|
|
@ -196,7 +196,7 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
|||
dialog.content().addCheck("$text.showagain", false, checked -> {
|
||||
Settings.putBool(type, checked);
|
||||
Settings.save();
|
||||
}).growX().left();
|
||||
}).growX().left().get().left();
|
||||
dialog.show();
|
||||
guides.add(type);
|
||||
}
|
||||
|
|
@ -213,32 +213,6 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
|||
new table(){{
|
||||
abottom().aleft();
|
||||
|
||||
new table("pane"){{
|
||||
margin(5);
|
||||
defaults().size(60f);
|
||||
|
||||
//Add a 'cancel building' button.
|
||||
new imagebutton("icon-cancel", 16 * 2f, player::clearBuilding);
|
||||
|
||||
visible(() -> player.getPlaceQueue().size > 0);
|
||||
}}.left().colspan(2).end();
|
||||
|
||||
row();
|
||||
|
||||
new table("pane"){{
|
||||
margin(5);
|
||||
defaults().size(60f);
|
||||
|
||||
//Add a break button.
|
||||
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();
|
||||
|
||||
new table("pane"){{
|
||||
margin(5);
|
||||
defaults().size(60f);
|
||||
|
|
@ -249,6 +223,8 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
|||
recipe = null;
|
||||
});
|
||||
|
||||
row();
|
||||
|
||||
//Add an accept button, which places everything.
|
||||
new imagebutton("icon-check", 16 * 2f, () -> {
|
||||
for (PlaceRequest request : selection) {
|
||||
|
|
@ -272,6 +248,8 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
|||
selecting = false;
|
||||
}).cell.disabled(i -> selection.size == 0);
|
||||
|
||||
row();
|
||||
|
||||
//Add a rotate button
|
||||
new imagebutton("icon-arrow", 16 * 2f, () -> rotation = Mathf.mod(rotation + 1, 4))
|
||||
.update(i -> {
|
||||
|
|
@ -279,6 +257,32 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
|||
i.getImage().setOrigin(Align.center);
|
||||
}).cell.disabled(i -> recipe == null || !recipe.result.rotate);
|
||||
}}.visible(() -> mode != none).end();
|
||||
|
||||
row();
|
||||
|
||||
new table("pane"){{
|
||||
margin(5);
|
||||
defaults().size(60f);
|
||||
|
||||
//Add a break button.
|
||||
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();
|
||||
|
||||
new table("pane"){{
|
||||
margin(5);
|
||||
defaults().size(60f);
|
||||
|
||||
//Add a 'cancel building' button.
|
||||
new imagebutton("icon-cancel", 16 * 2f, player::clearBuilding);
|
||||
|
||||
visible(() -> player.getPlaceQueue().size > 0);
|
||||
}}.left().colspan(2).end();
|
||||
}}.visible(() -> !state.is(State.menu)).end();
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue