This commit is contained in:
Anuken 2020-01-22 11:13:27 -05:00
parent 9e95ebfa11
commit 85e0103ff8
5 changed files with 32 additions and 12 deletions

View File

@ -258,7 +258,7 @@ public class MobileInput extends InputHandler implements GestureListener{
selectRequests.clear();
mode = none;
block = null;
}).width(155f);
}).width(155f).margin(16f);
});
group.fill(t -> {

View File

@ -162,7 +162,6 @@ public class Fonts{
if(g == null) throw new IllegalArgumentException("No glyph: " + glyph + " (" + (int)glyph + ")");
float size = Math.max(g.width, g.height);
float aspect = (float)g.height / g.width;
TextureRegionDrawable draw = new TextureRegionDrawable(new TextureRegion(font.getRegion().getTexture(), g.u, g.v2, g.u2, g.v)){
@Override
public void draw(float x, float y, float width, float height){
@ -173,6 +172,19 @@ public class Fonts{
Draw.rect(region, cx + g.width/2f, cy + g.height/2f, g.width, g.height);
}
@Override
public void draw(float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation){
width *= scaleX;
height *= scaleY;
Draw.color(Tmp.c1.set(tint).mul(Draw.getColor()).toFloatBits());
float cx = x + width/2f - g.width/2f, cy = y + height/2f - g.height/2f;
cx = (int)cx;
cy = (int)cy;
originX = g.width/2f;
originY = g.height/2f;
Draw.rect(region, cx + g.width/2f, cy + g.height/2f, g.width, g.height, originX, originY, rotation);
}
@Override
public float imageSize(){
return size;

View File

@ -95,11 +95,16 @@ public class JoinDialog extends FloatingDialog{
}
});
onResize(this::setup);
onResize(() -> {
setup();
refreshLocal();
refreshRemote();
});
}
void setupRemote(){
remote.clear();
for(Server server : servers){
//why are java lambdas this bad
TextButton[] buttons = {null};
@ -139,16 +144,16 @@ public class JoinDialog extends FloatingDialog{
}
}
}).margin(3f).pad(2).padTop(6f).top().right();
}).margin(3f).padTop(6f).top().right();
inner.addImageButton(Icon.refresh, Styles.emptyi, () -> {
refreshServer(server);
}).margin(3f).pad(2).padTop(6f).top().right();
}).margin(3f).padTop(6f).top().right();
inner.addImageButton(Icon.pencil, Styles.emptyi, () -> {
renaming = server;
add.show();
}).margin(3f).pad(2).padTop(6f).top().right();
}).margin(3f).padTop(6f).top().right();
inner.addImageButton(Icon.trash, Styles.emptyi, () -> {
ui.showConfirm("$confirm", "$server.delete", () -> {
@ -157,7 +162,7 @@ public class JoinDialog extends FloatingDialog{
setupRemote();
refreshRemote();
});
}).margin(3f).pad(2).pad(6).top().right();
}).margin(3f).pad(6).top().right();
button.row();
@ -266,7 +271,7 @@ public class JoinDialog extends FloatingDialog{
cont.addCenteredImageTextButton("$server.add", Icon.add, () -> {
renaming = null;
add.show();
}).marginLeft(6).width(w).height(80f).update(button -> {
}).marginLeft(10).width(w).height(80f).update(button -> {
float pw = w;
float pad = 0f;
if(pane.getChildren().first().getPrefHeight() > pane.getHeight()){
@ -363,7 +368,7 @@ public class JoinDialog extends FloatingDialog{
}
float targetWidth(){
return Core.graphics.isPortrait() ? 350f : 500f;
return Math.min(Core.graphics.getWidth() / Scl.scl() * 0.9f, 500f);//Core.graphics.isPortrait() ? 350f : 500f;
}
@SuppressWarnings("unchecked")

View File

@ -244,9 +244,12 @@ public class PlacementFragment extends Fragment{
}
}
blockTable.act(0f);
blockPane.act(0f);
blockPane.setScrollYForce(scrollPositions.get(currentCategory, 0));
Core.app.post(() -> blockPane.setScrollYForce(scrollPositions.get(currentCategory, 0)));
Core.app.post(() -> {
blockPane.setScrollYForce(scrollPositions.get(currentCategory, 0));
blockPane.act(0f);
blockPane.layout();
});
};
//top table with hover info

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=ca797d336b86bfe091162b5e5dc73521e04e4817
archash=bf5f253d458e0b8bddf9efcc3642a644f4b48fb6