merging 1.7.5 source: windows changes

This commit is contained in:
Evan Debenham
2015-02-06 01:07:22 -05:00
parent 7cc5192839
commit 68406db6fe
18 changed files with 188 additions and 134 deletions
@@ -17,6 +17,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.Image;
import com.watabou.noosa.ui.Component;
@@ -25,7 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
public class WndTitledMessage 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 GAP = 2;
private BitmapTextMultiline normal;
@@ -40,14 +42,16 @@ public class WndTitledMessage extends Window {
public WndTitledMessage( Component titlebar, String message ) {
super();
titlebar.setRect( 0, 0, WIDTH, 0 );
int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
titlebar.setRect( 0, 0, width, 0 );
add( titlebar );
Highlighter hl = new Highlighter( message );
normal = PixelScene.createMultiline( hl.text, 6 );
normal.maxWidth = WIDTH;
normal.maxWidth = width;
normal.measure();
normal.x = titlebar.left();
normal.y = titlebar.bottom() + GAP;
@@ -67,6 +71,6 @@ public class WndTitledMessage extends Window {
highlighted.hardlight( TITLE_COLOR );
}
resize( WIDTH, (int)(normal.y + normal.height()) );
resize( width, (int)(normal.y + normal.height()) );
}
}