diff --git a/core.lua b/core.lua index 40e5d78..bcfe70f 100644 --- a/core.lua +++ b/core.lua @@ -265,7 +265,7 @@ function private.SetItemRef(...) end function private.PickupContainerItem(...) - if m.modified() or not m.index(m.active_tab.module[1], 'PICKUP_ITEM') then + if m.modified() or not m.index(m.active_tab, 'module', 1, 'PICKUP_ITEM') then return m.orig.PickupContainerItem(unpack(arg)) end local item_info = m.info.container_item(arg[1], arg[2]) @@ -275,7 +275,7 @@ function private.PickupContainerItem(...) end function private.UseContainerItem(...) - if m.modified() or not m.index(m.active_tab.module[1], 'USE_ITEM') then + if m.modified() or not m.index(m.active_tab, 'module', 1, 'USE_ITEM') then return m.orig.UseContainerItem(unpack(arg)) end local item_info = m.info.container_item(arg[1], arg[2]) diff --git a/tabs/search/core.lua b/tabs/search/core.lua index 0e0cf81..50f855f 100644 --- a/tabs/search/core.lua +++ b/tabs/search/core.lua @@ -910,8 +910,17 @@ function private.remove_post_filter() m.update_filter_display() end -function private.update_filter_display() - m.filter_display:SetText(aux.filter.indented_post_query_string(m.post_components)) +do + function private.update_filter_display() + local text = aux.filter.indented_post_query_string(m.post_components) + local widest_line = 0 + for line in string.gfind(text, '

(.-)

') do + m.filter_display.measure:SetText(line) + widest_line = max(widest_line, m.filter_display.measure:GetStringWidth()) + end + m.filter_display:SetWidth(widest_line) + m.filter_display:SetText(text) + end end function private.new_recent_search(filter_string, prettified) diff --git a/tabs/search/frames.lua b/tabs/search/frames.lua index d46a05e..76f9cd0 100644 --- a/tabs/search/frames.lua +++ b/tabs/search/frames.lua @@ -535,6 +535,7 @@ do scroll_frame:SetScript('OnMouseWheel', function() local child = this:GetScrollChild() child:SetScale(max(.3, min(1, child:GetScale() + arg1/10))) + m.update_filter_display() end) scroll_frame:RegisterForDrag('LeftButton') scroll_frame:SetScript('OnDragStart', function() @@ -555,16 +556,16 @@ do this:SetScript('OnUpdate', nil) end) aux.gui.set_content_style(scroll_frame) - local scroll_child = CreateFrame('Frame', nil, scroll_frame) + local scroll_child = CreateFrame('SimpleHTML', nil, scroll_frame) + scroll_frame:SetScrollChild(scroll_child) + scroll_child:SetFont('p', [[Fonts\ARIALN.TTF]], 26) scroll_child:SetWidth(1) scroll_child:SetHeight(1) - scroll_frame:SetScrollChild(scroll_child) - local display = aux.gui.label(scroll_child, 24) - display:SetPoint('TOPLEFT', 0, 0) - display:SetJustifyH('LEFT') - display:SetJustifyV('TOP') - display.scale_frame = scale_frame - private.filter_display = display + scroll_child:SetScript('OnHyperlinkClick', function() + end) + scroll_child.measure = scroll_child:CreateFontString() + scroll_child.measure:SetFont([[Fonts\ARIALN.TTF]], 26) + private.filter_display = scroll_child end private.status_bars = {} diff --git a/util/filter.lua b/util/filter.lua index a248d1a..fbb9a19 100644 --- a/util/filter.lua +++ b/util/filter.lua @@ -535,9 +535,9 @@ function public.indented_post_query_string(components) if no_line_break then str = str..' ' elseif i > 1 then - str = str..'|n' + str = str..'

' for _=1,getn(stack) do - str = str..' ' + str = str..aux.gui.inline_color.content.backdrop..'----'..FONT_COLOR_CODE_CLOSE end end no_line_break = component[1] == 'operator' and component[2] == 'not' @@ -559,7 +559,7 @@ function public.indented_post_query_string(components) end end - return str + return '

'..str..'

' end function private.prettified_query_string(components)