refactoring, change of pickup/use behavior

This commit is contained in:
Manuel Simon Hirsig
2016-08-07 23:06:31 +02:00
parent c3447aedd2
commit abc163d7f3
10 changed files with 108 additions and 143 deletions
+3 -24
View File
@@ -118,34 +118,13 @@ aux.post_tab.FRAMES(function(m, public, private)
do
local item = aux.gui.item(m.frame.parameters)
item:SetPoint('TOPLEFT', 6, -6)
item:EnableMouse()
item:SetScript('OnReceiveDrag', function()
local item_info = aux.cursor_item()
if item_info then
m.select_item(item_info.item_key)
end
ClearCursor()
end)
item:SetScript('OnClick', function()
local item_info = aux.cursor_item()
if item_info then
m.select_item(item_info.item_key)
end
ClearCursor()
end)
local highlight = item:CreateTexture()
highlight:SetPoint('TOPLEFT', -2.5, 2)
highlight:SetPoint('BOTTOMRIGHT', 2.5, -2)
highlight:Hide()
highlight:SetTexture(1, .9, .9, .1)
item:SetScript('OnEnter', function()
highlight:Show()
item.button:EnableMouse(true)
item.button:SetScript('OnEnter', function()
if m.selected_item then
aux.info.set_tooltip(m.selected_item.itemstring, this, 'ANCHOR_RIGHT')
end
end)
item:SetScript('OnLeave', function()
highlight:Hide()
item.button:SetScript('OnLeave', function()
GameTooltip:Hide()
end)
private.item = item