use of betterquesting.api.client.gui.controls.GuiButtonStorage 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.GuiButtonStorage in project BetterQuesting by Funwayguy.
the class GuiJsonEntitySelection method updateSearch.
private void updateSearch() {
if (searching == null) {
return;
} else if (!searching.hasNext()) {
searching = null;
return;
}
int pass = 0;
int btnWidth = btnList.getListWidth();
while (searching.hasNext() && pass < 64) {
String key = searching.next();
Class<?> cls = EntityList.getClass(new ResourceLocation(key));
boolean abs = cls == null ? false : Modifier.isAbstract(cls.getModifiers());
if (!abs && key.toLowerCase().contains(searchTxt)) {
GuiButtonStorage<String> btn = new GuiButtonStorage<String>(1, 0, 0, btnWidth, 20, key);
btn.setStored(key);
btnList.addButtonRow(btn);
}
}
}
use of betterquesting.api.client.gui.controls.GuiButtonStorage 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")));
}
Aggregations