Search in sources :

Example 21 with GuiButtonThemed

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

the class ScrollingJsonEntry method drawBackground.

@Override
public void drawBackground(int mx, int my, int px, int py, int width) {
    int margin = px + (width / 3);
    for (GuiButtonThemed btn : btnList) {
        btn.y = py;
        btn.drawButton(mc, mx, my, 1F);
    }
    if (txtMain != null) {
        txtMain.y = py + 1;
        txtMain.drawTextBox();
    }
    int length = mc.fontRenderer.getStringWidth(name);
    mc.fontRenderer.drawString(name, margin - 8 - length, py + 6, getTextColor(), false);
}
Also used : GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed)

Example 22 with GuiButtonThemed

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

the class GuiRewardEditor method RefreshColumns.

public void RefreshColumns() {
    btnsLeft.getEntryList().clear();
    btnsRight.getEntryList().clear();
    for (int tID : rewardIDs) {
        int btnWidth = btnsLeft.getListWidth();
        // First 2 bits reserved for column index
        int bID = (1 + tID) << 2;
        GuiButtonThemed btn1 = new GuiButtonThemed(bID + 0, 0, 0, btnWidth - 20, 20, I18n.format(quest.getRewards().getValue(tID).getUnlocalisedName()));
        GuiButtonThemed btn2 = new GuiButtonThemed(bID + 1, 0, 0, 20, 20, "" + TextFormatting.RED + TextFormatting.BOLD + "x");
        btnsLeft.addButtonRow(btn1, btn2);
    }
    for (int i = 0; i < rewardTypes.size(); i++) {
        int btnWidth = btnsRight.getListWidth();
        int bID = (1 + i) << 2;
        GuiButtonThemed btn1 = new GuiButtonThemed(bID + 2, 0, 0, btnWidth, 20, rewardTypes.get(i).getRegistryName().toString());
        btnsRight.addButtonRow(btn1);
    }
}
Also used : GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed)

Example 23 with GuiButtonThemed

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

the class GuiTaskEditor method RefreshColumns.

public void RefreshColumns() {
    btnsLeft.getEntryList().clear();
    btnsRight.getEntryList().clear();
    for (int tID : taskIDs) {
        int btnWidth = btnsLeft.getListWidth();
        // First 2 bits reserved for column index
        int bID = (1 + tID) << 2;
        GuiButtonThemed btn1 = new GuiButtonThemed(bID + 0, 0, 0, btnWidth - 20, 20, I18n.format(quest.getTasks().getValue(tID).getUnlocalisedName()));
        GuiButtonThemed btn2 = new GuiButtonThemed(bID + 1, 0, 0, 20, 20, "" + TextFormatting.RED + TextFormatting.BOLD + "x");
        btnsLeft.addButtonRow(btn1, btn2);
    }
    for (int i = 0; i < taskTypes.size(); i++) {
        int btnWidth = btnsRight.getListWidth();
        int bID = (1 + i) << 2;
        GuiButtonThemed btn1 = new GuiButtonThemed(bID + 2, 0, 0, btnWidth, 20, taskTypes.get(i).getRegistryName().toString());
        btnsRight.addButtonRow(btn1);
    }
}
Also used : GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed)

Example 24 with GuiButtonThemed

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

Example 25 with GuiButtonThemed

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

the class GuiPrerequisiteEditor 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 = prBtnList.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