Tweaks
This commit is contained in:
@@ -128,11 +128,11 @@ public class LoadDialog extends FloatingDialog{
|
||||
if(draw.getRegion() == def && text != null){
|
||||
draw.setRegion(new TextureRegion(text));
|
||||
}
|
||||
}).left().size(160f).padRight(5);
|
||||
}).left().size(160f).padRight(6);
|
||||
|
||||
button.table(meta -> {
|
||||
meta.left().top();
|
||||
meta.defaults().padBottom(-2).left().width(250f);
|
||||
meta.defaults().padBottom(-2).left().width(290f);
|
||||
meta.row();
|
||||
meta.labelWrap(Core.bundle.format("save.map", color + (slot.getMap() == null ? Core.bundle.get("unknown") : slot.getMap().name())));
|
||||
meta.row();
|
||||
|
||||
@@ -1,30 +1,33 @@
|
||||
package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.input.KeyCode;
|
||||
import io.anuke.arc.scene.event.InputEvent;
|
||||
import io.anuke.arc.scene.event.InputListener;
|
||||
import io.anuke.arc.scene.ui.layout.UnitScl;
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.graphics.*;
|
||||
import io.anuke.arc.graphics.g2d.*;
|
||||
import io.anuke.arc.input.*;
|
||||
import io.anuke.arc.scene.event.*;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
import static io.anuke.mindustry.Vars.renderer;
|
||||
|
||||
public class MinimapDialog extends FloatingDialog{
|
||||
|
||||
public MinimapDialog(){
|
||||
super("$minimap");
|
||||
setFillParent(false);
|
||||
setFillParent(true);
|
||||
|
||||
shown(this::setup);
|
||||
|
||||
addCloseButton();
|
||||
shouldPause = true;
|
||||
titleTable.remove();
|
||||
onResize(this::setup);
|
||||
}
|
||||
|
||||
public void drawBackground(float x, float y){
|
||||
drawDefaultBackground(x, y);
|
||||
}
|
||||
|
||||
void setup(){
|
||||
cont.clear();
|
||||
float size = Math.min(Core.graphics.getWidth(), Core.graphics.getHeight()) / UnitScl.dp.scl(1f) / 1.3f;
|
||||
cont.clearChildren();
|
||||
|
||||
cont.table("pane", t -> {
|
||||
t.addRect((x, y, width, height) -> {
|
||||
@@ -37,7 +40,7 @@ public class MinimapDialog extends FloatingDialog{
|
||||
renderer.minimap.drawEntities(x, y, width, height);
|
||||
}
|
||||
}).grow();
|
||||
}).size(size);
|
||||
}).size(Math.min(Core.graphics.getWidth() / 1.1f, Core.graphics.getHeight() / 1.3f)).padTop(-20f);
|
||||
|
||||
cont.addListener(new InputListener(){
|
||||
@Override
|
||||
@@ -45,18 +48,22 @@ public class MinimapDialog extends FloatingDialog{
|
||||
renderer.minimap.zoomBy(amounty);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
cont.addListener(new ElementGestureListener(){
|
||||
float lzoom = -1f;
|
||||
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){
|
||||
return true;
|
||||
public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){
|
||||
lzoom = renderer.minimap.getZoom();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void touchDragged(InputEvent event, float x, float y, int pointer){
|
||||
if(mobile){
|
||||
float max = Math.min(world.width(), world.height()) / 16f / 2f;
|
||||
renderer.minimap.setZoom(1f + y / cont.getHeight() * (max - 1f));
|
||||
public void zoom(InputEvent event, float initialDistance, float distance){
|
||||
if(lzoom < 0){
|
||||
lzoom = renderer.minimap.getZoom();
|
||||
}
|
||||
renderer.minimap.setZoom(initialDistance / distance * lzoom);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user