Search in sources :

Example 31 with GuiButtonThemed

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

the class GuiQuestLineEditorB method RefreshColumns.

public void RefreshColumns() {
    if (line == null) {
        lineQuests.clear();
    } else {
        lineQuests = line.getAllKeys();
    }
    qlBtnList.getEntryList().clear();
    for (int qID : lineQuests) {
        IQuest quest = QuestDatabase.INSTANCE.getValue(qID);
        if (quest == null) {
            continue;
        }
        int bWidth = qlBtnList.getListWidth();
        // First 3 bits reserved for column index
        int bID = (2 + qID) << 3;
        GuiButtonThemed btn1 = new GuiButtonThemed(bID + 0, 0, 0, bWidth - 20, 20, I18n.format(quest.getUnlocalisedName()));
        GuiButtonThemed btn2 = new GuiButtonThemed(bID + 1, 0, 0, 20, 20, TextFormatting.YELLOW + ">");
        qlBtnList.addButtonRow(btn1, btn2);
    }
    dbBtnList.getEntryList().clear();
    for (int qID : searchResults) {
        IQuest quest = QuestDatabase.INSTANCE.getValue(qID);
        if (quest == 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 = line != null && !lineQuests.contains(qID);
        GuiButtonThemed btn4 = new GuiButtonThemed(bID + 3, 0, 0, bWidth - 40, 20, I18n.format(quest.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 32 with GuiButtonThemed

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

the class GuiJsonAdd method initGui.

@Override
public void initGui() {
    super.initGui();
    ((GuiButton) this.buttonList.get(0)).x = this.guiLeft + this.sizeX / 2 - 100;
    ((GuiButton) this.buttonList.get(0)).width = 100;
    this.buttonList.add(new GuiButtonThemed(1, this.guiLeft + this.sizeX / 2, this.guiTop + this.sizeY - 16, 100, 20, I18n.format("gui.cancel"), true));
    int btnOff = -20;
    if (json.getId() == 10) {
        keyText = new GuiTextField(0, this.fontRenderer, this.guiLeft + this.sizeX / 2 - 100, this.guiTop + this.sizeY / 2 - 48, 200, 16);
        keyText.setMaxStringLength(Integer.MAX_VALUE);
        ((GuiButton) this.buttonList.get(0)).enabled = false;
        btnOff = 0;
    }
    GuiButtonThemed buttonStr = new GuiButtonThemed(2, this.guiLeft + this.sizeX / 2 - 100, this.guiTop + this.sizeY / 2 - 20 + btnOff, 200, 20, I18n.format("betterquesting.btn.text"), true);
    GuiButtonThemed buttonNum = new GuiButtonThemed(3, this.guiLeft + this.sizeX / 2 - 100, this.guiTop + this.sizeY / 2 - 00 + btnOff, 200, 20, I18n.format("betterquesting.btn.number"), true);
    GuiButtonThemed buttonObj = new GuiButtonThemed(4, this.guiLeft + this.sizeX / 2 - 100, this.guiTop + this.sizeY / 2 + 20 + btnOff, 100, 20, I18n.format("betterquesting.btn.object"), true);
    GuiButtonThemed buttonArr = new GuiButtonThemed(5, this.guiLeft + this.sizeX / 2 - 000, this.guiTop + this.sizeY / 2 + 20 + btnOff, 100, 20, I18n.format("betterquesting.btn.list"), true);
    GuiButtonThemed buttonEnt = new GuiButtonThemed(8, this.guiLeft + this.sizeX / 2 - 100, this.guiTop + this.sizeY / 2 + 40 + btnOff, 200, 20, I18n.format("betterquesting.btn.entity"), true);
    GuiButtonThemed buttonItm = new GuiButtonThemed(6, this.guiLeft + this.sizeX / 2 - 100, this.guiTop + this.sizeY / 2 + 60 + btnOff, 100, 20, I18n.format("betterquesting.btn.item"), true);
    GuiButtonThemed buttonFlu = new GuiButtonThemed(7, this.guiLeft + this.sizeX / 2 - 000, this.guiTop + this.sizeY / 2 + 60 + btnOff, 100, 20, I18n.format("betterquesting.btn.fluid"), true);
    // Default selection, init disabled
    buttonStr.enabled = false;
    this.buttonList.add(buttonStr);
    this.buttonList.add(buttonNum);
    this.buttonList.add(buttonObj);
    this.buttonList.add(buttonArr);
    this.buttonList.add(buttonItm);
    this.buttonList.add(buttonFlu);
    this.buttonList.add(buttonEnt);
}
Also used : GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed) GuiTextField(net.minecraft.client.gui.GuiTextField)

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