mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 23:37:32 +00:00
Fix Tooltip
This commit is contained in:
1 parent
69eb728e59
commit
fd43cd6b67
2 files changed
+7
-4
No files matched your search
@@ -1,10 +1,13 @@
|
||||
package noppes.npcs.client.gui.util;
|
||||
|
||||
import kamkeel.npcs.util.TextSplitter;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiHoverText extends GuiScreen {
|
||||
@@ -28,8 +31,7 @@ public class GuiHoverText extends GuiScreen {
|
||||
this.drawTexturedModalRect(this.x, this.y, 0, 0, 12, 12);
|
||||
|
||||
if (inArea(x, y, 12, 12, par1, par2)) {
|
||||
List<String> lines = new ArrayList<String>();
|
||||
lines.add(text);
|
||||
List<String> lines = TextSplitter.splitText(StatCollector.translateToLocal(text), 30);
|
||||
this.drawHoveringText(lines, x + 8, y + 6, this.fontRendererObj);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
@@ -314,8 +314,6 @@ public abstract class GuiNPCInterface extends GuiScreen {
|
||||
scroll.updateSubGUI(subGui);
|
||||
scroll.drawScreen(i, j, f, !subGui && scroll.isMouseOver(i, j) ? Mouse.getDWheel() : 0);
|
||||
}
|
||||
for (GuiScreen gui : extra.values())
|
||||
gui.drawScreen(i, j, f);
|
||||
// Draw scrollable windows.
|
||||
for (GuiScrollWindow guiScrollableComponent : scrollWindows.values()) {
|
||||
guiScrollableComponent.drawScreen(i, j, f, !subGui && guiScrollableComponent.isMouseOver(i, j) ? Mouse.getDWheel() : 0);
|
||||
@@ -335,6 +333,9 @@ public abstract class GuiNPCInterface extends GuiScreen {
|
||||
}
|
||||
}
|
||||
|
||||
for (GuiScreen gui : extra.values())
|
||||
gui.drawScreen(i, j, f);
|
||||
|
||||
if (subgui != null) {
|
||||
subgui.drawScreen(i, j, f);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user