use of betterquesting.client.gui.editors.GuiQuestEditor in project BetterQuesting by Funwayguy.
the class GuiQuest method onButtonPress.
private void onButtonPress(PEventButton event) {
IPanelButton btn = event.getButton();
if (// Exit
btn.getButtonID() == 0) {
mc.displayGuiScreen(this.parent);
} else if (// Edit
btn.getButtonID() == 1) {
mc.displayGuiScreen(new GuiQuestEditor(this, quest));
} else if (// Reward previous
btn.getButtonID() == 2) {
rewardIndex = MathHelper.clamp(rewardIndex - 1, 0, quest.getRewards().size() - 1);
refreshRewardPanel();
} else if (// Reward next
btn.getButtonID() == 3) {
rewardIndex = MathHelper.clamp(rewardIndex + 1, 0, quest.getRewards().size() - 1);
refreshRewardPanel();
} else if (// Task previous
btn.getButtonID() == 4) {
taskIndex = MathHelper.clamp(taskIndex - 1, 0, quest.getTasks().size() - 1);
refreshTaskPanel();
} else if (// Task next
btn.getButtonID() == 5) {
taskIndex = MathHelper.clamp(taskIndex + 1, 0, quest.getTasks().size() - 1);
refreshTaskPanel();
} else if (// Reward claim
btn.getButtonID() == 6) {
NBTTagCompound tags = new NBTTagCompound();
tags.setInteger("questID", QuestDatabase.INSTANCE.getKey(quest));
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.CLAIM.GetLocation(), tags));
} else if (// Task detect/submit
btn.getButtonID() == 7) {
NBTTagCompound tags = new NBTTagCompound();
tags.setInteger("questID", QuestDatabase.INSTANCE.getKey(quest));
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.DETECT.GetLocation(), tags));
}
}
Aggregations