View Single Post
11-08-21, 09:02 AM   #3
fullmoon_sulfuras
A Fallenroot Satyr
Join Date: Dec 2019
Posts: 21
Thanks for the suggestion!

Indeed, the code below works:

Lua Code:
  1. if not GameTooltip.GetBackdrop then
  2.     print("No GetBackdrop")
  3.     Mixin(GameTooltip, BackdropTemplateMixin)
  4. else
  5.     print("GetBackdrop")
  6. end


The Mixin call doesn't really fix the problem, because now I don't get an error for calling a function the doesn't exist (attempt to call method 'GetBackdrop' (a nil value)), but GetBackdrop returns nil on the Retail client (works fine on BCC and Classic)

What I'm curious now is:

1. My understanding is that GameTooltip is a global object created by the API itself. Is this correct?
2. What is the proper fix for my original problem (attempt to call method 'GetBackdrop' (a nil value)), or the second (GetBackdrop returning nil after the Mixin call)?
3. This used to work on 90100. Why is it broken now?
4. The double-colon syntax denotes a class, while the period denotes an object, right (I come from C++)? My understanding is that in Lua they're the same thing as Lua is prototype-based. Why do I have to use a different syntax in the test and in the call?

Thanks!!!

Last edited by fullmoon_sulfuras : 11-08-21 at 09:24 AM.
  Reply With Quote