From acc3da3f252fae1d3b558af6871552bbb41ee6f3 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sun, 20 Mar 2016 17:41:26 +0100 Subject: [PATCH] some refactoring --- auction_listing.lua | 2 +- auctions_frame.lua | 2 +- bids_frame.lua | 2 +- info.lua | 19 +------------------ post_frame.lua | 2 +- 5 files changed, 5 insertions(+), 22 deletions(-) diff --git a/auction_listing.lua b/auction_listing.lua index dbbe144..680a09a 100644 --- a/auction_listing.lua +++ b/auction_listing.lua @@ -86,7 +86,7 @@ local methods = { local rt = this:GetParent().row.rt local rowData = this:GetParent().row.data if rowData and rowData.record then - Aux.info.set_tooltip(rowData.record.itemstring, rowData.record.EnhTooltip_info, this, 'ANCHOR_RIGHT', 0, 0) + Aux.info.set_tooltip(rowData.record.itemstring, rowData.record.EnhTooltip_info, this, 'ANCHOR_RIGHT') Aux.info.set_shopping_tooltip(rowData.record.slot) rt.isShowingItemTooltip = true end diff --git a/auctions_frame.lua b/auctions_frame.lua index c7e36f8..fd48fc7 100644 --- a/auctions_frame.lua +++ b/auctions_frame.lua @@ -18,7 +18,7 @@ function public.on_load() private.on_row_click(row_data.record) end) private.listing:SetHandler('OnEnter', function(table, row_data, column) - Aux.info.set_tooltip(row_data.record.itemstring, row_data.record.EnhTooltip_info, column.row, 'ANCHOR_RIGHT', 0, 0) + Aux.info.set_tooltip(row_data.record.itemstring, row_data.record.EnhTooltip_info, column.row, 'ANCHOR_RIGHT') end) private.listing:SetHandler('OnLeave', function(table, row_data, column) GameTooltip:Hide() diff --git a/bids_frame.lua b/bids_frame.lua index 11eb6b7..a5ddfa4 100644 --- a/bids_frame.lua +++ b/bids_frame.lua @@ -21,7 +21,7 @@ function public.on_load() private.on_row_click(row_data.record) end) private.listing:SetHandler('OnEnter', function(table, row_data, column) - Aux.info.set_tooltip(row_data.record.itemstring, row_data.record.EnhTooltip_info, column.row, 'ANCHOR_RIGHT', 0, 0) + Aux.info.set_tooltip(row_data.record.itemstring, row_data.record.EnhTooltip_info, column.row, 'ANCHOR_RIGHT') end) private.listing:SetHandler('OnLeave', function(table, row_data, column) GameTooltip:Hide() diff --git a/info.lua b/info.lua index 3601cb6..90b2d4b 100644 --- a/info.lua +++ b/info.lua @@ -170,24 +170,7 @@ function public.auction(index, type) } end -function public.reanchor_tooltip() - if private.anchor_cursor then - this:ClearAllPoints() - local x, y = GetCursorPosition() - x, y = x / UIParent:GetEffectiveScale() + private.x_offset, y / UIParent:GetEffectiveScale() + private.y_offset - this:SetPoint('TOP', UIParent, 'BOTTOMLEFT', x, y) - end -end - -function public.set_tooltip(itemstring, EnhTooltip_info, owner, anchor, x_offset, y_offset) - if anchor == 'ANCHOR_CURSOR' and (x_offset or y_offset) then - private.anchor_cursor = true - private.x_offset = x_offset - private.y_offset = y_offset - anchor = 'TOP' - else - private.anchor_cursor = false - end +function public.set_tooltip(itemstring, EnhTooltip_info, owner, anchor) GameTooltip:SetOwner(owner, anchor) GameTooltip:SetHyperlink(itemstring) diff --git a/post_frame.lua b/post_frame.lua index 10d2a94..30bbddc 100644 --- a/post_frame.lua +++ b/post_frame.lua @@ -214,7 +214,7 @@ function public.on_load() ) -- private.inventory_listing:SetHandler('OnEnter', function(table, row_data, column) --- Aux.info.set_tooltip(row_data.itemstring, nil, column.row, 'ANCHOR_LEFT', 0, 0) +-- Aux.info.set_tooltip(row_data.itemstring, nil, column.row, 'ANCHOR_LEFT') -- end) -- private.inventory_listing:SetHandler('OnLeave', function() -- GameTooltip:Hide()