Search in sources :

Example 1 with GuiQuestLineEditorA

use of betterquesting.client.gui.editors.GuiQuestLineEditorA in project BetterQuesting by Funwayguy.

the class GuiQuestLines method onButtonPress.

private void onButtonPress(PEventButton event) {
    Minecraft mc = Minecraft.getMinecraft();
    IPanelButton btn = event.getButton();
    if (// Exit
    btn.getButtonID() == 0) {
        mc.displayGuiScreen(this.parent);
    } else if (// Quest Line Select
    btn.getButtonID() == 1 && btn instanceof PanelButtonStorage) {
        for (PanelButtonStorage b : qlBtns) {
            if (b.getStoredValue() == selectedLine) {
                b.setBtnState(true);
                break;
            }
        }
        @SuppressWarnings("unchecked") IQuestLine ql = ((PanelButtonStorage<IQuestLine>) btn).getStoredValue();
        selectedLine = ql;
        selectedLineId = QuestLineDatabase.INSTANCE.getKey(ql);
        cvQuest.setQuestLine(ql);
        paDesc.setText(I18n.format(ql.getUnlocalisedDescription()));
        cvDesc.refreshScrollBounds();
        scDesc.setEnabled(cvDesc.getScrollBounds().getHeight() > 0);
        btn.setBtnState(false);
    } else if (// Quest Instance Select
    btn.getButtonID() == 2 && btn instanceof PanelButtonStorage) {
        @SuppressWarnings("unchecked") IQuest quest = ((PanelButtonStorage<IQuest>) btn).getStoredValue();
        GuiHome.bookmark = new GuiQuest(this, QuestDatabase.INSTANCE.getKey(quest));
        this.lastScrollX = cvQuest.getScrollX();
        this.lastScrollY = cvQuest.getScrollY();
        this.lastZoom = cvQuest.getZoom();
        mc.displayGuiScreen(GuiHome.bookmark);
    } else if (btn.getButtonID() == 3) {
        mc.displayGuiScreen(new GuiQuestLineEditorA(this));
    }
}
Also used : IQuest(betterquesting.api.questing.IQuest) IQuestLine(betterquesting.api.questing.IQuestLine) IPanelButton(betterquesting.api2.client.gui.controls.IPanelButton) PanelButtonStorage(betterquesting.api2.client.gui.controls.PanelButtonStorage) Minecraft(net.minecraft.client.Minecraft) GuiQuestLineEditorA(betterquesting.client.gui.editors.GuiQuestLineEditorA)

Aggregations

IQuest (betterquesting.api.questing.IQuest)1 IQuestLine (betterquesting.api.questing.IQuestLine)1 IPanelButton (betterquesting.api2.client.gui.controls.IPanelButton)1 PanelButtonStorage (betterquesting.api2.client.gui.controls.PanelButtonStorage)1 GuiQuestLineEditorA (betterquesting.client.gui.editors.GuiQuestLineEditorA)1 Minecraft (net.minecraft.client.Minecraft)1