Skip to content

Commit

Permalink
Minor Crafting ui changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Infer4Y committed Aug 19, 2019
1 parent 33f1ba9 commit a022e11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 12 additions & 3 deletions src/main/java/client/renderables/CraftingUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,18 @@ public CraftingUI(){
}

public void draw(Graphics2D g){
g.setColor(new Color(0x9D7F41BF, true));
g.fillRect( 16-4, 64-4,7 * 36+4, 7 * 36 + 10);
g.setColor(new Color(0xED646668, true));
g.fillRoundRect( 18, 6 * 36 + 64,6 * 36 + 28, 38,4,4);
for (int i = 0; i < craftingSlots.length; i++) {
for (int j = 0; j < craftingSlots[i].length; j++) {
try {
craftingSlots[i][j].draw((Graphics) g, j * 36 + 16, i * 36 + 64, craftingSlots[i][j].getRectangle().contains(loc));
if (craftingSlots[i][j].getRectangle().contains(loc)) {
g.setColor(new Color(0xFF00D5));
g.setColor(new Color(0x98ACFF));
g.setFont(new Font(null, Font.BOLD, 24));
g.drawString(craftingSlots[i][j].getItemStack().getItem().getName(), 4 * 36 + 4, 64);
g.drawString(craftingSlots[i][j].getItemStack().getItem().getName(), 24, 6 * 36 + 24 + 64);
}
} catch (NullPointerException e){
e.printStackTrace();
Expand All @@ -77,11 +81,16 @@ public void draw(Graphics2D g){
}
for (int i = 0; i < ingredientSlots.length; i++) {
try {
ingredientSlots[i].draw(g, 4 * 36 + 4, (i+1) * 36 + 64, false);
ingredientSlots[i].draw(g, 3 * 36 + 20, (i+1) * 36 + 66, false);
} catch (ArrayIndexOutOfBoundsException|NullPointerException e){
e.printStackTrace();
}
}
g.setColor(new Color(0xED646668, true));
g.fillRoundRect( 18+(3*36), 62,3 * 36 + 32, 28,2,2);
g.setColor(new Color(0x98ACFF));
g.setFont(new Font(null, Font.BOLD, 24));
g.drawString("Ingredients", 24+(3*36), 64+18);
}

public void handleMouseMove(MouseEvent e){
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/utils/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ public static BufferedImage joinBufferedImage(BufferedImage img1, BufferedImage
BufferedImage newImage = new BufferedImage(width, height,
BufferedImage.TYPE_INT_ARGB);
Graphics2D g2 = newImage.createGraphics();
Color oldColor = g2.getColor();
g2.setPaint(Color.BLACK);
g2.fillRect(0, 0, width, height);
g2.setColor(oldColor);
g2.drawImage(img1, null, 0, 0);
g2.drawImage(img2, null, 0, 0);
g2.dispose();
Expand Down

0 comments on commit a022e11

Please sign in to comment.