Senior Member
Join Date: Feb 2017
Posts: 119
|
Ok, I have it hiding now using the following at Post-Attributes/10000:
Code:
~ Get a count of how many selection options there are var SelOptions as number SelOptions = 0 foreach pick in hero from Ability where "Helper.ShowSpec & (abCategory.RogDebInj|abCategory.RogSnAtt)" SelOptions += 1 nexteach If (SelOptions > 0) Then perform assign[User.Activation] perform assign[Helper.ShowSpec] Else perform delete[User.Activation] perform delete[Helper.ShowSpec] EndIf The only issue I have run into is if you select something, then later that something is no longer a valid selection, it stays selected until you select something else. Example: I leveled up to 4 the selected one of the Debilitating Injuries. Then removed level 4 (downgraded to 3) which hide the selection box. Then I added the rogue talent Bleeding Attack. This unhid the ability selector, but it still had Debilitating Injury selected even though that isn't in the list now. Hmmm... maybe need a function to check if field[usrChosen1].chosen is in the list and if not reset the selection. I tried: Code:
perform field[usrChosen1].reset |
#11 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
I avoid foreach loops unless I have no choice. Too much CPU.
The other issue you see is just how HL UI works. If you have selected something and then remove the Pick the selection stays. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#12 |
Senior Member
Join Date: Feb 2017
Posts: 119
|
Yeah, the foreach was just the way I could figure out how to do it. I'm open to better ways if you can point me in the right direction.
You mentioned the issue with HL UI selecting picks, is there anything that can be done about that? Realistically speaking, the case shouldn't happen often since one typically won't delevel or remove a rogue talent once chosen... but the OCD programmer side of me likes to button up all the possibilities. |
#13 |
|
|