| 11 | import static org.lwjgl.opengl.GL11.*; |
| 12 | |
| 13 | public class GuiList<E extends Row> extends bgb implements IGuiList<E> { |
| 14 | |
| 15 | protected final List<E> rows; |
| 16 | private final Clickable<E> clickable; |
| 17 | |
| 18 | private int rowWidth = 95; |
| 19 | private int bottomPadding; |
| 20 | private boolean leftbound = false; |
| 21 | private int scrollX; |
| 22 | |
| 23 | private int selected; |
| 24 | private IButton selectedButton; |
| 25 | |
| 26 | private String header; |
| 27 | |
| 28 | private boolean drawDefaultBackground = false; |
| 29 | private Object backgroundTexture; |
| 30 | private int backgroundWidth, backgroundHeight; |
| 31 | |
| 32 | protected List<Integer> heightMap = Lists.newArrayList(); |
| 33 | |
| 34 | public GuiList(Clickable<E> clickable, int width, int height, int top, int bottom, int left, int right, List<E> rows) { |
| 35 | super(((Variables) MinecraftFactory.getVars()).getMinecraft(), width, height, top, bottom, 18); |
| 36 | |
| 37 | this.rows = rows; |
| 38 | this.clickable = clickable; |
| 39 | setLeft(left); |
| 40 | setRight(right); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * @return the size of all rows |
| 45 | */ |
| 46 | @Override |
| 47 | protected int b() { |
| 48 | synchronized (rows) { |
| 49 | return rows.size(); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | protected int k() { |
| 55 | return getContentHeight(); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Element clicked |
| 60 | * |
| 61 | * @param id The id of the Row. |
| 62 | * @param doubleClick If the Row has been Double-Clicked. |
| 63 | * @param mouseX The x-coordinate of the Mouse. |
| 64 | * @param mouseY The y-coordinate of the Mouse. |
| 65 | */ |
| 66 | @Override |
| 67 | protected void a(int id, boolean doubleClick, int mouseX, int mouseY) { |
| 68 | selected = id; |
| 69 | boolean var5 = (GuiList.this.selected >= 0) && (GuiList.this.selected < b()); |
| 70 | if (var5) { |
nothing calls this directly
no outgoing calls
no test coverage detected