v0.3.4: updated catalogs to render on multiple lines
This commit is contained in:
parent
95f87bb950
commit
adf41aee04
|
@ -25,6 +25,7 @@ import java.util.ArrayList;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.watabou.noosa.RenderedText;
|
import com.watabou.noosa.RenderedText;
|
||||||
|
import com.watabou.noosa.RenderedTextMultiline;
|
||||||
import com.watabou.noosa.ui.Component;
|
import com.watabou.noosa.ui.Component;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||||
|
@ -146,7 +147,7 @@ public class WndCatalogus extends WndTabbed {
|
||||||
private boolean identified;
|
private boolean identified;
|
||||||
|
|
||||||
private ItemSprite sprite;
|
private ItemSprite sprite;
|
||||||
private RenderedText label;
|
private RenderedTextMultiline label;
|
||||||
|
|
||||||
public ListItem( Class<? extends Item> cl ) {
|
public ListItem( Class<? extends Item> cl ) {
|
||||||
super();
|
super();
|
||||||
|
@ -170,17 +171,17 @@ public class WndCatalogus extends WndTabbed {
|
||||||
protected void createChildren() {
|
protected void createChildren() {
|
||||||
sprite = new ItemSprite();
|
sprite = new ItemSprite();
|
||||||
add( sprite );
|
add( sprite );
|
||||||
|
|
||||||
label = PixelScene.renderText( 8 );
|
label = PixelScene.renderMultiline( 8 );
|
||||||
add( label );
|
add( label );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void layout() {
|
protected void layout() {
|
||||||
sprite.y = y + (height - sprite.height) / 2;
|
sprite.y = y + (height - sprite.height) / 2;
|
||||||
|
|
||||||
label.x = sprite.x + sprite.width;
|
label.maxWidth((int)(width - sprite.width));
|
||||||
label.y = y + (height - label.baseLine()) / 2;
|
label.setPos(sprite.x + sprite.width, y + (height - label.height()) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onClick( float x, float y ) {
|
public boolean onClick( float x, float y ) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user