AceConfig: item type "execute" - image not updated after profile change #429


Closed
  • Backup created this issue Nov 11, 2017

    I'm using the item type execute to show an preview image in the ThreatPlates options dialog. Whenever the profile is changed and, therefore, the path to the image changes (it's based on a configuration setting, db.targetWidget.theme, see below), the image is not updated. It still shows the image based on the value of the previous profile.

     

    Here's the code:

    Preview = {
    name = L["Preview"],
    order = 10,
    type = "execute",
    image = "Interface\\AddOns\\TidyPlates_ThreatPlates\\Widgets\\TargetArtWidget\\" .. db.targetWidget.theme,
    imageWidth = 128,
    imageHeight = 32,
    },

    Is that something that's not supported and I have to write custom code to achieve an image update or is it a bug?

  • Backup posted a comment Nov 11, 2017

    A workaround for me right now is to update the image attribute directly in the callback function for "OnProfileChanged".

  • nevcairiel closed issue Feb 23, 2018
  • nevcairiel posted a comment Feb 23, 2018

    If you do it this way, the image is only ever constructed once on load. You would have to wrap it into a function to get dynamic generation.

     

    Maybe something like this:

    image = function() return "Interface\\AddOns\\TidyPlates_ThreatPlates\\Widgets\\TargetArtWidget\\" .. db.targetWidget.theme end,

  • Backup posted a comment Feb 24, 2018

    Ok, I'll try that. Thanks for the response.


To post a comment, please login or register a new account.