Form for choosing settings
I've created a form to choose the settings. These settings are automatically saved from the client in this form:
Lua Code:
I created this function to save the data, when the form is closed or the apply button is clicked: Lua Code:
Where • db = The "Setting" table • SetChecked(enable) = True to check the button; false to uncheck (boolean) • SetText("text") = Text to be placed in the edit box (string) Could you help me to make the code less repetitive and more clean and elegant? Expecially from 13 to 22 line, I wish to make this lines more DRY (Don't Repeat Yourself) |
First thing: You should NEVER put such generic names into the global namespace (_G).
Prefix them with your AddOn-Name at least if its really required that you make them global. Lua Code:
If you add more of those lines I'd put it in a function Lua Code:
|
All times are GMT -6. The time now is 08:19 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI