Skip to content

Commit

Permalink
Support slot_highlight_back and slot_highlight_front
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Oct 23, 2024
1 parent d10f4e1 commit d9fe72c
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

public class BingoClient {
private static final ResourceLocation BOARD_TEXTURE = ResourceLocations.bingo("board");
private static final ResourceLocation SLOT_HIGHLIGHT_BACK_SPRITE = ResourceLocations.minecraft("container/slot_highlight_back");
private static final ResourceLocation SLOT_HIGHLIGHT_FRONT_SPRITE = ResourceLocations.minecraft("container/slot_highlight_front");
public static final Component BOARD_TITLE = Component.translatable("bingo.board.title");
public static final Component BOARD_TITLE_SHORT = Component.translatable("bingo.board.title.short");

Expand Down Expand Up @@ -222,6 +224,14 @@ public static void renderBingo(GuiGraphics graphics, boolean mouseHover, Positio
);
renderBoardTitle(graphics, minecraft.font);

if (BingoMousePos.hasSlotPos(mousePos)) {
graphics.pose().pushPose();
final int slotX = mousePos.slotIdX() * 18 + 8;
final int slotY = mousePos.slotIdY() * 18 + 18;
graphics.blitSprite(RenderType::guiTextured, SLOT_HIGHLIGHT_BACK_SPRITE, slotX - 4, slotY - 4, 24, 24);
graphics.pose().popPose();
}

final boolean spectator = minecraft.player != null && minecraft.player.isSpectator();
for (int sx = 0; sx < clientGame.size(); sx++) {
for (int sy = 0; sy < clientGame.size(); sy++) {
Expand Down Expand Up @@ -272,7 +282,7 @@ public static void renderBingo(GuiGraphics graphics, boolean mouseHover, Positio
graphics.pose().translate(0f, 0f, 200f);
final int slotX = mousePos.slotIdX() * 18 + 8;
final int slotY = mousePos.slotIdY() * 18 + 18;
graphics.fill(slotX, slotY, slotX + 16, slotY + 16, 0x80ffffff);
graphics.blitSprite(RenderType::guiTexturedOverlay, SLOT_HIGHLIGHT_FRONT_SPRITE, slotX - 4, slotY - 4, 24, 24);
graphics.pose().popPose();
}

Expand Down

0 comments on commit d9fe72c

Please sign in to comment.