1. Hi all, long time reader & first time poster. :)

    I use an addon called Mappy that provides, among other features, a way to set the alpha value of the minimap. This feature works great in most cases, but there are a few where setting the alpha (to less than one) causes the entire mimimap to go black. The addon prevents the user from doing this by forcing the alpha to 1 in these cases.

    However there are a few cases where alpha < 1 works but the addon doesn't think it will. I'm trying to modify the addon to fix these cases.

    The addon uses this logic:

    local vMinimapIsInteriorMode = IsInInstance() or IsIndoors() or IsResting()
    

    By using IsResting() the addon doesn't use the alpha setting anywhere inside a city, such as org, where a custom alpha value seems to work fine. On the other hand, taking out IsResting() would break things since IsIndoors() (apparently) really means "can't mount here" and so IsIndoors() is false for places like Org's cleft of shadow where you can mount, but the alpha setting doesn't work there.

    I've never looked at this before so maybe this is stuff that changed in cata?

    Anyway is there a good way to detect this case? On a "real" programming platform with a closed API you might write a hack that tries the compositing and falls back if it fails by looking at the result of the compositing operation, typically even without drawing anything on screen. But I don't know much about addons and lua for that matter so I have no clue what the right approach is.

    Thanks.

    -phil

  2. Nope, none of that should have changed. I'm not entirely sure of your question however, is it about the API calls you list here, or something about the minimap and being able to set the alpha on it? If you can give me an idea of what doesn't work.. I'll see if I can answer your question.

  3. Sorry I'll try to clear things up.

    Under some conditions, setting the alpha value to anything < 1 on the minimap window causes the contents of the window to be drawn in all black.

    What I'd like to do is detect these conditions so I can change the alpha value to 1. This will disable the alpha effect for the minimap but it will allow the contents to be shown instead of being entirely black.

    I'm pretty sure the code that does this is typical, it just calls:

    Minimap:SetAlpha(alphaValue)
    

    I think I found part of the answer to my problem. I'm running WoW under MacOS most of the time, and according to the wowwiki API page:

    Minimap

    See Minimap object information for details

    Note: Tracking dots malfunction if you have multiple instances of this widget that are different sizes/zooms.

    Note: (Mac OS X only) Modifying the Minimap opacity via SetAlpha() will make it turn black indoors.

    So if you don't run on MacOS I guess this isn't a problem for you. I would still like to figure out how to fix this on MacOS though. In other words, detect when SetAlpha() is going to fail by making the window entirely black and use an alpha value of 1.0 instead.

  4. Sorry I'll try to clear things up.

    Under some conditions, setting the alpha value to anything < 1 on the minimap window causes the contents of the window to be drawn in all black.

    What I'd like to do is detect these conditions so I can change the alpha value to 1. This will disable the alpha effect for the minimap but it will allow the contents to be shown instead of being entirely black.

    I'm pretty sure the code that does this is typical, it just calls:

    Minimap:SetAlpha(alphaValue)
    

    I think I found part of the answer to my problem. I'm running WoW under MacOS most of the time, and according to the wowwiki API page:

    Minimap

    See Minimap object information for details

    Note: Tracking dots malfunction if you have multiple instances of this widget that are different sizes/zooms.

    Note: (Mac OS X only) Modifying the Minimap opacity via SetAlpha() will make it turn black indoors.

    So if you don't run on MacOS I guess this isn't a problem for you. I would still like to figure out how to fix this on MacOS though. In other words, detect when SetAlpha() is going to fail by making the window entirely black and use an alpha value of 1.0 instead.

    Ah, then you just need to determine what these conditionals you need are.. and write a simple function/set of calls that makes this work. Is what you have now not working?

  5. Ah, then you just need to determine what these conditionals you need are.. and write a simple function/set of calls that makes this work. Is what you have now not working?

    Yes, as I said above, the conditionals currently being used are:

    local vMinimapIsInteriorMode = IsInInstance() or IsIndoors() or IsResting()
    

    My guess is that this is going to be one of those things that there's no good general way to do. So maybe a fallback is to build a list of zones that are known to be OK for alpha < 1 and use the list to check for exceptions.

  6. That's not a great way.. do you have an example of a zone that doesn't work? Run /dump on each of those API functions when you're in that zone and report what they return.

  7. That's not a great way.. do you have an example of a zone that doesn't work? Run /dump on each of those API functions when you're in that zone and report what they return.

    As I said in the first post, one failure is in Org where IsResting() is true but using alpha < 1 works. But getting rid of IsResting() breaks if you go into the Cleft of Shadow, using alpha < 1 there doesn't work. And you might think IsIndoors() would be helpful but it isn't since it's just IsMountDisabled() which return false inside the cleft, since mounts aren't disabled there.

    I just quickly tested instances out and using alpha < 1 still doesn't work there, so the IsInInstances() still seems like a good test to include. Although there are some instances where you can mount, not sure if the alpha setting would work there or not.

  8. That's not a great way.. do you have an example of a zone that doesn't work? Run /dump on each of those API functions when you're in that zone and report what they return.

    As I said in the first post, one failure is in Org where IsResting() is true but using alpha < 1 works. But getting rid of IsResting() breaks if you go into the Cleft of Shadow, using alpha < 1 there doesn't work. And you might think IsIndoors() would be helpful but it isn't since it's just IsMountDisabled() which return false inside the cleft, since mounts aren't disabled there.

    I just quickly tested instances out and using alpha < 1 still doesn't work there, so the IsInInstances() still seems like a good test to include. Although there are some instances where you can mount, not sure if the alpha setting would work there or not.

    Well what you have right now is a logical or, and that doesn't seem to be sufficient. You can make the check more or as complicated using conditionals. In short, I don't have the magic code you need, because I don't have a list of all of the zones and what is and what isn't allowed in each of them (and when the minimap doesn't allow this).

    But you've got the API, and you can make conditionals as complicated as you need them to be. I dont know which function will help you identify the cleft of shadows if its considered resting and you can mount.

  9. While this won't fix your problem, it might provide a way to turn off the alpha setting in the addon options if the client is a Mac.

    IsMacClient() If you do find a workaround or fix for the code, that would be better, of course.

  10. Thanks for the suggestions, not sure how it will end up but if I come up with some interesting I'll post back here.