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