use of com.enderio.core.client.render.EnderWidget in project EnderIO by SleepyTrousers.
the class GuiInventoryPanel method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int mouseX, int mouseY) {
syncSettingsChange();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
bindGuiTexture();
int sx = guiLeft;
int sy = guiTop;
drawTexturedModalRect(sx + 24, sy, 0, 0, 232, ySize);
drawTexturedModalRect(sx + 24 + 232, sy, 232, 0, 24, 68);
if (craftingHelper != null || getContainer().hasCraftingRecipe()) {
boolean hover = btnRefill.contains(mouseX - sx, mouseY - sy);
int iconX = hover ? (isShiftKeyDown() ? 48 : 24) : 0;
drawTexturedModalRect(sx + btnRefill.x - 2, sy + btnRefill.y - 2, iconX, 232, 24, 24);
}
TileInventoryPanel te = getTileEntity();
int y = sy;
int numStoredRecipes = te.getStoredCraftingRecipes();
if (numStoredRecipes == 1) {
drawTexturedModalRect(sx, y, 227, 225, 28, 30);
y += 30;
} else if (numStoredRecipes > 1) {
drawTexturedModalRect(sx, y, 227, 225, 28, 24);
y += 24;
for (int i = 1; i < numStoredRecipes - 1; i++) {
drawTexturedModalRect(sx, y, 198, 229, 28, 20);
y += 20;
}
drawTexturedModalRect(sx, y, 198, 229, 28, 26);
y += 26;
}
if (numStoredRecipes < TileInventoryPanel.MAX_STORED_CRAFTING_RECIPES && getContainer().hasNewCraftingRecipe()) {
y += 2;
btnAddStoredRecipe.x = 13;
btnAddStoredRecipe.y = y - sy;
btnAddStoredRecipe.width = 12;
btnAddStoredRecipe.height = 14;
boolean hover = btnAddStoredRecipe.contains(mouseX - sx, mouseY - sy);
drawTexturedModalRect(sx + 13, y, 182, hover ? 241 : 225, 15, 14);
} else {
btnAddStoredRecipe.width = 0;
btnAddStoredRecipe.height = 0;
}
SmartTank fuelTank = te.fuelTank;
if (!InvpanelConfig.inventoryPanelFree.get()) {
drawTexturedModalRect(sx + 35, sy + 132, 232, 163, 18, 49);
if (fuelTank.getFluidAmount() > 0) {
RenderUtil.renderGuiTank(fuelTank.getFluid(), fuelTank.getCapacity(), fuelTank.getFluidAmount(), sx + 24 + 12, sy + 133, zLevel, 16, 47);
}
}
final EnderWidget returnButton = te.isExtractionDisabled() ? btnReturnArea.contains(mouseX - sx, mouseY - sy) ? EnderWidget.STOP_BUT_HOVER : EnderWidget.STOP_BUT : btnReturnArea.contains(mouseX - sx, mouseY - sy) ? EnderWidget.RETURN_BUT_HOVER : EnderWidget.RETURN_BUT;
GlStateManager.color(1, 1, 1, 1);
EnderWidget.RETURN_BUT.getMap().render(returnButton, sx + 24 + 7, sy + 72, true);
int headerColor = 0x404040;
int focusedColor = 0x648494;
FontRenderer fr = getFontRenderer();
fr.drawString(headerCrafting, sx + 24 + 7, sy + 6, headerColor);
fr.drawString(te.isExtractionDisabled() ? headerStorage : headerReturn, sx + 24 + 7 + 10, sy + 72, btnReturnArea.contains(mouseX - sx, mouseY - sy) ? focusedColor : headerColor);
fr.drawString(headerInventory, sx + 24 + 38, sy + 120, headerColor);
super.drawGuiContainerBackgroundLayer(par1, mouseX, mouseY);
if (JeiAccessor.isJeiRuntimeAvailable() && btnSync.isSelected()) {
updateFromJEI();
}
view.setDatabase(getDatabase());
view.setItemFilter(te.getItemFilter());
view.updateFilter(tfFilter.getText());
boolean update = view.sortItems();
scrollbar.setScrollMax(Math.max(0, (view.getNumEntries() + GHOST_COLUMNS - 1) / GHOST_COLUMNS - GHOST_ROWS));
if (update || scrollPos != scrollbar.getScrollPos()) {
updateGhostSlots();
}
if (te.isActive()) {
tfFilter.setEnabled(true);
if (!tfFilter.isFocused() && tfFilter.getText().isEmpty()) {
fr.drawString(infoTextFilter, tfFilter.x, tfFilter.y, 0x707070);
}
} else {
tfFilter.setEnabled(false);
setText(tfFilter, "");
fr.drawString(infoTextOffline, tfFilter.x, tfFilter.y, 0x707070);
}
}
use of com.enderio.core.client.render.EnderWidget in project EnderIO by SleepyTrousers.
the class GuiTargetList method getIconBounds.
public Rectangle getIconBounds(int minElY) {
EnderWidget icon = EnderWidget.RETURN_BUT_HOVER;
int xPos = minX + width - icon.width - 2;
if (getContentOverhang() > 0) {
// scroll bar visible
xPos -= 6;
}
Rectangle iconBounds = new Rectangle(xPos, minElY + 1, icon.width, icon.height);
return iconBounds;
}
use of com.enderio.core.client.render.EnderWidget in project EnderIO by SleepyTrousers.
the class GuiTargetList method drawElement.
@Override
protected void drawElement(int elementIndex, int x, int y, int heightIn, @Nonnull BufferBuilder renderer) {
TelepadTarget targ = getElementAt(elementIndex);
String name = targ.getName();
if (name.trim().length() == 0) {
name = Lang.GUI_TELEPAD_UNNAMED_LOCATION.get();
}
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
fr.drawString(name, x + 4, y + 2, 0xffffff, true);
if (getSelectedElement() == targ) {
Rectangle iconBounds = getIconBounds(y);
EnderWidget icon = EnderWidget.X_BUT;
// TODO no access to these vars anymore
// if(iconBounds.contains(mouseX, mouseY)) {
// icon = EnderWidget.X_BUT_HOVER;
// }
EnderWidget.map.render(icon, iconBounds.x, iconBounds.y, iconBounds.width, iconBounds.height, 0, true);
}
}
Aggregations