mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 05:27:37 +00:00
feat(hover): wire tooltip scrollbar drag into GuiScriptTextArea input handling
- drawTextBox: update scrollbar drag each frame via Mouse.isButtonDown(0), release drag when button lifted (mirrors existing ScrollState pattern) - mouseClicked: intercept LMB on tooltip scrollbar thumb before text interaction Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
1 parent
58f86058d4
commit
2578ce1cf6
1 file changed
+14
@@ -652,6 +652,14 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
hoverState.clearHover();
|
||||
}
|
||||
}
|
||||
// Handle tooltip scrollbar drag (update each frame; release when button lifted)
|
||||
if (hoverState.isDraggingScrollbar()) {
|
||||
if (Mouse.isButtonDown(0)) {
|
||||
hoverState.updateScrollbarDrag(yMouse);
|
||||
} else {
|
||||
hoverState.releaseScrollbarDrag();
|
||||
}
|
||||
}
|
||||
|
||||
// Update scroll animation
|
||||
scroll.initializeIfNeeded(scroll.getScrolledLine());
|
||||
@@ -2894,6 +2902,12 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
if (KEYS_OVERLAY.mouseClicked(xMouse, yMouse, mouseButton))
|
||||
return;
|
||||
|
||||
// Check tooltip scrollbar click (highest priority — before text interaction)
|
||||
if (mouseButton == 0 && hoverState.isTooltipVisible()
|
||||
&& hoverState.isMouseOverScrollbarThumb(xMouse, yMouse)) {
|
||||
hoverState.startScrollbarDrag(yMouse);
|
||||
return;
|
||||
}
|
||||
// Determine whether click occurred inside the text area bounds
|
||||
this.active = xMouse >= this.x && xMouse < this.x + this.width && yMouse >= this.y && yMouse < this.y + this.height;
|
||||
if (this.active) {
|
||||
|
||||
Reference in new issue
Block a user