use of blusunrize.lib.manual.ManualInstance.ManualEntry in project ImmersiveEngineering by BluSunrize.
the class GuiManual method mouseClicked.
@Override
public void mouseClicked(int mx, int my, int button) throws IOException {
super.mouseClicked(mx, my, button);
if (button == 0 && manual.getEntry(selectedEntry) != null) {
ManualEntry entry = manual.getEntry(selectedEntry);
mx -= guiLeft;
my -= guiTop;
if (page > 0 && mx > 32 && mx < 32 + 17 && my > 179 && my < 179 + 10) {
page--;
this.initGui();
}
if (page < entry.getPages().length - 1 && mx > 135 && mx < 135 + 17 && my > 179 && my < 179 + 10) {
page++;
this.initGui();
}
} else if (button == 1) {
if (searchField != null && searchField.getText() != null && !searchField.getText().isEmpty())
searchField.setText("");
else if (selectedEntry != null) {
if (previousSelectedEntry.size() > 0) {
setSelectedEntry(previousSelectedEntry.get(0));
previousSelectedEntry.remove(0);
} else
setSelectedEntry(null);
} else if (selectedCategory != null)
selectedCategory = null;
page = 0;
this.initGui();
}
lastClick = new int[] { mx, my };
if (this.searchField != null)
this.searchField.mouseClicked(mx, my, button);
}
Aggregations