Search in sources :

Example 1 with GuiQuestLinesEmbedded

use of betterquesting.client.gui.GuiQuestLinesEmbedded in project BetterQuesting by Funwayguy.

the class GuiQuestLineDesigner method initGui.

@Override
public void initGui() {
    super.initGui();
    this.sizeX -= 96;
    ((GuiButton) this.buttonList.get(0)).x = guiLeft + sizeX / 2 - 100;
    GuiQuestLinesEmbedded oldGui = qlGui;
    qlGui = new GuiQuestLinesEmbedded(guiLeft + 16, guiTop + 16, sizeX - 32, sizeY - 32);
    qlGui.setQuestLine(new QuestLineButtonTree(qLine), true);
    if (// Preserve old settings
    oldGui != null) {
        embedded.remove(oldGui);
        qlGui.copySettings(oldGui);
    }
    qlGui.clampScroll();
    embedded.add(qlGui);
    this.tabList.clear();
    this.tabList.addAll(ToolboxRegistry.INSTANCE.getAllTools());
    this.tabIndex = MathHelper.clamp(tabIndex, 0, Math.max(0, tabList.size() - 1));
    for (IToolboxTab tab : tabList) {
        tab.initTools(this.qlGui);
    }
    if (tabList.size() > 0) {
        toolTab = tabList.get(tabIndex);
        tabGui = toolTab.getTabGui(guiLeft + sizeX + 16, guiTop + 32, 64, sizeY - 48);
        if (tabGui != null) {
            embedded.add(tabGui);
        }
    }
    GuiButtonThemed btnLeft = new GuiButtonThemed(1, guiLeft + sizeX, guiTop + 16, 16, 16, "<", true);
    GuiButtonThemed btnRight = new GuiButtonThemed(2, guiLeft + sizeX + 80, guiTop + 16, 16, 16, ">", true);
    if (tabList.size() <= 1) {
        btnLeft.enabled = false;
        btnRight.enabled = false;
    }
    buttonList.add(btnLeft);
    buttonList.add(btnRight);
}
Also used : QuestLineButtonTree(betterquesting.api.client.gui.QuestLineButtonTree) IToolboxTab(betterquesting.api.client.toolbox.IToolboxTab) GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed) GuiQuestLinesEmbedded(betterquesting.client.gui.GuiQuestLinesEmbedded)

Aggregations

QuestLineButtonTree (betterquesting.api.client.gui.QuestLineButtonTree)1 GuiButtonThemed (betterquesting.api.client.gui.controls.GuiButtonThemed)1 IToolboxTab (betterquesting.api.client.toolbox.IToolboxTab)1 GuiQuestLinesEmbedded (betterquesting.client.gui.GuiQuestLinesEmbedded)1