Skip to content

Commit

Permalink
Fixes for Npc Search on Npc Colors Tab
Browse files Browse the repository at this point in the history
- When the player searched for npcs, the textentry was triggering twice per character typed.
- If the scrollbar's offset wasn't at value zero while typing the search text, it would show no results, as the scroll offset would be bigger than the amount of results.
  • Loading branch information
Tercioo committed Dec 23, 2023
1 parent f20be7c commit ac07403
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Plater_OptionsPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3415,13 +3415,22 @@ Plater.CreateAuraTesting()
end

--create search box
local latestSearchUpdate = 0
function colorsFrame.OnSearchBoxTextChanged()
local text = colorsFrame.AuraSearchTextEntry:GetText()
if (text and string.len (text) > 0) then
IsSearchingFor = text:lower()
else
IsSearchingFor = nil
end

if (latestSearchUpdate + 0.01 > GetTime()) then
return
end

latestSearchUpdate = GetTime()
spells_scroll.offset = 0
spells_scroll:OnVerticalScroll(spells_scroll.offset)
spells_scroll:Refresh()
end

Expand Down

0 comments on commit ac07403

Please sign in to comment.