Skip to content

Commit

Permalink
Fix lighting not disabled after item rendering, add a slot color
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Apr 27, 2016
1 parent 7c6f34d commit fa7fe71
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 5 deletions.
Expand Up @@ -10,6 +10,7 @@ public class AppearanceData implements IDataItem {
public int arrowColor = 0xFFFFD3;
public int arrowColorHover = 0xFF541C;
public int hoverColor = 0x77EE541C;
public int slotColor = 0xFF844C;
public int lockedSectionColor = 0x000000;
public float scale = 0.5F;
public String title = "";
Expand Down
Expand Up @@ -43,7 +43,7 @@ public void build(BookData book, ArrayList<BookElement> list, boolean rightSide)
addTitle(list, title);
}

list.add(new ElementImage(x, y, IMG_SMITHING.width, IMG_SMITHING.height, IMG_SMITHING, book.appearance.coverColor));
list.add(new ElementImage(x, y, IMG_SMITHING.width, IMG_SMITHING.height, IMG_SMITHING, book.appearance.slotColor));

if(input != null && !input.id.equals("")) {
list.add(new ElementItem(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, input.getItems(), input.action));
Expand Down
Expand Up @@ -50,13 +50,13 @@ public void build(BookData book, ArrayList<BookElement> list, boolean rightSide)
if(grid_size.equalsIgnoreCase("small")) {
x = GuiBook.PAGE_WIDTH / 2 - IMG_CRAFTING_SMALL.width / 2;
height = y + IMG_CRAFTING_SMALL.height;
list.add(new ElementImage(x, y, IMG_CRAFTING_SMALL.width, IMG_CRAFTING_SMALL.height, IMG_CRAFTING_SMALL, book.appearance.coverColor));
list.add(new ElementImage(x, y, IMG_CRAFTING_SMALL.width, IMG_CRAFTING_SMALL.height, IMG_CRAFTING_SMALL, book.appearance.slotColor));
resultX = x + X_RESULT_SMALL;
resultY = y + Y_RESULT_SMALL;
} else if(grid_size.equalsIgnoreCase("large")) {
x = GuiBook.PAGE_WIDTH / 2 - IMG_CRAFTING_LARGE.width / 2;
height = y + IMG_CRAFTING_LARGE.height;
list.add(new ElementImage(x, y, IMG_CRAFTING_LARGE.width, IMG_CRAFTING_LARGE.height, IMG_CRAFTING_LARGE, book.appearance.coverColor));
list.add(new ElementImage(x, y, IMG_CRAFTING_LARGE.width, IMG_CRAFTING_LARGE.height, IMG_CRAFTING_LARGE, book.appearance.slotColor));
resultX = x + X_RESULT_LARGE;
resultY = y + Y_RESULT_LARGE;
}
Expand Down
Expand Up @@ -45,7 +45,7 @@ public void build(BookData book, ArrayList<BookElement> list, boolean rightSide)
TextData tdTitle = new TextData(title);
tdTitle.underlined = true;
list.add(new ElementText(0, 0, GuiBook.PAGE_WIDTH, 9, new TextData[]{tdTitle}));
list.add(new ElementImage(x, y, IMG_SMELTING.width, IMG_SMELTING.height, IMG_SMELTING, book.appearance.coverColor));
list.add(new ElementImage(x, y, IMG_SMELTING.width, IMG_SMELTING.height, IMG_SMELTING, book.appearance.slotColor));

if(input != null && !input.id.equals("")) {
list.add(new ElementItem(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, input.getItems(), input.action));
Expand Down
Expand Up @@ -45,7 +45,7 @@ public void build(BookData book, ArrayList<BookElement> list, boolean rightSide)
addTitle(list, title);
}

list.add(new ElementImage(x, y, IMG_SMITHING.width, IMG_SMITHING.height, IMG_SMITHING, book.appearance.coverColor));
list.add(new ElementImage(x, y, IMG_SMITHING.width, IMG_SMITHING.height, IMG_SMITHING, book.appearance.slotColor));

if(input != null && !input.id.equals("")) {
list.add(new ElementItem(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, input.getItems(), input.action));
Expand Down
Expand Up @@ -85,6 +85,7 @@ public GuiBook(BookData book, StatFileWriter statFile, @Nullable ItemStack item)

this.statFile = statFile;
this.mc = Minecraft.getMinecraft();
this.fontRendererObj = mc.fontRendererObj;
init();
}

Expand Down
Expand Up @@ -84,6 +84,7 @@ public void draw(int mouseX, int mouseY, float partialTicks, FontRenderer fontRe
}

GlStateManager.popMatrix();
RenderHelper.disableStandardItemLighting();
}

@Override
Expand Down

0 comments on commit fa7fe71

Please sign in to comment.