From 210c96c02cbf4b2243623e7da08645b401119510 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 19 Aug 2020 20:34:20 -0400 Subject: [PATCH] v0.8.2c: added an option for WndOptions to not have a title --- .../windows/WndOptions.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndOptions.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndOptions.java index 41b9de2f6..3638c0064 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndOptions.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndOptions.java @@ -39,18 +39,23 @@ public class WndOptions extends Window { int width = PixelScene.landscape() ? WIDTH_L : WIDTH_P; - RenderedTextBlock tfTitle = PixelScene.renderTextBlock( title, 9 ); - tfTitle.hardlight( TITLE_COLOR ); - tfTitle.setPos(MARGIN, MARGIN); - tfTitle.maxWidth(width - MARGIN * 2); - add( tfTitle ); + float pos = MARGIN; + if (title != null) { + RenderedTextBlock tfTitle = PixelScene.renderTextBlock(title, 9); + tfTitle.hardlight(TITLE_COLOR); + tfTitle.setPos(MARGIN, pos); + tfTitle.maxWidth(width - MARGIN * 2); + add(tfTitle); + + pos = tfTitle.bottom() + 3*MARGIN; + } RenderedTextBlock tfMesage = PixelScene.renderTextBlock( 6 ); tfMesage.text(message, width - MARGIN * 2); - tfMesage.setPos( MARGIN, tfTitle.bottom() + 3*MARGIN ); + tfMesage.setPos( MARGIN, pos ); add( tfMesage ); - float pos = tfMesage.bottom() + 2*MARGIN; + pos = tfMesage.bottom() + 2*MARGIN; for (int i=0; i < options.length; i++) { final int index = i;