MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / draw

Method draw

Minecraft-Utils/1.8/src/AudioButton.java:54–77  ·  view source on GitHub ↗
(int mouseX, int mouseY)

Source from the content-addressed store, hash-verified

52 }
53
54 @Override
55 public void draw(int mouseX, int mouseY) {
56 super.draw(mouseX, mouseY);
57
58 if (errorMessage != null) {
59 MinecraftFactory.getVars().getCurrentScreen().drawHoveringText(Collections.singletonList(errorMessage), (int) (getX() + MinecraftFactory.getVars().getStringWidth(errorMessage) *
60 .8), getY() - 10);
61 }
62 if (recording) {
63 String line1 = MinecraftFactory.getClassProxyCallback().translate("chat.audio.recording",
64 Utils.getShortenedDouble((double) (System.currentTimeMillis() - recordingStarted) / 1000.0, 1));
65 String line2 = MinecraftFactory.getClassProxyCallback().translate("chat.audio.abort");
66 int stringWidth = Math.max(MinecraftFactory.getVars().getStringWidth(line1), MinecraftFactory.getVars().getStringWidth(line2));
67 MinecraftFactory.getVars().getCurrentScreen().drawHoveringText(Arrays.asList(line1, line2), (int) (getX() + stringWidth * .8), getY() - 15);
68 }
69
70 if (recording && (mouseX <= getX() || mouseX >= getX() + getWidth() || mouseY <= getY() || mouseY >= getY() + getWidth())) {
71 recordingStarted = System.currentTimeMillis();
72 recording = false;
73 synchronized (LOCK) {
74 closeLine();
75 }
76 }
77 }
78
79 @Override
80 public boolean mouseClicked(int mouseX, int mouseY) {

Callers

nothing calls this directly

Calls 12

getVarsMethod · 0.95
getClassProxyCallbackMethod · 0.95
getShortenedDoubleMethod · 0.95
closeLineMethod · 0.95
drawMethod · 0.65
drawHoveringTextMethod · 0.65
getCurrentScreenMethod · 0.65
getXMethod · 0.65
getStringWidthMethod · 0.65
getYMethod · 0.65
translateMethod · 0.65
getWidthMethod · 0.65

Tested by

no test coverage detected