Index: gamegui/ScrollList.java
===================================================================
--- gamegui/ScrollList.java	(revision a5b4186ca52f455a110a593c9a58bf9ebeceb07c)
+++ gamegui/ScrollList.java	(revision 4d8825f3fe1264280fc968b1d8b39bd7983a64c1)
@@ -2,120 +2,123 @@
 
 import java.awt.*;
-import java.awt.event.*;
+import java.awt.event.MouseEvent;
 import java.awt.image.BufferedImage;
-import java.util.*;
+import java.util.ArrayList;
 
 public class ScrollList extends Member {
-	private ArrayList<Listable> lstObjects;
-	private Listable selectedItem;
-	private Font font;
-	private FontMetrics metrics;
-	private int textStart;
-	private boolean change;
-	
-	public ScrollList(String newName, int newX, int newY, int newWidth, int newHeight, Font font, FontMetrics metrics) {
-		super(newName, newX, newY, newWidth, newHeight);
-		
-		lstObjects = new ArrayList<Listable>();
-		selectedItem = null;
-		this.font = font;
-		this.metrics = metrics;
-		textStart = 0;
-		change = false;
-	}
-	
-	public ArrayList<Listable> getList() {
-		return lstObjects;
-	}
-	
-	public Listable getSelected() {
-		return selectedItem;
-	}
-	
-	public boolean isChanged() {
-		return change;
-	}
-	
-	public void changeHandled() {
-		change = false;
-	}
-	
-	public void deselect() {
-		selectedItem = null;
-	}
-	
-	public void clear() {
-		lstObjects = new ArrayList<Listable>();
-		selectedItem = null;
-		textStart = 0;
-		changeHandled();
-	}
-	
-	public boolean handleEvent(MouseEvent e) {
-		if(getX() < e.getX() && e.getX() < getX()+getWidth()) {
-			if(getY() < e.getY() && getY()-textStart+2 < e.getY() && e.getY() < getY()+getHeight() && e.getY() < getY()+lstObjects.size()*15-textStart+2) {
-				selectedItem = lstObjects.get((e.getY()-getY()+textStart-2)/15);
-				change = true;
-				return true;
-			}
-		}
-		
-		if(!getScrollBar().handleEvent(e))
-			return false;
-		
-		if(e.getY() < getY()+getScrollBar().getWidth()) {
-			changeTextStart(-30);
-		}else if(getY()+getHeight()-getScrollBar().getWidth() < e.getY()) {
-			changeTextStart(30);
-		}
-		
-		return true;
-	}
-	
-	private void changeTextStart(int increment) {
-		textStart += increment;
-		
-		if(lstObjects.size()*15+6>getHeight() && textStart >= lstObjects.size()*15+6-getHeight()) {
-			textStart = lstObjects.size()*15+6-getHeight();
-			getScrollBar().setPosition(getScrollBar().getMaxSize()-getScrollBar().getSize());
-		}else if(textStart < 0 || lstObjects.size()*15+6<=getHeight()) {
-			textStart = 0;
-			getScrollBar().setPosition(0);
-		}else
-			getScrollBar().setPosition(textStart*getScrollBar().getMaxSize()/(lstObjects.size()*15+6));
-	}
-	
-	public void draw(Graphics g) {
-		GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
-        GraphicsDevice device = env.getDefaultScreenDevice();
-        GraphicsConfiguration gc = device.getDefaultConfiguration();
-        
-        BufferedImage source = gc.createCompatibleImage(getWidth(), getHeight());
-        Graphics2D srcGraphics = source.createGraphics();
-        
-        srcGraphics.setColor(Color.green);
-		srcGraphics.setFont(font);
-		
-        for(int x=0; x<lstObjects.size(); x++) {
-        	if(selectedItem != null && selectedItem.equals(lstObjects.get(x))) {
-        		srcGraphics.setColor(Color.blue);
-        		srcGraphics.fillRect(0, x*15-textStart+3, getWidth(), 15);
-        		srcGraphics.setColor(Color.green);
-        	}
-        	
-        	lstObjects.get(x).drawListString(5, metrics.getHeight()+x*15-textStart, srcGraphics);
-        }
-        	
-		g.drawImage(source, getX(), getY(), null);
-		
-		g.setColor(Color.red);
-		g.drawRect(getX(), getY(), getWidth(), getHeight());
-		
-		if(lstObjects.size()*15+6 > getHeight())
-			getScrollBar().setSize(getScrollBar().getMaxSize()*getHeight()/(lstObjects.size()*15+6));
-		else
-			getScrollBar().setSize(getScrollBar().getMaxSize());
-		
-		getScrollBar().draw(g);
-	}
+
+  private ArrayList<Listable> lstObjects;
+  private Listable selectedItem;
+  private Font font;
+  private int fontHeight;
+  private int textStart;
+  private boolean change;
+  
+  public ScrollList(String newName, int newX, int newY, int newWidth, int newHeight, Font font, FontMetrics metrics) {
+    super(newName, newX, newY, newWidth, newHeight);
+    this.lstObjects = new ArrayList<Listable>();
+    this.selectedItem = null;
+    this.font = font;
+    if (metrics == null) {
+      this.fontHeight = 0;
+    } else {
+      this.fontHeight = metrics.getHeight();
+    }
+    this.textStart = 0;
+    this.change = false;
+  }
+
+  public ArrayList<Listable> getList() {
+    return this.lstObjects;
+  }
+
+  public Listable getSelected() {
+    return this.selectedItem;
+  }
+
+  public boolean isChanged() {
+    return this.change;
+  }
+
+  public void changeHandled() {
+    this.change = false;
+  }
+
+  public void deselect() {
+    this.selectedItem = null;
+  }
+
+  public void clear() {
+    this.lstObjects.clear();
+    this.selectedItem = null;
+    this.textStart = 0;
+    changeHandled();
+  }
+
+  public boolean handleEvent(MouseEvent e) {
+    if (!getScrollBar().handleEvent(e))
+      return false; 
+    if (e.getY() < getY() + getScrollBar().getWidth()) {
+      changeTextStart(-30);
+    } else if (getY() + getHeight() - getScrollBar().getWidth() < e.getY()) {
+      changeTextStart(30);
+    }
+    return true;
+  }
+
+  private void changeTextStart(int increment) {
+    this.textStart += increment;
+    int listHeight = 0;
+    if (this.lstObjects.size() > 0) {
+      Listable e = this.lstObjects.get(0);
+      listHeight = e.getHeight() * (int)Math.ceil(this.lstObjects.size() / (getWidth() / e.getWidth())) + e.getYOffset();
+    }
+    if (listHeight > getHeight() && this.textStart >= listHeight - getHeight()) {
+      this.textStart = listHeight - getHeight();
+      getScrollBar().setPosition(getScrollBar().getMaxSize() - getScrollBar().getSize());
+    } else if (this.textStart < 0 || listHeight <= getHeight()) {
+      this.textStart = 0;
+      getScrollBar().setPosition(0);
+    } else {
+      getScrollBar().setPosition(this.textStart * getScrollBar().getMaxSize() / listHeight);
+    }
+  }
+
+  public int getTextStart() {
+    return this.textStart;
+  }
+
+  public void draw(Graphics g) {
+    GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
+    GraphicsDevice device = env.getDefaultScreenDevice();
+    GraphicsConfiguration gc = device.getDefaultConfiguration();
+    BufferedImage source = gc.createCompatibleImage(getWidth(), getHeight());
+    Graphics2D srcGraphics = source.createGraphics();
+    srcGraphics.setColor(Color.green);
+    if (this.font != null) {
+      srcGraphics.setFont(this.font);
+    }
+    int listHeight = 0;
+    Listable e = null;
+    if (this.lstObjects.size() > 0) {
+      e = this.lstObjects.get(0);
+      listHeight = e.getHeight() * (int)Math.ceil(this.lstObjects.size() / (getWidth() / e.getWidth())) + e.getYOffset();
+    }
+    int numPerRow = 0;
+    if (e != null) {
+      numPerRow = getWidth() / e.getWidth();
+    }
+    for (int x = 0; x < this.lstObjects.size(); x++) {
+      ((Listable)this.lstObjects.get(x)).draw(e.getHeight() * x % numPerRow + e.getXOffset(), this.fontHeight + x / numPerRow * e.getHeight() - this.textStart, srcGraphics);
+    }
+    g.drawImage(source, getX(), getY(), null);
+    g.setColor(Color.red);
+    g.drawRect(getX(), getY(), getWidth(), getHeight());
+    if (listHeight > getHeight()) {
+      getScrollBar().setSize(getScrollBar().getMaxSize() * getHeight() / listHeight);
+    } else {
+      getScrollBar().setSize(getScrollBar().getMaxSize());
+    }
+    getScrollBar().draw(g);
+  }
 }
