View Single Post
10/21/16, 02:17 AM   #1
Werewolf Finds Dragon
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 17
Any way to get the addon object that called a library function?

Okay, a lot of anxiety, here. I have so much social anxiety that it's not even funny so asking like this is hard. Usually I prefer figuring out my own problems, but I think I've come up against something that isn't actually possible.

So, what I've asked in the topic, or perhaps whether there's any way the two can communicate in any meaningful way? I'm guessing that the answer is no, since LibStub is a method of pointers rather than using unpack to replicate the library objects, and I completely understand why. I figured I'd ask though just in case there's any cleverness I hadn't considered.

Of course, I can't use self, since myAddon.libraryObject:libraryFunction() for example just returns libraryFunction as the only parent since it's only pointing at that. I don't believe there'd be any way to get any kind of inheritance there without passing the actual addon object through the function, which is what I'm trying to avoid. I have a function I'd like to use regularly, but without having to pass the addon object through every time.

So, is this possible? Or is this something I should give up on?
  Reply With Quote