Search in sources :

Example 1 with IImporter

use of betterquesting.api.client.importers.IImporter in project BetterQuesting by Funwayguy.

the class GuiImporters method mouseClicked.

@Override
public void mouseClicked(int mx, int my, int click) throws IOException {
    super.mouseClicked(mx, my, click);
    GuiButtonThemed btn = this.btnList.getButtonUnderMouse(mx, my);
    if (click == 0 && btn != null && btn.mousePressed(mc, mx, my)) {
        btn.playPressSound(mc.getSoundHandler());
        @SuppressWarnings("unchecked") IImporter imp = ((GuiButtonStorage<IImporter>) btn).getStored();
        this.selected = imp;
        if (impGui != null) {
            this.embedded.remove(impGui);
        }
        impGui = new GuiImporterEmbedded(imp, guiLeft + sizeX / 2 + 8, guiTop + 32, sizeX / 2 - 24, sizeY - 84);
        this.embedded.add(impGui);
    }
}
Also used : GuiButtonStorage(betterquesting.api.client.gui.controls.GuiButtonStorage) GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed) IImporter(betterquesting.api.client.importers.IImporter)

Example 2 with IImporter

use of betterquesting.api.client.importers.IImporter in project BetterQuesting by Funwayguy.

the class GuiImporters method initGui.

@Override
public void initGui() {
    super.initGui();
    btnList = new GuiScrollingButtons(mc, guiLeft + 16, guiTop + 32, sizeX / 2 - 24, sizeY - 64);
    for (IImporter imp : ImporterRegistry.INSTANCE.getImporters()) {
        GuiButtonStorage<IImporter> btnImp = new GuiButtonStorage<IImporter>(0, 0, 0, btnList.getListWidth(), 20, I18n.format(imp.getUnlocalisedName()));
        btnImp.setStored(imp);
        btnList.addButtonRow(btnImp);
    }
    this.embedded.add(btnList);
    int btnX = guiLeft + 16 + ((sizeX - 32) / 4) * 3 - 50;
    this.buttonList.add(new GuiButtonThemed(1, btnX, guiTop + sizeY - 52, 100, 20, I18n.format("betterquesting.btn.import")));
}
Also used : GuiButtonStorage(betterquesting.api.client.gui.controls.GuiButtonStorage) GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed) IImporter(betterquesting.api.client.importers.IImporter) GuiScrollingButtons(betterquesting.api.client.gui.lists.GuiScrollingButtons)

Aggregations

GuiButtonStorage (betterquesting.api.client.gui.controls.GuiButtonStorage)2 GuiButtonThemed (betterquesting.api.client.gui.controls.GuiButtonThemed)2 IImporter (betterquesting.api.client.importers.IImporter)2 GuiScrollingButtons (betterquesting.api.client.gui.lists.GuiScrollingButtons)1