@Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { Object texture = CraftGUITexture.STATE_WARNING; if (this.errorState == null) { texture = CraftGUITexture.STATE_NONE; } else if (this.type == 0) { texture = CraftGUITexture.STATE_ERROR; } CraftGUI.RENDER.texture(texture, Point.ZERO); super.onRenderBackground(guiWidth, guiHeight); }
@Override @SideOnly(Side.CLIENT) public void onUpdateClient() { super.onUpdateClient(); this.itemDisplay.setFluidStack(this.getFluidStack()); }
final int width = 108; final int height = 2 + 18 * (1 + (slotIds.size() - 1) / 6); this.slotGrid.deleteAllChildren(); this.slotGrid.setSize(new Point(width, height)); for (final int k : slotIds.keySet()) { new ControlSlot.Builder(this.slotGrid, x, y).assign(k);
@SideOnly(Side.CLIENT) public void updatePages(boolean systemChange) { int oldLeft = -1; int oldRight = -1; if (!systemChange) { oldLeft = analystPages.indexOf(leftPage.getContent()); oldRight = analystPages.indexOf(rightPage.getContent()); } ITitledWidget databasePage = null; if (isDatabase && !systemChange) { databasePage = ((analystPages.size() > 0) ? analystPages.get(0) : null); } analystPages.clear(); setPage(leftPage, null); setPage(rightPage, null); createPages(databasePage); tabBar.deleteAllChildren(); if (analystPages.size() > 0) { int width = tabBar.getWidth() / analystPages.size(); int x = 0; for (ITitledWidget page : analystPages) { new ControlAnalystButton(tabBar, x, 0, width, tabBar.getHeight(), this, page); x += width; } setPage(leftPage, analystPages.get((oldLeft >= 0) ? oldLeft : 0)); if (analystPages.size() > 1) { setPage(rightPage, analystPages.get((oldRight >= 0) ? oldRight : 1)); } } }
new ControlText(this, new Area(0, 4, w, 16), I18N.localise(DatabaseConstants.BOTANY_GENOME_KEY + ".title"), TextJustification.MIDDLE_CENTER); ControlScrollableContent scrollable = new ControlScrollableContent(this, 4, 20, w - 8, h - 8 - 16, 12); Control contents = new Control(scrollable, 0, 0, w - 8 - 12, h - 8 - 16); int tw = w - 8 - 12; int w2 = 55; new ControlText(contents, new Area(0, y - (numOfLines - 1) * 18, w2, 4 + 18 * numOfLines), I18N.localise(DatabaseConstants.BOTANY_GENOME_KEY + ".varieties"), TextJustification.MIDDLE_RIGHT); y += th; contents.setSize(new Point(contents.getSize().xPos(), y)); scrollable.setScrollableContent(contents);
final int compartmentWidth = compartmentPageWidth + (doubleTabbed ? 48 : 24); final int compartmentHeight = compartmentPageHeight; final Control controlCompartment = new Control(this, x, y, compartmentWidth, compartmentHeight); final ControlTabBar<Integer> tab = new ControlTabBar<>(controlCompartment, 0, 0, 24, compartmentPageHeight, Alignment.LEFT, Arrays.asList(tabs1), (x1, y1, w, h, value) -> { return new CompartmentTabIcon(this, x1, y1, w, h, value); controlCompartment.setPosition(new Point((this.getWidth() - controlCompartment.getWidth()) / 2, controlCompartment.getYPos())); final ControlPlayerInventory invent = new ControlPlayerInventory(this, true); final ControlSlide slide = new ControlSlide(this, 0, 134, 136, 92, Alignment.LEFT);
public SearchDialog(WindowCompartment windowCompartment) { super(windowCompartment, 252, 192); this.windowCompartment = windowCompartment; final ControlScrollableContent<IWidget> scroll = new SearchScrollContent(this); this.slotGrid = new Control(scroll, 1, 1, 108, 18); scroll.setScrollableContent(this.slotGrid); new ControlPlayerInventory(this, true); new ControlTextEdit(this, 16, 16, 100, 14).addEventHandler(EventTextEdit.class, event -> { textSearch = event.getValue(); updateSearch(); }); this.includeItems = true; this.includeBlocks = true; new SortAlphabeticalCheckbox(this); new IncludeItemsCheckbox(this); new IncludeBlocksCheckbox(this); this.updateSearch(); }
@Override @SideOnly(Side.CLIENT) public void getTooltip(Tooltip tooltip, ITooltipFlag tooltipFlag) { super.getTooltip(tooltip, tooltipFlag); tooltip.add(value.getColorName()); } }
new ControlText(this, new Area(0, 4, w, 16), this.getValue().toString(), TextJustification.MIDDLE_CENTER); final ControlScrollableContent scrollable = new ControlScrollableContent(this, 4, 20, w - 8, h - 8 - 16, 12); final Control contents = new Control(scrollable, 0, 0, w - 8 - 12, h - 8 - 16); final int tw = w - 8 - 12; final int w2 = 65; new ControlText(contents, new Area(w2, y, w3, th), genome.getGirth() + "x" + genome.getGirth(), TextJustification.MIDDLE_LEFT); y += th; contents.setSize(new Point(contents.getSize().xPos(), y)); scrollable.setScrollableContent(contents);
setupValidators(); tabBar = new Control(this, x, 28, getWidth() - 16 - x, 20); analystPanel = new AnalystPanel(this); if (!isDatabase) {
@Override @SideOnly(Side.CLIENT) public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) { if (this.hasTooltip && !this.itemStack.isEmpty()) { List<String> itemStackTooltip = this.itemStack.getTooltip(((Window) this.getTopParent()).getPlayer(), tooltipFlag); tooltip.add(itemStackTooltip); tooltip.setItemStack(this.itemStack); } super.getTooltip(tooltip, tooltipFlag); }
@Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { super.onRenderBackground(guiWidth, guiHeight); boolean selected = isMouseOver(); Texture text = selected ? this.selected : texture; CraftGUI.RENDER.texture(text, Point.ZERO); }
@Override @SideOnly(Side.CLIENT) public void onUpdateClient() { super.onUpdateClient(); this.itemDisplay.setItemStack(this.getItemStack()); }
@Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { super.onRenderBackground(guiWidth, guiHeight); if (this.type == 0) { CraftGUI.RENDER.texture(ControlMutationSymbol.MutationPlus, Point.ZERO); } else { CraftGUI.RENDER.texture(ControlMutationSymbol.MutationArrow, Point.ZERO); } }
@Override @SideOnly(Side.CLIENT) public void onUpdateClient() { super.onUpdateClient(); final TileEntityMachine tile = (TileEntityMachine) Window.get(this).getInventory(); if (tile == null) { return; } ComponentDesignerRecipe recipe = tile.getMachine().getComponent(ComponentDesignerRecipe.class); this.setValue(recipe.getDesign()); }
@Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { if (breedingSystem == null) { return; } super.onRenderBackground(guiWidth, guiHeight); ITexture texture = getTypeTexture(); CraftGUI.RENDER.texture(texture, Point.ZERO); }
@Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { super.onRenderBackground(guiWidth, guiHeight); if (type == 0) { CraftGUI.RENDER.texture(ControlColorMixSymbol.MUTATION_PLUS, Point.ZERO); } else { CraftGUI.RENDER.texture(ControlColorMixSymbol.MUTATION_ARROW, Point.ZERO); } }
@Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { super.onRenderBackground(guiWidth, guiHeight); CraftGUI.RENDER.texture(isHomozygous() ? HOMOZYGOUS : HETEROZYGOUS, Point.ZERO); }
@Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { super.onRenderBackground(guiWidth, guiHeight); RenderUtil.drawGradientRect(this.getArea(), -16777216 + this.value.getColor(), -16777216 + this.value.getColor()); } }
@Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { boolean active = value == window.getLeftPage().getContent() || value == window.getRightPage().getContent(); RenderUtil.setColour((active ? -16777216 : 1140850688) + value.getColor()); GlStateManager.pushMatrix(); GlStateManager.enableBlend(); CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().inset(1)); GlStateManager.disableBlend(); GlStateManager.popMatrix(); RenderUtil.setColour(value.getColor()); CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea().inset(1)); super.onRenderBackground(guiWidth, guiHeight); } }