Search in sources :

Example 1 with GuiButtonThemed

use of betterquesting.api.client.gui.controls.GuiButtonThemed 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 GuiButtonThemed

use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.

the class GuiPrerequisiteEditor method initGui.

@Override
public void initGui() {
    super.initGui();
    if (quest == null) {
        mc.displayGuiScreen(parent);
    }
    int btnWidth = sizeX / 2 - 16;
    int sx = sizeX - 32;
    this.searchBox = new GuiBigTextField(mc.fontRenderer, guiLeft + sizeX / 2 + 8, guiTop + 48, btnWidth - 16, 20);
    this.searchBox.setWatermark(I18n.format("betterquesting.gui.search"));
    this.buttonList.add(new GuiButtonThemed(1, guiLeft + 16 + sx / 4 * 3 - 50, guiTop + sizeY - 48, 100, 20, I18n.format("betterquesting.btn.new"), true));
    prBtnList = new GuiScrollingButtons(mc, guiLeft + 16, guiTop + 48, btnWidth - 8, sizeY - 96);
    dbBtnList = new GuiScrollingButtons(mc, guiLeft + sizeX / 2 + 8, guiTop + 68, btnWidth - 8, sizeY - 116);
    this.embedded.add(prBtnList);
    this.embedded.add(dbBtnList);
    RefreshSearch();
    RefreshColumns();
}
Also used : GuiBigTextField(betterquesting.api.client.gui.controls.GuiBigTextField) GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed) GuiScrollingButtons(betterquesting.api.client.gui.lists.GuiScrollingButtons)

Example 3 with GuiButtonThemed

use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.

the class GuiPrerequisiteEditor method RefreshColumns.

public void RefreshColumns() {
    prBtnList.getEntryList().clear();
    for (IQuest prq : quest.getPrerequisites()) {
        int qID = QuestDatabase.INSTANCE.getKey(prq);
        int btnWidth = prBtnList.getListWidth();
        // First 3 bits reserved for column index
        int bID = (2 + qID) << 3;
        GuiButtonThemed btn1 = new GuiButtonThemed(bID + 0, 0, 0, btnWidth - 20, 20, I18n.format(prq.getUnlocalisedName()));
        GuiButtonThemed btn2 = new GuiButtonThemed(bID + 1, 0, 0, 20, 20, TextFormatting.YELLOW + ">");
        prBtnList.addButtonRow(btn1, btn2);
    }
    dbBtnList.getEntryList().clear();
    for (int qID : searchResults) {
        IQuest dbQ = QuestDatabase.INSTANCE.getValue(qID);
        if (dbQ == null) {
            continue;
        }
        int bWidth = dbBtnList.getListWidth();
        // First 3 bits reserved for column index
        int bID = (2 + qID) << 3;
        GuiButtonThemed btn3 = new GuiButtonThemed(bID + 2, 0, 0, 20, 20, TextFormatting.GREEN + "<");
        btn3.enabled = dbQ != null && quest != dbQ && !quest.getPrerequisites().contains(dbQ);
        GuiButtonThemed btn4 = new GuiButtonThemed(bID + 3, 0, 0, bWidth - 40, 20, I18n.format(dbQ.getUnlocalisedName()));
        GuiButtonThemed btn5 = new GuiButtonThemed(bID + 4, 0, 0, 20, 20, "" + TextFormatting.BOLD + TextFormatting.RED + "x");
        dbBtnList.addButtonRow(btn3, btn4, btn5);
    }
}
Also used : IQuest(betterquesting.api.questing.IQuest) GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed)

Example 4 with GuiButtonThemed

use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.

the class GuiQuestLineEditorB method initGui.

@Override
public void initGui() {
    super.initGui();
    int btnWidth = sizeX / 2 - 16;
    int sx = sizeX - 32;
    this.searchBox = new GuiBigTextField(mc.fontRenderer, guiLeft + sizeX / 2 + 9, guiTop + 49, btnWidth - 18, 18);
    this.searchBox.setWatermark(I18n.format("betterquesting.gui.search"));
    this.buttonList.add(new GuiButtonThemed(1, guiLeft + 16 + sx / 4 * 3 - 50, guiTop + sizeY - 48, 100, 20, I18n.format("betterquesting.btn.new"), true));
    qlBtnList = new GuiScrollingButtons(mc, guiLeft + 16, guiTop + 48, btnWidth - 8, sizeY - 96);
    dbBtnList = new GuiScrollingButtons(mc, guiLeft + sizeX / 2 + 8, guiTop + 68, btnWidth - 8, sizeY - 116);
    this.embedded.add(qlBtnList);
    this.embedded.add(dbBtnList);
    RefreshSearch();
    RefreshColumns();
}
Also used : GuiBigTextField(betterquesting.api.client.gui.controls.GuiBigTextField) GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed) GuiScrollingButtons(betterquesting.api.client.gui.lists.GuiScrollingButtons)

Example 5 with GuiButtonThemed

use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.

the class GuiQuestLineEditorB method mouseClicked.

@Override
public void mouseClicked(int mx, int my, int type) throws IOException {
    super.mouseClicked(mx, my, type);
    this.searchBox.mouseClicked(mx, my, type);
    if (type != 0) {
        return;
    }
    GuiButtonThemed btn1 = qlBtnList.getButtonUnderMouse(mx, my);
    if (btn1 != null && btn1.mousePressed(mc, mx, my)) {
        btn1.playPressSound(mc.getSoundHandler());
        this.actionPerformed(btn1);
        return;
    }
    GuiButtonThemed btn2 = dbBtnList.getButtonUnderMouse(mx, my);
    if (btn2 != null && btn2.mousePressed(mc, mx, my)) {
        btn2.playPressSound(mc.getSoundHandler());
        this.actionPerformed(btn2);
        return;
    }
}
Also used : GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed)

Aggregations

GuiButtonThemed (betterquesting.api.client.gui.controls.GuiButtonThemed)32 GuiBigTextField (betterquesting.api.client.gui.controls.GuiBigTextField)7 GuiTextField (net.minecraft.client.gui.GuiTextField)5 GuiScrollingButtons (betterquesting.api.client.gui.lists.GuiScrollingButtons)4 IQuest (betterquesting.api.questing.IQuest)3 UUID (java.util.UUID)3 GuiButtonStorage (betterquesting.api.client.gui.controls.GuiButtonStorage)2 GuiNumberField (betterquesting.api.client.gui.controls.GuiNumberField)2 GuiScrollingText (betterquesting.api.client.gui.lists.GuiScrollingText)2 IImporter (betterquesting.api.client.importers.IImporter)2 ItemStack (net.minecraft.item.ItemStack)2 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 QuestLineButtonTree (betterquesting.api.client.gui.QuestLineButtonTree)1 GuiButtonJson (betterquesting.api.client.gui.controls.GuiButtonJson)1 IToolboxTab (betterquesting.api.client.toolbox.IToolboxTab)1 IQuestLine (betterquesting.api.questing.IQuestLine)1 IParty (betterquesting.api.questing.party.IParty)1 BigItemStack (betterquesting.api.utils.BigItemStack)1 GuiQuestLinesEmbedded (betterquesting.client.gui.GuiQuestLinesEmbedded)1 TextCallbackJsonArray (betterquesting.client.gui.editors.json.TextCallbackJsonArray)1