HighlightSelectable
Definition
-- @/lua/common/extensions/ui/imgui_custom_luaintf.lua:338
function M.HighlightSelectable(label, highlightText, selected)
local cursor = M.GetCursorPos()
local width = M.GetContentRegionAvailWidth()
M.BeginGroup()
local x = M.GetCursorPosX()
M.HighlightText(label, highlightText)
local spacing = M.GetStyle().ItemSpacing
M.SameLine()
M.Dummy(M.ImVec2(width - M.GetCursorPosX(), 1))
M.EndGroup()
if M.IsItemHovered() then
local itemSize = M.GetItemRectSize()
M.ImDrawList_AddRectFilled(M.GetWindowDrawList(), M.ImVec2(cursor.x + M.GetWindowPos().x - 2,
cursor.y + M.GetWindowPos().y + (spacing.y/2) - 2 - M.GetScrollY()),
M.ImVec2(cursor.x + M.GetWindowPos().x + itemSize.x + (spacing.y/2),
cursor.y + M.GetWindowPos().y + itemSize.y + 2 - M.GetScrollY()),
M.GetColorU321(M.IsAnyMouseDown() and M.Col_HeaderActive or M.Col_HeaderHovered), 1, 1)
elseif selected then
local itemSize = M.GetItemRectSize()
M.ImDrawList_AddRectFilled(M.GetWindowDrawList(), M.ImVec2(cursor.x + M.GetWindowPos().x - 2,
cursor.y + M.GetWindowPos().y + (spacing.y/2) - 2 - M.GetScrollY()),
M.ImVec2(cursor.x + M.GetWindowPos().x + itemSize.x + (spacing.y/2),
cursor.y + M.GetWindowPos().y + itemSize.y + 2 - M.GetScrollY()),
M.GetColorU321(M.Col_Header), 1, 1)
end
end
Callers
@/lua/ge/extensions/editor/util/searchUtil.lua
if self.matchString ~= '' then
im.HighlightSelectable(result.id, self.matchString)
else
@/lua/ge/extensions/editor/missionEditor.lua
if missionSearchDisplayResult then
im.HighlightSelectable(name, ffi.string(missionSearchTxt), clickedMission == missionData)
else