Handle Mouse Input
()
| 39 | * Handle Mouse Input |
| 40 | */ |
| 41 | @Override |
| 42 | public void handleMouseInput() { |
| 43 | super.handleMouseInput(); |
| 44 | |
| 45 | if (!Display.isActive()) // Don't allow multiple URL-Clicks if Display is not focused. |
| 46 | return; |
| 47 | |
| 48 | int mouseX = this.i; |
| 49 | int mouseY = this.j; |
| 50 | |
| 51 | if (this.g(mouseY)) { |
| 52 | if (Mouse.isButtonDown(0) && this.q()) { |
| 53 | int y = mouseY - this.d - this.t + (int) this.n - 4; |
| 54 | int id = -1; |
| 55 | int minY = -1; |
| 56 | // Search for the right ChatLine-ID |
| 57 | for (int i1 = 0; i1 < heightMap.size(); i1++) { |
| 58 | Integer integer = heightMap.get(i1); |
| 59 | Row line = rows.get(i1); |
| 60 | if (y >= integer - 2 && y <= integer + line.getLineHeight() - 2) { |
| 61 | id = i1; |
| 62 | minY = integer; |
| 63 | break; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | if (id < 0 || id >= rows.size()) |
| 68 | return; |
| 69 | |
| 70 | callback.chatLineClicked(rows.get(id), mouseX, y, minY, getLeft()); |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | } |
nothing calls this directly
no test coverage detected