View Single Post
03/03/21, 02:59 AM   #19
Gabriel_H
 
Gabriel_H's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2021
Posts: 11
I was feeling a little guilty about creating work for you, so I wanted to say thanks the best way I could.

I was thinking about the slot options, and the likelihood of it causing problems. I took some code I have been working on and played around a bit. Basically it starts with a table (choiceConflicts) that stores the skillId and puts it against the raw name and any skillId's that you want to flag as "conflicting".

That allows for a function which I have called choiceConflict to be set that takes the starting choice tables (by number and text) and returns new tables (by number and text) excluding the conflicts. I have put that function instead of the tables listed against choices and choicesValues for each of the dropdowns.

So for example, Gifted Rider is set to slot 1, which means that the dropdown list for War Mount won't include slot 1 - thereby making conflict between them impossible. If you change Gifted Rider to slot 3, then War Mount dropdown will restore slot 1 to its list but remove slot 3.

LAM is a great library, but one of the things it doesn't do is refresh the dropdown lists if you play around with them like I have above. So there is a second function called refreshConflict, that fires on the setFunc parameter after the original save variable function has done it's thing. The purpose of the second function is to rebuild the dropdown list for the ones that conflict with the value you just changed.

I have attached the menu.lua I have been playing with.

Feel free to use it, ignore it, change it, whatever you want to do with it.

Thanks,
Gab
Attached Files
File Type: zip Menu.zip (5.8 KB, 1316 views)