WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Is live update of Tag element not available? (https://www.wowinterface.com/forums/showthread.php?t=56628)

Lyak 09-01-18 09:54 PM

Is live update of Tag element not available?
 
Hi all,

I'm currently trying to create a configuration UI with AceConfig-3.0 and attempted to add a tag element option to it.

Lua Code:
  1. local options = {
  2.     type = "group",
  3.     childGroups = "tab",
  4.     name = "Test",
  5.     arg = "Test",
  6.     args = {
  7.         tag = {
  8.             order = 1,
  9.             type = "input",
  10.             name = "Tag",
  11.             width = "double",
  12.             get = function()
  13.                 return config.text.tag
  14.             end,
  15.             set = function(_, value)
  16.                 myPlayerFrame:Untag(myPlayerFrame.healthText)
  17.                 myPlayerFrame:Tag(myPlayerFrame.healthText, value)
  18.  
  19.                 -- DEBUG
  20.                 print(myPlayerFrame:GetName(), myPlayerFrame.healthText:GetName(), value)
  21.  
  22.                 config.text.tag = value
  23.             end,
  24.         },
  25.     },
  26. }

Well... the debugging works perfectly fine and it saves a new tag value into the SV. However, it doesn't seem to update the tag even if I press the 'okay' button until I reload the UI :confused:

So, I was just wondering if the live update of tag element is not available or not.

Thank you in advance!

Rainrider 09-03-18 12:02 AM

You need to update the tag in your set function:
Code:

myPlayerFrame:Untag(myPlayerFrame.healthText)
myPlayerFrame:Tag(myPlayerFrame.healthText, value)
myPlayerFrame.healthText:UpdateTag()


Lyak 09-03-18 12:30 AM

Quote:

Originally Posted by Rainrider (Post 329970)
You need to update the tag in your set function:
Code:

myPlayerFrame:Untag(myPlayerFrame.healthText)
myPlayerFrame:Tag(myPlayerFrame.healthText, value)
myPlayerFrame.healthText:UpdateTag()


NICE!!!!!!!!!!!!!!!!!!!

It just worked like a charm :banana:

I really appreciate your help, Rainrider!


All times are GMT -6. The time now is 07:38 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI