diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/NewsScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/NewsScene.java index 6e540b3e4..ef5dc80a9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/NewsScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/NewsScene.java @@ -119,6 +119,7 @@ public class NewsScene extends PixelScene { boolean rightCol = false; for (NewsArticle article : articles) { StyledButton b = new ArticleButton(article); + b.multiline = true; if (!rightCol) { top += gap; b.setRect( left, top, BTN_WIDTH, BTN_HEIGHT); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StyledButton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StyledButton.java index e9f5034b2..71c75ad2b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StyledButton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StyledButton.java @@ -35,6 +35,8 @@ public class StyledButton extends Button { protected NinePatch bg; protected RenderedTextBlock text; protected Image icon; + + public boolean multiline; public StyledButton(Chrome.Type type, String label ) { this(type, label, 9); @@ -65,7 +67,7 @@ public class StyledButton extends Button { if (icon != null) componentWidth += icon.width() + 2; if (text != null && !text.text().equals("")){ - text.maxWidth( (int)(width - componentWidth - bg.marginHor() - 2)); + if (multiline) text.maxWidth( (int)(width - componentWidth - bg.marginHor() - 2)); componentWidth += text.width() + 2; text.setPos( diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndCombo.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndCombo.java index c2277cd68..ff45208e7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndCombo.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndCombo.java @@ -74,6 +74,7 @@ public class WndCombo extends Window { }; ic.tint(move.tintColor); moveBtn.icon(ic); + moveBtn.multiline = true; moveBtn.setSize(width, moveBtn.reqHeight()); moveBtn.setRect(0, pos, width, moveBtn.reqHeight()); moveBtn.enable(combo.canUseMove(move));