Fixed irregularly scaled maps causing various bugs
This commit is contained in:
@@ -13,6 +13,7 @@ public class BorderImage extends Image{
|
||||
private float thickness = 3f;
|
||||
|
||||
public BorderImage(){
|
||||
|
||||
}
|
||||
|
||||
public BorderImage(Texture texture){
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.ui.dialogs;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.Scaling;
|
||||
import io.anuke.mindustry.game.Difficulty;
|
||||
import io.anuke.mindustry.game.GameMode;
|
||||
import io.anuke.mindustry.maps.Map;
|
||||
@@ -106,6 +107,7 @@ public class CustomGameDialog extends FloatingDialog{
|
||||
image.label((() -> Bundles.format("text.level.highscore", Settings.getInt("hiscore" + map.name, 0)))).pad(3f);
|
||||
|
||||
BorderImage border = new BorderImage(map.texture, 3f);
|
||||
border.setScaling(Scaling.fit);
|
||||
image.replaceImage(border);
|
||||
|
||||
image.clicked(() -> {
|
||||
|
||||
@@ -93,7 +93,7 @@ public class MapsDialog extends FloatingDialog{
|
||||
button.row();
|
||||
button.addImage("white").growX().pad(4).color(Color.GRAY);
|
||||
button.row();
|
||||
((Image) button.stack(new Image(map.texture), new BorderImage(map.texture)).size(mapsize - 20f).get().getChildren().first()).setScaling(Scaling.fit);
|
||||
button.stack(new Image(map.texture).setScaling(Scaling.fit), new BorderImage(map.texture).setScaling(Scaling.fit)).size(mapsize - 20f);
|
||||
button.row();
|
||||
button.add(map.custom ? "$text.custom" : "$text.builtin").color(Color.GRAY).padTop(3);
|
||||
|
||||
@@ -114,7 +114,7 @@ public class MapsDialog extends FloatingDialog{
|
||||
float mapsize = UIUtils.portrait() ? 160f : 300f;
|
||||
Table table = dialog.content();
|
||||
|
||||
((Image) table.stack(new Image(map.texture), new BorderImage(map.texture)).size(mapsize).get().getChildren().first()).setScaling(Scaling.fit);
|
||||
table.stack(new Image(map.texture).setScaling(Scaling.fit), new BorderImage(map.texture).setScaling(Scaling.fit)).size(mapsize);
|
||||
|
||||
table.table("clear", desc -> {
|
||||
desc.top();
|
||||
|
||||
Reference in New Issue
Block a user