Search in sources :

Example 16 with GuiButtonThemed

use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.

the class GuiJsonItemSelection method initGui.

@Override
public void initGui() {
    super.initGui();
    this.searchBox = new GuiBigTextField(this.fontRenderer, guiLeft + sizeX / 2 + 9, guiTop + 33, sizeX / 2 - 26, 14);
    this.searchBox.setWatermark(I18n.format("betterquesting.gui.search"));
    this.searchBox.setMaxStringLength(Integer.MAX_VALUE);
    this.itemGrid = new GuiScrollingItemGrid(mc, guiLeft + sizeX / 2 + 8, guiTop + 48, sizeX / 2 - 24, sizeY - 80);
    this.embedded.add(itemGrid);
    numberBox = new GuiNumberField(fontRenderer, guiLeft + 77, guiTop + 49, 98, 14);
    if (stackSelect != null) {
        numberBox.setText("" + stackSelect.stackSize);
    }
    searching = Item.REGISTRY.iterator();
    btnOreDict = new GuiButtonThemed(3, guiLeft + 76, guiTop + 64, 100, 20, "OreDict: " + (stackSelect.oreDict.length() <= 0 ? "NONE" : stackSelect.oreDict), true);
    this.buttonList.add(btnOreDict);
}
Also used : GuiScrollingItemGrid(betterquesting.client.gui.editors.json.scrolling.GuiScrollingItemGrid) GuiNumberField(betterquesting.api.client.gui.controls.GuiNumberField) GuiBigTextField(betterquesting.api.client.gui.controls.GuiBigTextField) GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed)

Example 17 with GuiButtonThemed

use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.

the class GuiJsonTypeMenu method initGui.

@Override
public void initGui() {
    super.initGui();
    fluid = null;
    stack = null;
    entity = null;
    if (json != null) {
        if (// Must have at least these 3 to be considered a valid 'item'
        JsonHelper.isItem(json)) {
            stack = JsonHelper.JsonToItemStack(json);
        }
        if (stack == null && JsonHelper.isEntity(json)) {
            entity = EntityList.createEntityFromNBT(json, Minecraft.getMinecraft().world);
        }
        if (stack == null && entity == null && JsonHelper.isFluid(json)) {
            fluid = JsonHelper.JsonToFluidStack(json);
        }
    } else // JSON cannot be null!
    {
        this.mc.displayGuiScreen(parent);
        return;
    }
    if (stack == null) {
        stack = new BigItemStack(Blocks.STONE);
    }
    if (entity == null) {
        entity = new EntityPig(Minecraft.getMinecraft().world);
    }
    if (fluid == null) {
        fluid = new FluidStack(FluidRegistry.WATER, 1000);
    }
    if (lastType == EditType.ITEM) {
        JsonHelper.ClearCompoundTag(json);
        JsonHelper.ItemStackToJson(stack, json);
    } else if (lastType == EditType.FLUID) {
        JsonHelper.ClearCompoundTag(json);
        JsonHelper.FluidStackToJson(fluid, json);
    } else if (lastType == EditType.ENTITY) {
        JsonHelper.ClearCompoundTag(json);
        JsonHelper.EntityToJson(entity, json);
    }
    if (lastType != EditType.NONE) {
        mc.displayGuiScreen(parent);
    }
    // JSON Editor
    GuiButtonThemed editButton = new GuiButtonThemed(3, this.width / 2 - 100, this.height / 2 - 40, 200, 20, I18n.format("betterquesting.btn.raw_nbt"), true);
    // Item Selector
    GuiButtonThemed itemButton = new GuiButtonThemed(1, this.width / 2 - 100, this.height / 2 - 20, 200, 20, I18n.format("betterquesting.btn.item"), true);
    // Fluid Editor
    GuiButtonThemed fluidButton = new GuiButtonThemed(4, this.width / 2 - 100, this.height / 2 + 00, 200, 20, I18n.format("betterquesting.btn.fluid"), true);
    // Entity Selector
    GuiButtonThemed entityButton = new GuiButtonThemed(2, this.width / 2 - 100, this.height / 2 + 20, 200, 20, I18n.format("betterquesting.btn.entity"), true);
    this.buttonList.add(itemButton);
    this.buttonList.add(entityButton);
    this.buttonList.add(editButton);
    this.buttonList.add(fluidButton);
    itemCallback = new JsonItemCallback(json, stack);
    fluidCallback = new JsonFluidCallback(json, fluid);
    entityCallback = new JsonEntityCallback(json, entity);
}
Also used : EntityPig(net.minecraft.entity.passive.EntityPig) FluidStack(net.minecraftforge.fluids.FluidStack) JsonEntityCallback(betterquesting.client.gui.editors.json.callback.JsonEntityCallback) GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed) BigItemStack(betterquesting.api.utils.BigItemStack) JsonFluidCallback(betterquesting.client.gui.editors.json.callback.JsonFluidCallback) JsonItemCallback(betterquesting.client.gui.editors.json.callback.JsonItemCallback)

Example 18 with GuiButtonThemed

use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.

the class GuiScreenThemed method initGui.

