Search in sources :

Example 1 with ButtonPrev

use of amerifrance.guideapi.button.ButtonPrev in project Guide-API by TeamAmeriFrance.

the class GuiHome method initGui.

@Override
public void initGui() {
    this.buttonList.clear();
    this.categoryWrapperMap.clear();
    guiLeft = (this.width - this.xSize) / 2;
    guiTop = (this.height - this.ySize) / 2;
    addButton(buttonNext = new ButtonNext(0, guiLeft + 4 * xSize / 6, guiTop + 5 * ySize / 6, this));
    addButton(buttonPrev = new ButtonPrev(1, guiLeft + xSize / 5, guiTop + 5 * ySize / 6, this));
    addButton(buttonSearch = new ButtonSearch(2, guiLeft + xSize / 6, guiTop, this));
    int cX = guiLeft + 45;
    int cY = guiTop + 40;
    int drawLoc = 0;
    int i = 0;
    int pageNumber = 0;
    for (CategoryAbstract category : book.getCategoryList()) {
        category.onInit(book, this, player, bookStack);
        switch(drawLoc) {
            case 0:
                {
                    categoryWrapperMap.put(pageNumber, new CategoryWrapper(book, category, cX, cY, 23, 23, player, this.fontRenderer, itemRender, false, bookStack));
                    cX += 27;
                    drawLoc = 1;
                    break;
                }
            case 1:
                {
                    categoryWrapperMap.put(pageNumber, new CategoryWrapper(book, category, cX, cY, 23, 23, player, this.fontRenderer, itemRender, false, bookStack));
                    cX += 27;
                    drawLoc = 2;
                    break;
                }
            case 2:
                {
                    categoryWrapperMap.put(pageNumber, new CategoryWrapper(book, category, cX, cY, 23, 23, player, this.fontRenderer, itemRender, false, bookStack));
                    cX += 27;
                    drawLoc = 3;
                    break;
                }
            case 3:
                {
                    categoryWrapperMap.put(pageNumber, new CategoryWrapper(book, category, cX, cY, 23, 23, player, this.fontRenderer, itemRender, false, bookStack));
                    drawLoc = 0;
                    cX = guiLeft + 45;
                    cY += 30;
                    break;
                }
        }
        i++;
        if (i >= 16) {
            i = 0;
            cX = guiLeft + 45;
            cY = guiTop + 40;
            pageNumber++;
        }
    }
}
Also used : ButtonSearch(amerifrance.guideapi.button.ButtonSearch) CategoryWrapper(amerifrance.guideapi.wrapper.CategoryWrapper) CategoryAbstract(amerifrance.guideapi.api.impl.abstraction.CategoryAbstract) ButtonPrev(amerifrance.guideapi.button.ButtonPrev) ButtonNext(amerifrance.guideapi.button.ButtonNext)

Example 2 with ButtonPrev

use of amerifrance.guideapi.button.ButtonPrev in project Guide-API by TeamAmeriFrance.

the class GuiEntry method initGui.

@Override
public void initGui() {
    super.initGui();
    entry.onInit(book, category, null, player, bookStack);
    this.buttonList.clear();
    this.pageWrapperList.clear();
    guiLeft = (this.width - this.xSize) / 2;
    guiTop = (this.height - this.ySize) / 2;
    this.buttonList.add(buttonBack = new ButtonBack(0, guiLeft + xSize / 6, guiTop, this));
    this.buttonList.add(buttonNext = new ButtonNext(1, guiLeft + 4 * xSize / 6, guiTop + 5 * ySize / 6, this));
    this.buttonList.add(buttonPrev = new ButtonPrev(2, guiLeft + xSize / 5, guiTop + 5 * ySize / 6, this));
    for (IPage page : this.entry.pageList) {
        page.onInit(book, category, entry, player, bookStack, this);
        pageWrapperList.add(new PageWrapper(this, book, category, entry, page, guiLeft, guiTop, player, this.fontRenderer, bookStack));
    }
}
Also used : ButtonBack(amerifrance.guideapi.button.ButtonBack) IPage(amerifrance.guideapi.api.IPage) PageWrapper(amerifrance.guideapi.wrapper.PageWrapper) ButtonPrev(amerifrance.guideapi.button.ButtonPrev) ButtonNext(amerifrance.guideapi.button.ButtonNext)

