|
17 | 17 | */ |
18 | 18 | public class ScrollingList<E extends AbstractSelectionList.Entry<E>> extends AbstractSelectionList<E> { |
19 | 19 | public ScrollingList(int x, int y, int width, int height, int slotHeightIn) { |
20 | | - super(Minecraft.getInstance(), width, height, y - (height / 2), (y - (height / 2)) + height, slotHeightIn); |
21 | | - this.setLeftPos(x - (width / 2)); |
| 20 | + super(Minecraft.getInstance(), width, height, y - (height / 2), slotHeightIn); |
| 21 | + this.setX(x - (width / 2)); |
22 | 22 | this.setRenderBackground(false); |
23 | 23 |
|
24 | 24 | // this.setRenderTopAndBottom(false); // removes background |
25 | 25 | } |
26 | 26 |
|
27 | 27 | @Override |
28 | | - public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { |
| 28 | + public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { |
29 | 29 | double scale = Minecraft.getInstance().getWindow().getGuiScale(); |
30 | 30 |
|
31 | 31 | GL11.glEnable(GL11.GL_SCISSOR_TEST); |
32 | | - GL11.glScissor((int)(this.x0 * scale), (int)(Minecraft.getInstance().getWindow().getHeight() - ((this.y0 + this.height) * scale)), |
| 32 | + GL11.glScissor((int)(this.getX() * scale), (int)(Minecraft.getInstance().getWindow().getHeight() - ((this.getY() + this.height) * scale)), |
33 | 33 | (int)(this.width * scale), (int)(this.height * scale)); |
34 | 34 |
|
35 | | - super.render(guiGraphics, mouseX, mouseY, partialTicks); |
| 35 | + super.renderWidget(guiGraphics, mouseX, mouseY, partialTicks); |
36 | 36 |
|
37 | 37 | GL11.glDisable(GL11.GL_SCISSOR_TEST); |
38 | 38 | } |
39 | 39 |
|
40 | 40 | @Override // @mcp: getScrollbarPosition = getScrollbarPosition |
41 | 41 | protected int getScrollbarPosition() { |
42 | | - return (this.x0 + this.width) - 6; |
| 42 | + return (this.getX() + this.width) - 6; |
43 | 43 | } |
44 | 44 |
|
45 | 45 | @Override |
46 | | - public void updateNarration(NarrationElementOutput p_169152_) { |
| 46 | + protected void updateWidgetNarration(NarrationElementOutput narrationElementOutput) { |
47 | 47 |
|
48 | 48 | } |
49 | 49 | } |
0 commit comments