Search in sources :

Example 1 with GuiNoParty

use of betterquesting.client.gui.party.GuiNoParty in project BetterQuesting by Funwayguy.

the class GuiHome method onButtonPress.

private void onButtonPress(PEventButton event) {
    Minecraft mc = Minecraft.getMinecraft();
    IPanelButton btn = event.getButton();
    if (// Exit
    btn.getButtonID() == 0) {
        mc.displayGuiScreen(this.parent);
    } else if (// Quests
    btn.getButtonID() == 1) {
        mc.displayGuiScreen(new GuiQuestLines(this));
    } else if (// Party
    btn.getButtonID() == 2) {
        IParty party = PartyManager.INSTANCE.getUserParty(QuestingAPI.getQuestingUUID(mc.player));
        if (party != null) {
            mc.displayGuiScreen(new GuiManageParty(this, party));
        } else {
            mc.displayGuiScreen(new GuiNoParty(this));
        }
    } else if (// Theme
    btn.getButtonID() == 3) {
        mc.displayGuiScreen(new GuiThemes(this));
    } else if (// Editor
    btn.getButtonID() == 4) {
        mc.displayGuiScreen(new GuiJsonEditor(this, QuestSettings.INSTANCE.writeToNBT(new NBTTagCompound(), EnumSaveType.CONFIG), null, (NBTTagCompound value) -> {
            QuestSettings.INSTANCE.readFromNBT(value, EnumSaveType.CONFIG);
            PacketSender.INSTANCE.sendToServer(QuestSettings.INSTANCE.getSyncPacket());
        }));
    }
}
Also used : IPanelButton(betterquesting.api2.client.gui.controls.IPanelButton) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) IParty(betterquesting.api.questing.party.IParty) Minecraft(net.minecraft.client.Minecraft) GuiJsonEditor(betterquesting.client.gui.editors.json.scrolling.GuiJsonEditor) GuiManageParty(betterquesting.client.gui.party.GuiManageParty) GuiNoParty(betterquesting.client.gui.party.GuiNoParty)

Aggregations

IParty (betterquesting.api.questing.party.IParty)1 IPanelButton (betterquesting.api2.client.gui.controls.IPanelButton)1 GuiJsonEditor (betterquesting.client.gui.editors.json.scrolling.GuiJsonEditor)1 GuiManageParty (betterquesting.client.gui.party.GuiManageParty)1 GuiNoParty (betterquesting.client.gui.party.GuiNoParty)1 Minecraft (net.minecraft.client.Minecraft)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1