mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 19:46:42 +01:00
Fix layering of slot textures
This commit is contained in:
parent
5bb982ab85
commit
536172791e
1 changed files with 9 additions and 2 deletions
|
@ -90,6 +90,7 @@ public class SpellbookScreen extends HandledScreen<SpellbookScreenHandler> {
|
||||||
addDrawableChild(new PageButton(x + 350, y + 187, 1));
|
addDrawableChild(new PageButton(x + 350, y + 187, 1));
|
||||||
addDrawableChild(new PageButton(x + 300, y + 187, -1));
|
addDrawableChild(new PageButton(x + 300, y + 187, -1));
|
||||||
container.init(this::initPageContent);
|
container.init(this::initPageContent);
|
||||||
|
addDrawable(this::drawSlots);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -110,8 +111,9 @@ public class SpellbookScreen extends HandledScreen<SpellbookScreenHandler> {
|
||||||
drawTexture(matrices, left, top, 0, 0, backgroundWidth, backgroundHeight, 512, 256);
|
drawTexture(matrices, left, top, 0, 0, backgroundWidth, backgroundHeight, 512, 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
protected void drawSlots(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||||
protected void drawForeground(MatrixStack matrices, int mouseX, int mouseY) {
|
matrices.push();
|
||||||
|
matrices.translate(x, y, 0);
|
||||||
RenderSystem.setShaderColor(1, 1, 1, 1);
|
RenderSystem.setShaderColor(1, 1, 1, 1);
|
||||||
RenderSystem.setShaderTexture(0, SLOT);
|
RenderSystem.setShaderTexture(0, SLOT);
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
|
@ -119,6 +121,7 @@ public class SpellbookScreen extends HandledScreen<SpellbookScreenHandler> {
|
||||||
for (Slot slot : handler.slots) {
|
for (Slot slot : handler.slots) {
|
||||||
if (slot.isEnabled() && slot instanceof SpellbookSlot) {
|
if (slot.isEnabled() && slot instanceof SpellbookSlot) {
|
||||||
drawTexture(matrices, slot.x - 8, slot.y - 8, 0, 0, 32, 32, 32, 32);
|
drawTexture(matrices, slot.x - 8, slot.y - 8, 0, 0, 32, 32, 32, 32);
|
||||||
|
|
||||||
if (slot instanceof OutputSlot) {
|
if (slot instanceof OutputSlot) {
|
||||||
RenderSystem.setShaderColor(1, 1, 1, 0.3F);
|
RenderSystem.setShaderColor(1, 1, 1, 0.3F);
|
||||||
RenderSystem.setShaderTexture(0, new Identifier("unicopia", "textures/item/gemstone.png"));
|
RenderSystem.setShaderTexture(0, new Identifier("unicopia", "textures/item/gemstone.png"));
|
||||||
|
@ -130,7 +133,11 @@ public class SpellbookScreen extends HandledScreen<SpellbookScreenHandler> {
|
||||||
}
|
}
|
||||||
RenderSystem.disableBlend();
|
RenderSystem.disableBlend();
|
||||||
RenderSystem.setShaderColor(1, 1, 1, 1);
|
RenderSystem.setShaderColor(1, 1, 1, 1);
|
||||||
|
matrices.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawForeground(MatrixStack matrices, int mouseX, int mouseY) {
|
||||||
textRenderer.draw(matrices, title, titleX, titleY, 4210752);
|
textRenderer.draw(matrices, title, titleX, titleY, 4210752);
|
||||||
textRenderer.draw(matrices, SpellbookPage.getCurrent().getLabel(), 220, this.titleY, 4210752);
|
textRenderer.draw(matrices, SpellbookPage.getCurrent().getLabel(), 220, this.titleY, 4210752);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue