Search in sources :

Example 1 with RGContainer

use of gregtech.common.terminal.app.recipechart.widget.RGContainer in project GregTech by GregTechCEu.

the class RecipeChartApp method addTab.

private RGContainer addTab(String name) {
    name = name.isEmpty() ? "default" : name;
    RGContainer container = new RGContainer(0, 0, 333, 222, getOs());
    container.setBackground(TerminalTheme.COLOR_B_3);
    tabGroup.addTab(new IGuiTextureTabInfo(new TextTexture(name, -1).setWidth(333 / getMaxPages() - 5).setType(tabGroup.getAllTag().isEmpty() ? TextTexture.TextType.ROLL : TextTexture.TextType.HIDE), name), container);
    return container;
}
Also used : TextTexture(gregtech.api.gui.resources.TextTexture) IGuiTextureTabInfo(gregtech.api.gui.widgets.tab.IGuiTextureTabInfo) RGContainer(gregtech.common.terminal.app.recipechart.widget.RGContainer)

Example 2 with RGContainer

use of gregtech.common.terminal.app.recipechart.widget.RGContainer in project GregTech by GregTechCEu.

the class RecipeChartApp method onOSSizeUpdate.

@Override
public void onOSSizeUpdate(int width, int height) {
    this.setSize(new Size(width, height));
    if (tabGroup != null) {
        Size size = new Size(width, height - 10);
        for (Widget widget : tabGroup.widgets) {
            if (widget instanceof RGContainer) {
                widget.setSize(size);
            }
        }
        tabGroup.setSize(size);
    }
}
Also used : Size(gregtech.api.util.Size) IRecipeTransferHandlerWidget(gregtech.api.gui.ingredient.IRecipeTransferHandlerWidget) TerminalDialogWidget(gregtech.api.terminal.os.TerminalDialogWidget) Widget(gregtech.api.gui.Widget) RGContainer(gregtech.common.terminal.app.recipechart.widget.RGContainer)

Aggregations

RGContainer (gregtech.common.terminal.app.recipechart.widget.RGContainer)2 Widget (gregtech.api.gui.Widget)1 IRecipeTransferHandlerWidget (gregtech.api.gui.ingredient.IRecipeTransferHandlerWidget)1 TextTexture (gregtech.api.gui.resources.TextTexture)1 IGuiTextureTabInfo (gregtech.api.gui.widgets.tab.IGuiTextureTabInfo)1 TerminalDialogWidget (gregtech.api.terminal.os.TerminalDialogWidget)1 Size (gregtech.api.util.Size)1