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);
}
}
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);
}
Aggregations