Search in sources :

Example 6 with ManualEntry

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);
}
Also used : ManualEntry(blusunrize.lib.manual.ManualInstance.ManualEntry)

Aggregations

ManualEntry (blusunrize.lib.manual.ManualInstance.ManualEntry)6 IManualPage (blusunrize.lib.manual.IManualPage)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)1