use of gregtech.api.gui.widgets.tab.IGuiTextureTabInfo 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;
}
use of gregtech.api.gui.widgets.tab.IGuiTextureTabInfo in project GregTech by GregTechCEu.
the class RecipeChartApp method onPagesChanged.
private void onPagesChanged(int oldPage, int newPage) {
ITabInfo tabInfo = tabGroup.getTabInfo(newPage);
if (tabInfo instanceof IGuiTextureTabInfo && ((IGuiTextureTabInfo) tabInfo).texture instanceof TextTexture) {
((TextTexture) ((IGuiTextureTabInfo) tabInfo).texture).setType(TextTexture.TextType.ROLL);
}
tabInfo = tabGroup.getTabInfo(oldPage);
if (tabInfo instanceof IGuiTextureTabInfo && ((IGuiTextureTabInfo) tabInfo).texture instanceof TextTexture) {
((TextTexture) ((IGuiTextureTabInfo) tabInfo).texture).setType(TextTexture.TextType.HIDE);
}
}
use of gregtech.api.gui.widgets.tab.IGuiTextureTabInfo in project GregTech by GregTechCEu.
the class SettingsApp method onPagesChanged.
private void onPagesChanged(int oldPage, int newPage) {
ITabInfo tabInfo = tabGroup.getTabInfo(newPage);
if (tabInfo instanceof IGuiTextureTabInfo && ((IGuiTextureTabInfo) tabInfo).texture instanceof TextTexture) {
((TextTexture) ((IGuiTextureTabInfo) tabInfo).texture).setType(TextTexture.TextType.ROLL);
}
tabInfo = tabGroup.getTabInfo(oldPage);
if (tabInfo instanceof IGuiTextureTabInfo && ((IGuiTextureTabInfo) tabInfo).texture instanceof TextTexture) {
((TextTexture) ((IGuiTextureTabInfo) tabInfo).texture).setType(TextTexture.TextType.HIDE);
}
}
use of gregtech.api.gui.widgets.tab.IGuiTextureTabInfo in project GregTech by GregTechCEu.
the class RecipeChartApp method closeApp.
@Override
public NBTTagCompound closeApp() {
// synced data to server side.
saveLocalConfig(nbt -> {
NBTTagList list = new NBTTagList();
for (int i = 0; i < tabGroup.getAllTag().size(); i++) {
IGuiTextureTabInfo tabInfo = (IGuiTextureTabInfo) tabGroup.getTabInfo(i);
NBTTagCompound container = new NBTTagCompound();
container.setString("name", tabInfo.nameLocale);
container.setTag("data", tabGroup.getTabWidget(i).saveAsNBT());
list.appendTag(container);
}
nbt.setTag("list", list);
nbt.setInteger("focus", tabGroup.getAllTag().indexOf(tabGroup.getCurrentTag()));
});
return super.closeApp();
}
Aggregations