v0.2.4: tweaked some windows
This commit is contained in:
@@ -17,37 +17,14 @@
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.watabou.noosa.BitmapTextMultiline;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.PlantSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
|
||||
public class WndInfoPlant extends Window {
|
||||
|
||||
private static final float GAP = 2;
|
||||
|
||||
private static final int WIDTH = 120;
|
||||
public class WndInfoPlant extends WndTitledMessage {
|
||||
|
||||
public WndInfoPlant( Plant plant ) {
|
||||
|
||||
super();
|
||||
|
||||
IconTitle titlebar = new IconTitle();
|
||||
titlebar.icon( new PlantSprite( plant.image ) );
|
||||
titlebar.label( plant.plantName );
|
||||
titlebar.setRect( 0, 0, WIDTH, 0 );
|
||||
add( titlebar );
|
||||
|
||||
BitmapTextMultiline info = PixelScene.createMultiline( 6 );
|
||||
add( info );
|
||||
|
||||
info.text( plant.desc() );
|
||||
info.maxWidth = WIDTH;
|
||||
info.measure();
|
||||
info.x = titlebar.left();
|
||||
info.y = titlebar.bottom() + GAP;
|
||||
|
||||
resize( WIDTH, (int)(info.y + info.height()) );
|
||||
super(new PlantSprite( plant.image ), plant.plantName, plant.desc());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.watabou.input.Touchscreen.Touch;
|
||||
import com.watabou.noosa.BitmapTextMultiline;
|
||||
import com.watabou.noosa.Game;
|
||||
@@ -29,8 +30,9 @@ import com.watabou.utils.SparseArray;
|
||||
|
||||
public class WndStory extends Window {
|
||||
|
||||
private static final int WIDTH = 120;
|
||||
private static final int MARGIN = 6;
|
||||
private static final int WIDTH_P = 120;
|
||||
private static final int WIDTH_L = 144;
|
||||
private static final int MARGIN = 6;
|
||||
|
||||
private static final float bgR = 0.77f;
|
||||
private static final float bgG = 0.73f;
|
||||
@@ -83,7 +85,9 @@ public class WndStory extends Window {
|
||||
super( 0, 0, Chrome.get( Chrome.Type.SCROLL ) );
|
||||
|
||||
tf = PixelScene.createMultiline( text, 7 );
|
||||
tf.maxWidth = WIDTH - MARGIN * 2;
|
||||
tf.maxWidth = ShatteredPixelDungeon.landscape() ?
|
||||
WIDTH_L - MARGIN * 2:
|
||||
WIDTH_P - MARGIN *2;
|
||||
tf.measure();
|
||||
tf.ra = bgR;
|
||||
tf.ga = bgG;
|
||||
|
||||
Reference in New Issue
Block a user