Advertisement
Guest User

Untitled

a guest
May 6th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. ["Setting"] = {
  2. ["track"] = "Water Shield",
  3. ["duration"] = {
  4. ["minimum"] = {
  5. ["enabled"] = 1,
  6. ["value"] = 50,
  7. },
  8. ["maximum"] = {
  9. },
  10. },
  11. ["stack"] = {
  12. ["minimum"] = {
  13. },
  14. ["maximum"] = {
  15. ["enabled"] = 1,
  16. ["value"] = 2,
  17. },
  18. },
  19. }
  20.  
  21. function loadSettings()
  22. local options = { 'duration', 'stack' }
  23. for i=1, #options do
  24. local option = options[i]
  25.  
  26. if not db[option] then
  27. db[option] = { minimum = {}, maximum = {} }
  28. end
  29.  
  30. local enabled
  31. local value
  32.  
  33. enabled = db[option].minimum.enabled
  34. if (enabled) then _G["min"..option].cbutton:SetChecked(1) else _G["min"..option].cbutton:SetChecked(0) end
  35. value = db[option].minimum.value
  36. if (value) then _G["min"..option].ebox:SetText(value) else _G["min"..option].ebox:SetText("0") end
  37.  
  38. enabled = db[option].maximum.enabled
  39. if (enabled) then _G["max"..option].cbutton:SetChecked(1) else _G["max"..option].cbutton:SetChecked(0) end
  40. value = db[option].maximum.value
  41. if (value) then _G["max"..option].ebox:SetText(value) else _G["max"..option].ebox:SetText("0") end
  42.  
  43.  
  44. end
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement