mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Scrollwheel support for template folder
This commit is contained in:
parent
640b0ae341
commit
4b3430f9b1
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
import org.lwjgl.input.Mouse;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.opengl.GL12;
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
@ -153,6 +154,7 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
|||||||
return (int) Math.ceil((stacks.size() - 1) / (5 * 7));
|
return (int) Math.ceil((stacks.size() - 1) / (5 * 7));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void updateScreen() {
|
public void updateScreen() {
|
||||||
if(currentPage < 0)
|
if(currentPage < 0)
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
@ -160,6 +162,7 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
|||||||
currentPage = getPageCount();
|
currentPage = getPageCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||||
this.drawDefaultBackground();
|
this.drawDefaultBackground();
|
||||||
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||||
@ -168,6 +171,7 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
|||||||
GL11.glEnable(GL11.GL_LIGHTING);
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
super.initGui();
|
super.initGui();
|
||||||
this.guiLeft = (this.width - this.xSize) / 2;
|
this.guiLeft = (this.width - this.xSize) / 2;
|
||||||
@ -204,6 +208,26 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
|||||||
buttons.add(new FolderButton(guiLeft + 25 + (27 * 4) + 18, guiTop + 26 + (27 * 3), 2, "Next"));
|
buttons.add(new FolderButton(guiLeft + 25 + (27 * 4) + 18, guiTop + 26 + (27 * 3), 2, "Next"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleMouseInput() {
|
||||||
|
super.handleMouseInput();
|
||||||
|
|
||||||
|
if(Mouse.getEventButton() == -1) {
|
||||||
|
int scroll = Mouse.getEventDWheel();
|
||||||
|
|
||||||
|
if(scroll < 0) {
|
||||||
|
if(currentPage > 0)
|
||||||
|
currentPage--;
|
||||||
|
updateButtons();
|
||||||
|
} else if(scroll > 0) {
|
||||||
|
if(currentPage < getPageCount())
|
||||||
|
currentPage++;
|
||||||
|
updateButtons();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void mouseClicked(int i, int j, int k) {
|
protected void mouseClicked(int i, int j, int k) {
|
||||||
|
|
||||||
if(i >= guiLeft + 45 && i < guiLeft + 117 && j >= guiTop + 211 && j < guiTop + 223) {
|
if(i >= guiLeft + 45 && i < guiLeft + 117 && j >= guiTop + 211 && j < guiTop + 223) {
|
||||||
@ -251,6 +275,7 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
|||||||
search.drawTextBox();
|
search.drawTextBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
|
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
|
||||||
|
|
||||||
if (this.search.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
|
if (this.search.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user