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