From a6db02535f4556ed9de45f10111754a10e5ecdeb Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 17 Dec 2015 00:58:16 -0500 Subject: [PATCH] v0.3.3: adjusted wndOptions to be wider in landscape --- .../windows/WndOptions.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndOptions.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndOptions.java index a75a2c7b5..6fb95d5d9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndOptions.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndOptions.java @@ -20,6 +20,7 @@ */ package com.shatteredpixel.shatteredpixeldungeon.windows; +import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.watabou.noosa.BitmapTextMultiline; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; @@ -27,22 +28,26 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Window; public class WndOptions extends Window { - private static final int WIDTH = 120; + private static final int WIDTH_P = 120; + private static final int WIDTH_L = 144; + private static final int MARGIN = 2; private static final int BUTTON_HEIGHT = 20; public WndOptions( String title, String message, String... options ) { super(); - + + int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P; + BitmapTextMultiline tfTitle = PixelScene.createMultiline( title, 9 ); tfTitle.hardlight( TITLE_COLOR ); tfTitle.x = tfTitle.y = MARGIN; - tfTitle.maxWidth = WIDTH - MARGIN * 2; + tfTitle.maxWidth = width - MARGIN * 2; tfTitle.measure(); add( tfTitle ); BitmapTextMultiline tfMesage = PixelScene.createMultiline( message, 6 ); - tfMesage.maxWidth = WIDTH - MARGIN * 2; + tfMesage.maxWidth = width - MARGIN * 2; tfMesage.measure(); tfMesage.x = MARGIN; tfMesage.y = tfTitle.y + tfTitle.height() + MARGIN; @@ -59,13 +64,13 @@ public class WndOptions extends Window { onSelect( index ); } }; - btn.setRect( MARGIN, pos, WIDTH - MARGIN * 2, BUTTON_HEIGHT ); + btn.setRect( MARGIN, pos, width - MARGIN * 2, BUTTON_HEIGHT ); add( btn ); pos += BUTTON_HEIGHT + MARGIN; } - resize( WIDTH, (int)pos ); + resize( width, (int)pos ); } protected void onSelect( int index ) {};