-
March 5th, 2022, 16:43 #1
Trying to understand token widget behavior
Hi,
Not sure if this is the prpoer forum for this question - I'm trying to modify the token health bar display via an extension and I am seeing a behavior I don't understand. I have created a second white colored health bar widget that will be displayed under the normal percentage health bar, to show the original 100% full bar length. The following code visually does it, but the hover text describing the wound level no longer appears.
Code:if bAddBar then local widgetHealthBar = aWidgets["healthbar"]; if not widgetHealthBar then widgetHealthBar = tokenCT.addBitmapWidget("healthbar"); widgetHealthBar.bringToFront(); widgetHealthBar.setName("healthbar"); end local widgetHealthBarFrame = aWidgets["healthbarframe"]; if not widgetHealthBarFrame then widgetHealthBarFrame = tokenCT.addBitmapWidget("healthbar"); widgetHealthBarFrame.sendToBack(); widgetHealthBarFrame.setName("healthbarframe"); end if widgetHealthBar then widgetHealthBar.bringToFront(); widgetHealthBar.setColor(sColor); widgetHealthBar.setTooltipText(sStatus); widgetHealthBar.setVisible(sOptTH == "bar"); updateHealthBarScale(tokenCT, nodeCT, nPercentWounded); end if widgetHealthBarFrame then widgetHealthBarFrame.sendToBack(); widgetHealthBarFrame.setVisible(sOptTH == "bar"); end end
Screen Shot 2022-03-05 at 11.31.38 AM.png
Thank you for any clarification on what I am doing wrong.
Cheers,
Brian
-
March 5th, 2022, 16:51 #2
I think this post from 2018 answers my question: https://www.fantasygrounds.com/forum...l=1#post415306
I assume this applies to FGU as well - i.e. the lowest in the stack (first) generates the hover text.
Sorry, I should have tried searching longer before posting my question.
[EDIT] Hmmm... but this sentence from that post makes me think it was going to change to be top-most: " It should probably be the other way around (i.e. topmost widget), so I'll get that updated for v3.3.7." Anyone know if there was a reason it didn't - or is FGU different from FGC in this regard? Or am I doing something wrong in my implementation?
Cheers,
BrianLast edited by MostTornBrain; March 5th, 2022 at 16:55.
-
March 5th, 2022, 17:54 #3
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,654
I'm not sure without digging into the code; but it's not something currently on our list to dig into or investigate at this point. So, I would work around the behavior for now; perhaps add the health status to both widgets?
Regards,
JPG
-
March 5th, 2022, 18:00 #4
-
March 6th, 2022, 00:13 #5
The Workshop would be the proper place to find out why your extension isn't working like expected.
https://www.fantasygrounds.com/forum...2-The-WorkshopPaul Grosse
PCGen BoD
PR Silverback
Autobackup Batch file, Always ALWAYS backup your data. Remember to follow the 3-2-1 rule!
-
March 6th, 2022, 01:47 #6
Thanks - I'll post these type of Lua/API nuance questions in the Workshop from now on. I originally misunderstood the focus of that forum and thought it was only for people making new rulesets.
I'm still fairly new to all that is FG and often find myself lost in the wrong forum. :-)
Cheers,
Brian
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks