Skip to content

Commit

Permalink
added hover info
Browse files Browse the repository at this point in the history
  • Loading branch information
Globox1997 committed Nov 17, 2024
1 parent 344ba16 commit 23db2d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/net/levelz/screen/LevelScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) {
Text title = Text.translatable("text.levelz.gui.title", this.client.player.getName().getString());
context.drawText(this.textRenderer, title, this.x + 118 - this.textRenderer.getWidth(title) / 2, this.y + 7, 0x3F3F3F, false);


if (!this.attributes.isEmpty()) {
if (this.showAttributes) {
context.drawTexture(ICON_TEXTURE, this.x + 178, this.y + 5, 30, 114, 15, 13);
Expand Down Expand Up @@ -142,6 +141,9 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) {
} else {
context.drawTexture(ICON_TEXTURE, this.x + 178, this.y + 5, 15, 114, 15, 13);
}
if (isPointWithinBounds(this.x + 178, this.y + 5, 15, 13, mouseX, mouseY)) {
context.drawTooltip(this.textRenderer, Text.translatable("text.levelz.gui.attributes"), mouseX, mouseY);
}
} else {
context.drawTexture(ICON_TEXTURE, this.x + 178, this.y + 5, 0, 114, 15, 13);
}
Expand All @@ -168,6 +170,7 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) {
if (!LevelManager.CRAFTING_RESTRICTIONS.isEmpty()) {
if (isPointWithinBounds(this.x + 178, this.y + 29, 14, 13, mouseX, mouseY)) {
context.drawTexture(ICON_TEXTURE, this.x + 178, this.y + 29, 30, 80, 15, 13);
context.drawTooltip(this.textRenderer, Text.translatable("restriction.levelz.crafting"), mouseX, mouseY);
} else {
context.drawTexture(ICON_TEXTURE, this.x + 178, this.y + 29, 15, 80, 15, 13);
}
Expand All @@ -178,6 +181,7 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) {
if (!LevelManager.MINING_RESTRICTIONS.isEmpty()) {
if (isPointWithinBounds(this.x + 178, this.y + 45, 14, 13, mouseX, mouseY)) {
context.drawTexture(ICON_TEXTURE, this.x + 178, this.y + 45, 75, 80, 15, 13);
context.drawTooltip(this.textRenderer, Text.translatable("restriction.levelz.mining"), mouseX, mouseY);
} else {
context.drawTexture(ICON_TEXTURE, this.x + 178, this.y + 45, 60, 80, 15, 13);
}
Expand Down

0 comments on commit 23db2d7

Please sign in to comment.