Better portrait UI for mobile in-game editor

This commit is contained in:
Anuken 2024-10-03 22:39:21 -04:00
parent 144229803a
commit 2112c5c654
3 changed files with 3 additions and 1 deletions

View File

@ -271,6 +271,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
));
world.endMapLoad();
player.set(world.width() * tilesize/2f, world.height() * tilesize/2f);
Core.camera.position.set(player);
player.clearUnit();
for(var unit : Groups.unit){

View File

@ -770,7 +770,7 @@ public class MobileInput extends InputHandler implements GestureListener{
}
//zoom camera
if(!locked && Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((!player.isBuilder() || !isPlacing() || !block.rotate) && selectPlans.isEmpty()))){
if(!locked && !scene.hasKeyboard() && !scene.hasScroll() && Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((!player.isBuilder() || !isPlacing() || !block.rotate) && selectPlans.isEmpty()))){
renderer.scaleCamera(Core.input.axisTap(Binding.zoom));
}

View File

@ -391,6 +391,7 @@ public class HudFragment{
if(mobile){
editorMain.row().spacerY(() -> {
if(control.input instanceof MobileInput mob){
if(Core.graphics.isPortrait()) return Core.graphics.getHeight() / 2f / Scl.scl(1f);
if(mob.hasSchematic()) return 156f;
if(mob.showCancel()) return 50f;
}