mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Fix so string only deck managers work ok
This commit is contained in:
@@ -255,6 +255,10 @@ public final class DeckManager extends ItemManager<DeckProxy> {
|
||||
return new ItemRenderer<DeckProxy>() {
|
||||
@Override
|
||||
public float getItemHeight() {
|
||||
if (DeckManager.this.getConfig().getCols().size() == 1) {
|
||||
//if just string column, use normal list item height
|
||||
return Utils.AVG_FINGER_HEIGHT;
|
||||
}
|
||||
return IMAGE_SIZE + 2 * FSkinFont.get(12).getFont().getLineHeight() + 4 * FList.PADDING;
|
||||
}
|
||||
|
||||
@@ -273,6 +277,12 @@ public final class DeckManager extends ItemManager<DeckProxy> {
|
||||
public void drawValue(Graphics g, Entry<DeckProxy, Integer> value, FSkinFont font, FSkinColor foreColor, boolean pressed, float x, float y, float w, float h) {
|
||||
DeckProxy deck = value.getKey();
|
||||
|
||||
if (DeckManager.this.getConfig().getCols().size() == 1) {
|
||||
//if just string column, just draw deck string value
|
||||
g.drawText(deck.toString(), font, foreColor, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
return;
|
||||
}
|
||||
|
||||
//draw favorite, name, and color on first line
|
||||
g.drawImage(DeckPreferences.getPrefs(deck).getStarCount() > 0 ? FSkinImage.STAR_FILLED : FSkinImage.STAR_OUTINE, x, y, IMAGE_SIZE, IMAGE_SIZE);
|
||||
x += IMAGE_SIZE + FList.PADDING;
|
||||
|
||||
Reference in New Issue
Block a user