use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.
the class GuiTextEditor method initGui.
/**
* Adds the buttons (and other controls) to the screen in question.
*/
public void initGui() {
super.initGui();
maxRows = (sizeY - 48) / 20;
for (int i = 0; i < maxRows; i++) {
GuiButtonThemed btn = new GuiButtonThemed(i + 1, guiLeft + 16, guiTop + 32 + (i * 20), 100, 20, "NULL", true);
this.buttonList.add(btn);
}
scrollingText = new GuiScrollingText(mc, guiLeft + 132, guiTop + 32, sizeX - 148, sizeY - 64);
scrollingText.SetText(text);
this.embedded.add(scrollingText);
cursorPosition = text.length();
RefreshColumns();
}
use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.
the class GuiSubmitStation method initGui.
public void initGui() {
super.initGui();
if (tile == null) {
mc.displayGuiScreen(parent);
return;
}
activeQuests.clear();
UUID pID = QuestingAPI.getQuestingUUID(mc.player);
QuestCache.INSTANCE.updateCache(mc.player);
activeQuests.addAll(QuestCache.INSTANCE.getActiveQuests(pID));
Iterator<IQuest> qit = activeQuests.iterator();
while (qit.hasNext()) {
IQuest q = qit.next();
if (q.getProperties().getProperty(NativeProps.VISIBILITY) == EnumQuestVisibility.HIDDEN) {
// These should not be shown to players
qit.remove();
}
}
// Prev Quest
buttonList.add(new GuiButtonThemed(1, guiLeft + sizeX / 2 - 120, guiTop + 32, 20, 20, "<", true));
// Next Quest
buttonList.add(new GuiButtonThemed(2, guiLeft + sizeX / 2 + 100, guiTop + 32, 20, 20, ">", true));
// Prev Task
buttonList.add(new GuiButtonThemed(3, guiLeft + sizeX / 2 - 120, guiTop + 52, 20, 20, "<", true));
// Next Quest
buttonList.add(new GuiButtonThemed(4, guiLeft + sizeX / 2 + 100, guiTop + 52, 20, 20, ">", true));
// Select Task
btnSelect = new GuiButtonThemed(5, guiLeft + sizeX / 2 - 20, guiTop + 72, 20, 20, TextFormatting.GREEN + "\u2714", true);
// Remove Task
btnRemove = new GuiButtonThemed(6, guiLeft + sizeX / 2 + 00, guiTop + 72, 20, 20, TextFormatting.RED + "x", true);
buttonList.add(btnSelect);
buttonList.add(btnRemove);
int invX = 16 + (sizeX / 2 - 24) / 2 - 162 / 2;
int invY = 92 + (sizeY - 108) / 2 - 98 / 2 + 22;
subContainer.moveInventorySlots(invX + 1, invY + 1);
invX += 18 * 3;
invY -= 22;
subContainer.moveSubmitSlot(invX + 1, invY + 1);
invX += 18 * 2;
subContainer.moveReturnSlot(invX + 1, invY + 1);
RefreshValues();
}
use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.
the class GuiFileExplorer method initGui.
@Override
public void initGui() {
super.initGui();
maxRowsL = (sizeY - 96) / 20;
maxRowsR = (sizeY - 96) / 20;
int btnWidth = sizeX / 2 - 16;
int sx = sizeX - 32;
this.buttonList.add(new GuiButtonThemed(1, guiLeft + 16 + sx / 4 * 3 - 50, guiTop + sizeY - 48, 100, 20, "...", true));
// Left main buttons
for (int i = 0; i < maxRowsL; i++) {
GuiButtonThemed btn = new GuiButtonThemed(this.buttonList.size(), guiLeft + 16, guiTop + 48 + (i * 20), btnWidth - 36, 20, "NULL", true);
this.buttonList.add(btn);
}
// Left remove buttons
for (int i = 0; i < maxRowsL; i++) {
GuiButtonThemed btn = new GuiButtonThemed(this.buttonList.size(), guiLeft + 16 + btnWidth - 36, guiTop + 48 + (i * 20), 20, 20, "" + TextFormatting.RED + TextFormatting.BOLD + "x", true);
this.buttonList.add(btn);
}
// Right main buttons
for (int i = 0; i < maxRowsR; i++) {
GuiButtonThemed btn = new GuiButtonThemed(this.buttonList.size(), guiLeft + sizeX / 2 + 28, guiTop + 48 + (i * 20), btnWidth - 36, 20, "NULL", true);
this.buttonList.add(btn);
}
// Right add buttons
for (int i = 0; i < maxRowsR; i++) {
GuiButtonThemed btn = new GuiButtonThemed(this.buttonList.size(), guiLeft + sizeX / 2 + 8, guiTop + 48 + (i * 20), 20, 20, "" + TextFormatting.GREEN + TextFormatting.BOLD + "<", true);
this.buttonList.add(btn);
}
contents = directory.listFiles(filter);
contents = contents != null ? contents : new File[0];
RefreshColumns();
}
use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.
the class GuiNoParty method initGui.
@Override
public void initGui() {
super.initGui();
UUID playerID = QuestingAPI.getQuestingUUID(mc.player);
IParty party = PartyManager.INSTANCE.getUserParty(playerID);
if (party != null) {
mc.displayGuiScreen(new GuiManageParty(parent, party));
return;
}
heart = new ItemStack(BetterQuesting.extraLife);
lives = LifeDatabase.INSTANCE.getLives(playerID);
invites.clear();
for (int i : PartyManager.INSTANCE.getPartyInvites(playerID)) {
invites.add(PartyManager.INSTANCE.getValue(i));
}
rightScroll = 0;
maxRows = (sizeY - 72) / 20;
btnCreate = new GuiButtonThemed(1, guiLeft + sizeX / 4 - 75, height / 2 + 00, 150, 20, I18n.format("betterquesting.btn.party_new"), true);
this.buttonList.add(btnCreate);
fieldName = new GuiTextField(0, mc.fontRenderer, guiLeft + sizeX / 4 - 74, height / 2 - 19, 148, 18);
fieldName.setText("New Party");
// Party Invites
for (int i = 0; i < maxRows; i++) {
GuiButtonThemed btn = new GuiButtonThemed(this.buttonList.size(), guiLeft + sizeX - 74, guiTop + 48 + (i * 20), 50, 20, I18n.format("betterquesting.btn.party_join"), true);
this.buttonList.add(btn);
}
RefreshColumns();
}
use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.
the class GuiPartyInvite method initGui.
@Override
public void initGui() {
super.initGui();
maxRows = (sizeY - 92) / 20;
NetHandlerPlayClient nethandlerplayclient = mc.player.connection;
playerList.clear();
playerList.addAll(NameCache.INSTANCE.getAllNames());
for (NetworkPlayerInfo info : nethandlerplayclient.getPlayerInfoMap()) {
if (!playerList.contains(info.getGameProfile().getName())) {
playerList.add(info.getGameProfile().getName());
}
}
this.txtManual = new GuiBigTextField(this.fontRenderer, guiLeft + sizeX / 2 - 149, guiTop + 33, 198, 18);
this.txtManual.setWatermark("Username");
this.btnManual = new GuiButtonThemed(this.buttonList.size(), guiLeft + sizeX / 2 + 50, guiTop + 32, 100, 20, I18n.format("betterquesting.btn.party_invite"), true);
this.buttonList.add(btnManual);
for (int i = 0; i < maxRows * 3; i++) {
GuiButtonThemed btn = new GuiButtonThemed(this.buttonList.size(), guiLeft + sizeX / 2 - 150 + ((i % 3) * 100), guiTop + 68 + (i / 3 * 20), 100, 20, "Username", true);
this.buttonList.add(btn);
}
RefreshColumns();
}
Aggregations