some refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-03-20 17:41:26 +01:00
parent c41f3589cd
commit acc3da3f25
5 changed files with 5 additions and 22 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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()
+1 -18
View File
@@ -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)
+1 -1
View File
@@ -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()