View Single Post
03-10-22, 07:15 PM   #3
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
itip:ClearBackdrop() will also cause an error, since the BackdropTemplate still does not exist on the frame.

The first change didn't work because you aren't actually changing anything.
"GameTooltipTemplate"
BackdropTemplateMixin and "GameTooltipTemplate"
These two lines do the exact same thing, passing just the GameTooltipTemplate string. The only difference is that the second one checks for the existence of BackdropTemplateMixin table before passing the GameTooltipTemplate string.

The second line is Lua's basic form of a ternary operator. Logically, it acts like this:

Lua Code:
  1. function()
  2.     if BackdropTemplateMixin ~= nil and BackdropTemplateMixin ~= false then
  3.         return "GameTooltipTemplate"
  4.     else
  5.         return false
  6.     end
  7. end

So if BackdropTemplateMixin didn't exist, the created frame won't even get the GameTooltipTemplate string, just a false in that argument.

Use either of these two options:

Lua Code:
  1. local itip = CreateFrame("GameTooltip", "MPInnerTip", nil, "GameTooltipTemplate,BackdropTemplate") do
  2.     itip:SetBackdrop(nil)

Lua Code:
  1. local itip = CreateFrame("GameTooltip", "MPInnerTip", nil, "GameTooltipTemplate") do
  2.     if not itip.SetBackdrop then
  3.         Mixin(itip, BackdropTemplateMixin)
  4.     end
  5.     itip:SetBackdrop(nil)

You can also try just removing that SetBackdrop line entirely. I'm not too familiar with Backdrops, but these Backdrop errors you may be finding in searches since the release of Shadowlands were due to that template no longer included in every frame creation. If there's no Backdrop template, there should be no Backdrop to set to nil.

Last edited by Kanegasi : 03-10-22 at 09:49 PM.
  Reply With Quote