Example 3 with ButtonPrev

use of amerifrance.guideapi.button.ButtonPrev in project Guide-API by TeamAmeriFrance.

the class GuiCategory method initGui.

@Override
public void initGui() {
    super.initGui();
    this.buttonList.clear();
    this.entryWrapperMap.clear();
    guiLeft = (this.width - this.xSize) / 2;
    guiTop = (this.height - this.ySize) / 2;
    this.buttonList.add(buttonBack = new ButtonBack(0, guiLeft + xSize / 6, guiTop, this));
    this.buttonList.add(buttonNext = new ButtonNext(1, guiLeft + 4 * xSize / 6, guiTop + 5 * ySize / 6, this));
    this.buttonList.add(buttonPrev = new ButtonPrev(2, guiLeft + xSize / 5, guiTop + 5 * ySize / 6, this));
    int eX = guiLeft + 37;
    int eY = guiTop + 15;
    int i = 0;
    int pageNumber = 0;
    List<EntryAbstract> entries = Lists.newArrayList(category.entries.values());
    for (EntryAbstract entry : entries) {
        entry.onInit(book, category, this, player, bookStack);
        entryWrapperMap.put(pageNumber, new EntryWrapper(this, book, category, entry, eX, eY, 4 * xSize / 6, 10, player, this.fontRenderer, bookStack));
        eY += 13;
        i++;
        if (i >= 11) {
            i = 0;
            eY = guiTop + 15;
            pageNumber++;
        }
    }
}
Also used : ButtonBack(amerifrance.guideapi.button.ButtonBack) EntryAbstract(amerifrance.guideapi.api.impl.abstraction.EntryAbstract) EntryWrapper(amerifrance.guideapi.wrapper.EntryWrapper) ButtonPrev(amerifrance.guideapi.button.ButtonPrev) ButtonNext(amerifrance.guideapi.button.ButtonNext)

Example 4 with ButtonPrev

use of amerifrance.guideapi.button.ButtonPrev in project Guide-API by TeamAmeriFrance.

the class GuiSearch method initGui.

@Override
public void initGui() {
    buttonList.clear();
    guiLeft = (this.width - this.xSize) / 2;
    guiTop = (this.height - this.ySize) / 2;
    addButton(new ButtonBack(0, guiLeft + xSize / 6, guiTop, this));
    addButton(buttonNext = new ButtonNext(1, guiLeft + 4 * xSize / 6, guiTop + 5 * ySize / 6, this));
    addButton(buttonPrev = new ButtonPrev(2, guiLeft + xSize / 5, guiTop + 5 * ySize / 6, this));
    searchField = new GuiTextField(3, fontRenderer, guiLeft + 43, guiTop + 12, 100, 10);
    searchField.setEnableBackgroundDrawing(false);
    searchResults = getMatches(book, null, player, bookStack);
}
Also used : ButtonBack(amerifrance.guideapi.button.ButtonBack) ButtonPrev(amerifrance.guideapi.button.ButtonPrev) ButtonNext(amerifrance.guideapi.button.ButtonNext)

Aggregations

ButtonNext (amerifrance.guideapi.button.ButtonNext)4 ButtonPrev (amerifrance.guideapi.button.ButtonPrev)4 ButtonBack (amerifrance.guideapi.button.ButtonBack)3 IPage (amerifrance.guideapi.api.IPage)1 CategoryAbstract (amerifrance.guideapi.api.impl.abstraction.CategoryAbstract)1 EntryAbstract (amerifrance.guideapi.api.impl.abstraction.EntryAbstract)1 ButtonSearch (amerifrance.guideapi.button.ButtonSearch)1 CategoryWrapper (amerifrance.guideapi.wrapper.CategoryWrapper)1 EntryWrapper (amerifrance.guideapi.wrapper.EntryWrapper)1 PageWrapper (amerifrance.guideapi.wrapper.PageWrapper)1