Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to search Character import list by Ascendancy #7824

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions src/Classes/DropDownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ local DropDownClass = newClass("DropDownControl", "Control", "ControlHost", "Too
end,
-- value mapping function
function(listVal)
return StripEscapes(type(listVal) == "table" and listVal.label or listVal)
if type(listVal) == "table" then
if listVal.searchFilter then
return StripEscapes(listVal.searchFilter)
end
if listVal.label then
return StripEscapes(listVal.label)
end
end
return StripEscapes(listVal)
end
)
self.controls.scrollBar = new("ScrollBarControl", {"TOPRIGHT",self,"TOPRIGHT"}, -1, 0, 18, 0, (height - 4) * 4)
Expand Down Expand Up @@ -359,9 +367,16 @@ function DropDownClass:Draw(viewPort, noTooltip)
SetDrawColor(0.66, 0.66, 0.66)
end
-- draw actual item label with search match highlight if available
local label = type(listVal) == "table" and listVal.label or listVal
local label = nil
local detail = nil
if type(listVal) == "table" then
label = listVal.label
detail = listVal.detail
else
label = listVal
end
DrawString(0, y, "LEFT", lineHeight, "VAR", label)
if selDetail ~= nil then
if detail ~= nil then
local detail = listVal.detail
dx = DrawStringWidth(lineHeight, "VAR", detail)
DrawString(width - dx - 4 - 22, y, "LEFT", lineHeight, "VAR", detail)
Expand Down
1 change: 1 addition & 0 deletions src/Classes/ImportTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ function ImportTabClass:BuildCharacterList(league)
t_insert(self.controls.charSelect.list, {
label = charName,
char = char,
searchFilter = charName.." "..charClass,
detail = detail
})
end
Expand Down
Loading