@Override protected void mouseClicked(int xPos, int yPos, int buttonClicked) { super.mouseClicked(xPos, yPos, buttonClicked); if(upButton.intersects(new Rectangle(xPos, yPos, 1, 1))) { if(currentLayer + 1 <= blockList.size() - 1) { currentLayer++; } } if(downButton.intersects(new Rectangle(xPos, yPos, 1, 1))) { if(currentLayer - 1 >= 1) { currentLayer--; } } }
public static GuiScreen buildGui(InventoryPlayer invPlayer, TileEntityIronFurnace invFurnace) { GUI type = values()[invFurnace.getType().ordinal()]; Container container = type.makeContainer(invPlayer, invFurnace); GuiContainerCX gui = new GuiContainerCX(new GuiMoreFurnace(type, invFurnace), container); Rectangle bg = type.texture.getPart("bg"); gui.setSize(bg.getWidth(), bg.getHeight()); return gui; }
@Override public void mouseClicked(int x, int y, int par3) { try { super.mouseClicked(x, y, par3); } catch (IOException e) { e.printStackTrace(); } x-=guiLeft; y-=guiTop; if(!isFilterVisible()) { return; } int filterX = 59; int filterY = 63; Rectangle filterBounds = new Rectangle(filterX, filterY, 90, 18); if(!filterBounds.contains(x, y)) { return; } ItemStack st = CrystalMod.proxy.getClientPlayer().inventory.getItemStack(); FluidFilter filter = getFilter(); if(filter == null && ItemStackTools.isNullStack(st)) { return; } if(filter == null) { filter = new FluidFilter(); } int slot = (x - filterX) / 18; if(slot < 5 && slot >= 0){ ModLogger.info(slot+" "+(FluidUtil.getFluidTypeFromItem(st) !=null ? FluidUtil.getFluidTypeFromItem(st).getLocalizedName() : "")); filter.setFluid(slot, st); updateFilter(filter); } }
@Override public void initGui() { super.initGui(); upButton = new Rectangle((width - xSize) / 2 + 70, (height - ySize) / 2 + 75, 13, 13); downButton = new Rectangle((width - xSize) / 2 + 70, (height - ySize) / 2 + 92, 13, 13); tooltip = new Rectangle((width - xSize) / 2 + 30, (height - ySize) / 2 + 82, 16, 16); }
public UIButton(UIElement linkedElement, int posX, int posY, int width, int height, int textureID) { this.linkedElement = linkedElement; this.posX = posX; this.posY = posY; this.width = width; this.height = height; this.textureID = textureID; this.collisionBox = new Rectangle(posX,posY,width,height); }
public UIButton(UiButtonAction uiButtonAction, int posX, int posY, int width, int height, int textureID, EntityController entityController) { this.uiButtonAction = uiButtonAction; this.posX = posX; this.posY = posY; this.width = width; this.height = height; this.textureID = textureID; this.collisionBox = new Rectangle(posX,posY,width,height); this.entityController = entityController; }
public GuiWindow(Vector2f position, Vector2f dimension, String name, Gui gui) { this.position = position; this.dimension = dimension; this.closeRectangle = new Rectangle((int)position.x + (int)dimension.x - 28, (int)position.y, 28, 19); this.windowRectangle = new Rectangle((int)position.x , (int)position.y, (int)dimension.x, (int)dimension.y); this.name = name; this.guiWindowElements = new ArrayList<GuiWindowElement>(); this.gui = gui; }
public GuiWindowElement(int textureID, Vector2f position, Vector2f dimension, boolean clickable) { this.textureID = textureID; this.position = position; this.dimension = dimension; this.rectangle = new Rectangle((int)position.x, (int)position.y, (int)dimension.x / 2, (int)dimension.y / 2); this.clickable = clickable; }
public void setValues(int size, Vector2f tileWidthHeight, Vector2f screenWidthHeight) { this.size = size; this.tilewidth = (int)tileWidthHeight.x; this.tileheight = (int)tileWidthHeight.y; this.width = (int)screenWidthHeight.x; this.height = (int)screenWidthHeight.y; rectangle = new Rectangle((int)position.x, (int)position.y, width, height); }
@Override public Rectangle needsSlot() { return null; }
@Override public Rectangle needsSlot() { return coordinateSensor.needsSlot(); }
private void updateCollisionBox(){ this.collisionBox = new Rectangle(posX,posY,width,height); }
public Rectangle getCollisionBox() { return collisionBox; }
public Rectangle getRectangle() { return rectangle; }
public void setRectangle(Rectangle rectangle) { this.rectangle = rectangle; }
@Override public Rectangle needsSlot(){ return null; }