Reverse order of players on drop down

This commit is contained in:
drdev
2014-05-23 19:59:54 +00:00
parent b8b961f739
commit 68c4b49d8b

View File

@@ -36,12 +36,14 @@ public class VPlayers extends FDropDown {
@Override @Override
protected ScrollBounds updateAndGetPaneSize(float maxWidth, float maxVisibleHeight) { protected ScrollBounds updateAndGetPaneSize(float maxWidth, float maxVisibleHeight) {
float y = 0; float totalHeight = getChildCount() * PlayerInfoPanel.HEIGHT;
float y = totalHeight - PlayerInfoPanel.HEIGHT;
//display in reverse order so gui player on bottom
for (FDisplayObject panel : getChildren()) { for (FDisplayObject panel : getChildren()) {
panel.setBounds(0, y, maxWidth, PlayerInfoPanel.HEIGHT); panel.setBounds(0, y, maxWidth, PlayerInfoPanel.HEIGHT);
y += PlayerInfoPanel.HEIGHT; y -= PlayerInfoPanel.HEIGHT;
} }
return new ScrollBounds(maxWidth, y); return new ScrollBounds(maxWidth, totalHeight);
} }
private static class PlayerInfoPanel extends FContainer { private static class PlayerInfoPanel extends FContainer {