Cleanup Options Menus
Twintop opened this issue ยท 6 comments
Options menus are boated with a lot of code that should be refactored in to generic functions for a whole host of reasons. Clean this mess up sooner rather than later.
- Function variables that are static/the same across all functions (e.g.
xPadding2
) - Color picker
SetScript
- Bar Position and Size
- Combo Points Position and Size
- Bar Textures
- Bar visibility toggles
- Threshold lines for healers/potions
- Threshold line visibility/position options
- Potion on Cooldown Configuration
- Font Face
- Font Size and Colors
[ ] Decimal Precision (maybe not totally possible)- EditBox value min/max validation
[ ]UIDropDownMenu_Initialize
for LSM dropdowns
PriestOptions (with 2 spec modules) is done for color pickers. This lowered the size of the file from 304kb / 6030 sloc to 249kb / 5206 sloc, a reduction of 18.09% / 13.67%. If this size trend holds across all options menus, the overall size of the addon should drop by ~429kb.
Identified lots more areas for cleanup. Between the changes already made, uncompressed LUA source is down to 3.34MB from 3.97MB in 9.2.5.2-release.
Calling this done. There's more that can be done (obviously) but this gets a good handle on the options menu. More changes will come as a result of 10.0 development.