Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 6a1ece5

Browse files
committed
tooltips over buttons
1 parent a3b189f commit 6a1ece5

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

src/main/java/io/github/axolotlclient/config/screen/ButtonWidgetList.java

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,23 @@ public int getRowLeft() {
119119
return this.width / 2 -155;
120120
}
121121

122+
123+
protected void renderTooltips(MatrixStack matrices, int x, int y, int mouseX, int mouseY){
124+
int i = this.getEntryCount();
125+
126+
for(int j = 0; j < i; ++j) {
127+
int k = this.getRowTop(j);
128+
entries.get(j).renderTooltips(matrices, x, k, mouseX, mouseY);
129+
}
130+
}
131+
122132
@Override
123133
protected void renderList(MatrixStack matrices, int x, int y, int mouseX, int mouseY, float delta) {
124134
Util.applyScissor(new Rectangle(0, top, this.width, bottom-top));
125135
super.renderList(matrices, x, y, mouseX, mouseY, delta);
136+
137+
renderTooltips(matrices, x, y, mouseX, mouseY);
138+
126139
GL11.glDisable(GL11.GL_SCISSOR_TEST);
127140
}
128141

@@ -179,6 +192,10 @@ public void render(MatrixStack matrices, int index, int y, int x, int entryWidth
179192
this.right.render(matrices, mouseX, mouseY, tickDelta);
180193
}
181194

195+
}
196+
197+
public void renderTooltips(MatrixStack matrices, int x, int y, int mouseX, int mouseY){
198+
182199
}
183200

184201
protected void renderTooltip(MatrixStack matrices, Tooltippable option, int x, int y){
@@ -278,9 +295,13 @@ public CategoryPair(OptionCategory catLeft, CategoryWidget btnLeft, OptionCatego
278295

279296
@Override
280297
public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
281-
super.render(matrices, index, y, x, entryWidth, entryHeight, mouseX, mouseY, hovered, tickDelta);
298+
super.render(matrices, index, y, x, entryWidth, entryHeight, mouseX, mouseY, hovered, tickDelta);
282299

283-
if(AxolotlClient.CONFIG.showCategoryTooltips.get()) {
300+
}
301+
302+
@Override
303+
public void renderTooltips(MatrixStack matrices, int x, int y, int mouseX, int mouseY) {
304+
if(AxolotlClient.CONFIG.showCategoryTooltips.get()) {
284305
if (super.left != null && super.left.isMouseOver(mouseX, mouseY)) {
285306
renderTooltip(matrices, left, mouseX, mouseY);
286307
}
@@ -310,6 +331,10 @@ public void render(MatrixStack matrices, int index, int y, int x, int entryWidth
310331
DrawableHelper.drawTextWithShadow(matrices, client.textRenderer, option.getTranslatedName(), x, y + 5, -1);
311332
left.y = y;
312333
left.render(matrices, mouseX, mouseY, tickDelta);
334+
}
335+
336+
@Override
337+
public void renderTooltips(MatrixStack matrices, int x, int y, int mouseX, int mouseY) {
313338

314339
if(AxolotlClient.CONFIG.showOptionTooltips.get() &&
315340
mouseX>=x && mouseX<=left.x + left.getWidth() && mouseY>= y && mouseY<= y + 20){

src/main/java/io/github/axolotlclient/modules/scrollableTooltips/ScrollableTooltips.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package io.github.axolotlclient.modules.scrollableTooltips;
22

3-
import com.mojang.blaze3d.platform.InputUtil;
43
import io.github.axolotlclient.AxolotlClient;
54
import io.github.axolotlclient.config.options.BooleanOption;
65
import io.github.axolotlclient.config.options.IntegerOption;
76
import io.github.axolotlclient.config.options.OptionCategory;
87
import io.github.axolotlclient.modules.AbstractModule;
98
import net.minecraft.client.gui.screen.Screen;
10-
import net.minecraft.client.option.KeyBind;
119
import net.minecraft.util.Identifier;
1210

1311
public class ScrollableTooltips extends AbstractModule {

0 commit comments

Comments
 (0)