comparison ui/Ui.lua @ 135:57be71eccc0a v63

Small azerite gear fix.
author yellowfive
date Sun, 12 Aug 2018 23:36:17 -0700
parents a0894ffebd15
children 35612aee8e15
comparison
equal deleted inserted replaced
134:41cf09da376d 135:57be71eccc0a
362 362
363 function Amr:Reset() 363 function Amr:Reset()
364 if not self:IsEnabled() then return end 364 if not self:IsEnabled() then return end
365 365
366 Amr:Hide() 366 Amr:Hide()
367 Amr:HideLootWindow() 367 --Amr:HideLootWindow()
368 Amr:HideShopWindow() 368 Amr:HideShopWindow()
369 Amr.db.profile.options.uiScale = 1 369 Amr.db.profile.options.uiScale = 1
370 Amr.db.profile.window = {} 370 Amr.db.profile.window = {}
371 Amr.db.profile.lootWindow = {} 371 Amr.db.profile.lootWindow = {}
372 Amr.db.profile.shopWindow = {} 372 Amr.db.profile.shopWindow = {}
387 -- set an item tooltip on any AceGUI widget with OnEnter and OnLeave events 387 -- set an item tooltip on any AceGUI widget with OnEnter and OnLeave events
388 function Amr:SetItemTooltip(obj, itemLink, anchor, x, y) 388 function Amr:SetItemTooltip(obj, itemLink, anchor, x, y)
389 obj:SetUserData("ttItemLink", itemLink) 389 obj:SetUserData("ttItemLink", itemLink)
390 obj:SetCallback("OnEnter", function(widget) 390 obj:SetCallback("OnEnter", function(widget)
391 local tooltipLink = widget:GetUserData("ttItemLink") 391 local tooltipLink = widget:GetUserData("ttItemLink")
392 GameTooltip:SetOwner(widget.frame, anchor and anchor or "ANCHOR_CURSOR", x, y) 392 if tooltipLink then
393 GameTooltip:SetHyperlink(tooltipLink) 393 GameTooltip:SetOwner(widget.frame, anchor and anchor or "ANCHOR_CURSOR", x, y)
394 GameTooltip:SetHyperlink(tooltipLink)
395 end
394 end) 396 end)
395 obj:SetCallback("OnLeave", function(widget) 397 obj:SetCallback("OnLeave", function(widget)
396 GameTooltip:Hide() 398 GameTooltip:Hide()
397 end) 399 end)
398 end 400 end
399 401
400 function Amr:SetSpellTooltip(obj, spellId, anchor, x, y) 402 function Amr:SetSpellTooltip(obj, spellId, anchor, x, y)
401 obj:SetUserData("ttSpellId", spellId) 403 obj:SetUserData("ttSpellId", spellId)
402 obj:SetCallback("OnEnter", function(widget) 404 obj:SetCallback("OnEnter", function(widget)
403 local ttSpellId = widget:GetUserData("ttSpellId") 405 local ttSpellId = widget:GetUserData("ttSpellId")
404 GameTooltip:SetOwner(widget.frame, anchor and anchor or "ANCHOR_CURSOR", x, y) 406 if ttSpellId then
405 GameTooltip:SetSpellByID(ttSpellId) 407 GameTooltip:SetOwner(widget.frame, anchor and anchor or "ANCHOR_CURSOR", x, y)
408 GameTooltip:SetSpellByID(ttSpellId)
409 end
406 end) 410 end)
407 obj:SetCallback("OnLeave", function(widget) 411 obj:SetCallback("OnLeave", function(widget)
408 GameTooltip:Hide() 412 GameTooltip:Hide()
409 end) 413 end)
410 end 414 end