@Override
public void initGui() {
    super.initGui();
    embedded.clear();
    // The minimum distance between the UI and the window edge
    int border = 8;
    this.sizeX = this.width - border * 2;
    this.sizeY = this.height - border * 2;
    this.sizeX = mxX <= 0 ? sizeX : Math.min(mxX, sizeX);
    this.sizeY = mxY <= 0 ? sizeY : Math.min(mxY, sizeY);
    this.sizeX = this.sizeX - (this.sizeX % 16);
    this.sizeY = this.sizeY - (this.sizeY % 16);
    this.guiLeft = (this.width - this.sizeX) / 2;
    this.guiTop = (this.height - this.sizeY) / 2;
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();
    this.buttonList.add(new GuiButtonThemed(0, guiLeft + sizeX / 2 - 100, guiTop + sizeY - 16, 200, 20, I18n.format("gui.done"), true));
}
Also used : GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed)

Example 19 with GuiButtonThemed

use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.

the class GuiQuestingHelp method initGui.

@Override
public void initGui() {
    super.initGui();
    maxRows = (sizeY - 64) / 20;
    for (int i = 0; i < maxRows; i++) {
        buttonList.add(new GuiButtonThemed(i + 1, guiLeft + 16, guiTop + 32 + i * 20, 100, 20, "NULL", true));
    }
    curPage = new GuiScrollingText(mc, guiLeft + 124, guiTop + 32, sizeX - 148, sizeY - 64, "");
    this.embedded.add(curPage);
    RefreshColumns();
}
Also used : GuiScrollingText(betterquesting.api.client.gui.lists.GuiScrollingText) GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed)

Example 20 with GuiButtonThemed

use of betterquesting.api.client.gui.controls.GuiButtonThemed in project BetterQuesting by Funwayguy.

the class GuiManageParty method initGui.

@Override
public void initGui() {
    super.initGui();
    if (party == null) {
        mc.displayGuiScreen(new GuiNoParty(parent));
        return;
    }
    UUID playerID = QuestingAPI.getQuestingUUID(mc.player);
    status = NameCache.INSTANCE.isOP(playerID) ? EnumPartyStatus.OWNER : party.getStatus(playerID);
    heart = new ItemStack(BetterQuesting.extraLife);
    lives = LifeDatabase.INSTANCE.getLives(playerID);
    memList = party.getMembers();
    setTitle(I18n.format("betterquesting.title.party", party.getName()));
    rightScroll = 0;
    maxRows = (sizeY - 72) / 20;
    this.buttonList.add(new GuiButtonThemed(1, guiLeft + sizeX / 4 - 75, height / 2 + 40, 70, 20, I18n.format("betterquesting.btn.party_leave"), true));
    GuiButtonThemed lifeBtn = new GuiButtonThemed(3, guiLeft + sizeX / 4 - 75, height / 2, 150, 20, I18n.format("betterquesting.btn.party_share_lives") + ": " + party.getProperties().getProperty(NativeProps.PARTY_LIVES), true);
    lifeBtn.enabled = status.ordinal() >= 3;
    this.buttonList.add(lifeBtn);
    GuiButtonThemed invBtn = new GuiButtonThemed(4, guiLeft + sizeX / 4 + 5, height / 2 + 40, 70, 20, I18n.format("betterquesting.btn.party_invite"), true);
    invBtn.enabled = status.ordinal() >= 2;
    this.buttonList.add(invBtn);
    fieldName = new GuiTextField(0, mc.fontRenderer, guiLeft + sizeX / 4 - 74, height / 2 - 59, 148, 18);
    fieldName.setText(party.getName());
    fieldName.setEnabled(status.ordinal() >= 3);
    // Quest Line - Main
    for (int i = 0; i < maxRows; i++) {
        GuiButtonThemed btn = new GuiButtonThemed(this.buttonList.size() + 1, guiLeft + sizeX - 74, guiTop + 48 + (i * 20), 50, 20, I18n.format("betterquesting.btn.party_kick"), true);
        this.buttonList.add(btn);
    }
    RefreshColumns();
}
Also used : GuiButtonThemed(betterquesting.api.client.gui.controls.GuiButtonThemed) UUID(java.util.UUID) ItemStack(net.minecraft.item.ItemStack) GuiTextField(net.minecraft.client.gui.GuiTextField)

Aggregations

GuiButtonThemed (betterquesting.api.client.gui.controls.GuiButtonThemed)32 GuiBigTextField (betterquesting.api.client.gui.controls.GuiBigTextField)7 GuiTextField (net.minecraft.client.gui.GuiTextField)5 GuiScrollingButtons (betterquesting.api.client.gui.lists.GuiScrollingButtons)4 IQuest (betterquesting.api.questing.IQuest)3 UUID (java.util.UUID)3 GuiButtonStorage (betterquesting.api.client.gui.controls.GuiButtonStorage)2 GuiNumberField (betterquesting.api.client.gui.controls.GuiNumberField)2 GuiScrollingText (betterquesting.api.client.gui.lists.GuiScrollingText)2 IImporter (betterquesting.api.client.importers.IImporter)2 ItemStack (net.minecraft.item.ItemStack)2 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 QuestLineButtonTree (betterquesting.api.client.gui.QuestLineButtonTree)1 GuiButtonJson (betterquesting.api.client.gui.controls.GuiButtonJson)1 IToolboxTab (betterquesting.api.client.toolbox.IToolboxTab)1 IQuestLine (betterquesting.api.questing.IQuestLine)1 IParty (betterquesting.api.questing.party.IParty)1 BigItemStack (betterquesting.api.utils.BigItemStack)1 GuiQuestLinesEmbedded (betterquesting.client.gui.GuiQuestLinesEmbedded)1 TextCallbackJsonArray (betterquesting.client.gui.editors.json.TextCallbackJsonArray)1