Better constant, settings!
parent
bab40824b7
commit
dbdd7ba11b
@ -0,0 +1,31 @@
|
||||
package net.brokenmoon.afloydwiremod.gui;
|
||||
|
||||
import net.minecraft.src.GuiButton;
|
||||
import net.minecraft.src.GuiScreen;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
public class GuiScrollable extends GuiScreen {
|
||||
private int scroll;
|
||||
@Override
|
||||
public void drawScreen(int x, int y, float renderPartialTicks) {
|
||||
//TODO: Tweak these values later to fit all the stuff
|
||||
int wheel = Mouse.getDWheel();
|
||||
if(wheel > 0)
|
||||
scroll++;
|
||||
if (wheel < 0)
|
||||
scroll--;
|
||||
if(scroll > 150)
|
||||
scroll = 150;
|
||||
if(scroll < 0)
|
||||
scroll = 0;
|
||||
for (int i = 0; i < this.controlList.size(); ++i) {
|
||||
GuiButtonExtended guibutton = (GuiButtonExtended)this.controlList.get(i);
|
||||
if(scroll >= 0)
|
||||
guibutton.scroll = scroll;
|
||||
if(scroll <= 0)
|
||||
guibutton.scroll = scroll;
|
||||
if(guibutton.yPosition >= 50 && guibutton.yPosition <= 200)
|
||||
guibutton.drawButton(this.mc, x, y);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue