diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTitledMessage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTitledMessage.java index c9ca2a694..a5398a7c2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTitledMessage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTitledMessage.java @@ -29,8 +29,8 @@ import com.watabou.noosa.ui.Component; public class WndTitledMessage extends Window { - protected static final int WIDTH_P = 120; - protected static final int WIDTH_L = 160; + protected static final int WIDTH_MIN = 120; + protected static final int WIDTH_MAX = 220; protected static final int GAP = 2; public WndTitledMessage( Image icon, String title, String message ) { @@ -43,7 +43,7 @@ public class WndTitledMessage extends Window { super(); - int width = PixelScene.landscape() ? WIDTH_L : WIDTH_P; + int width = WIDTH_MIN; titlebar.setRect( 0, 0, width, 0 ); add(titlebar); @@ -53,6 +53,13 @@ public class WndTitledMessage extends Window { text.setPos( titlebar.left(), titlebar.bottom() + 2*GAP ); add( text ); + while (PixelScene.landscape() + && text.bottom() > (PixelScene.MIN_HEIGHT_L - 10) + && width < WIDTH_MAX){ + width += 20; + text.maxWidth(width); + } + resize( width, (int)text.bottom() + 2 ); } }