mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 11:09:42 +00:00
Reset selection of search bar when unfocusing
This commit is contained in:
1 parent
ec40a1c580
commit
762d52f658
2 files changed
+6
-1
No files matched your search
@@ -154,7 +154,7 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
@Override
|
||||
public void focusMainEditor() {
|
||||
active = true;
|
||||
selection.markActivity();
|
||||
searchBar.resetSelection();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -596,6 +596,10 @@ public class SearchReplaceBar {
|
||||
return mouseX >= bx && mouseX < bx + bw && mouseY >= by && mouseY < by + bh;
|
||||
}
|
||||
|
||||
public void resetSelection() {
|
||||
searchSelectionStart = searchSelectionEnd = searchCursor;
|
||||
replaceSelectionStart = replaceSelectionEnd = replaceCursor;
|
||||
}
|
||||
// ==================== MOUSE INPUT ====================
|
||||
|
||||
/**
|
||||
@@ -609,6 +613,7 @@ public class SearchReplaceBar {
|
||||
int totalHeight = getTotalHeight();
|
||||
// If click is outside the bar, don't consume it (let main editor handle)
|
||||
if (mouseX < x || mouseX > x + width || mouseY < y || mouseY > y + totalHeight) {
|
||||
resetSelection();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user