Advertisement
j311yf1sh

Untitled

Jan 29th, 2014
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. function Util:CreateCheck(Name,ID)
  2. local Ingredient = CraftIDToProfessionInfo:spellIDToIngredients(ID)
  3. local DName = CraftIDToProfessionInfo:spellIDToName(ID)
  4. local Check
  5.  
  6. TSM:CoolDownTimes(ID) -- Refresh DB for ID
  7.  
  8. if (DName and Ingredient) then
  9. Check = {
  10. type = "CheckBox",
  11. value = TSM.db.factionrealm["CoolDowns"][ID]["Enabled"],
  12. label = DName.." "..Ingredient..TSM.cdTime,
  13. fullWidth = false,
  14. callback = function()
  15. if TSM.db.factionrealm["CoolDowns"][ID]["Enabled"] == false then
  16. TSM.db.factionrealm["CoolDowns"][ID]["Enabled"] = true
  17. elseif TSM.db.factionrealm["CoolDowns"][ID]["Enabled"] == true then
  18. TSM.db.factionrealm["CoolDowns"][ID]["Enabled"] = false
  19. end
  20. end
  21. }
  22. else
  23. Ingredient = "|cff44bbccID "..ID.." |r"
  24. --print("|cffffcc00TSM_CoolDowns:|r Spell ID#"..ID.." Not found or returned nil, please report to the addon author that "..ID.." was not found")
  25. Check = {
  26. type = "CheckBox",
  27. value = TSM.db.factionrealm["CoolDowns"][ID]["Enabled"],
  28. label = Name.." "..Ingredient..TSM.cdTime,
  29. tooltip = "Please report this Spell ID to the addon author.",
  30. fullWidth = false,
  31. callback = function()
  32. if TSM.db.factionrealm["CoolDowns"][ID]["Enabled"] == false then
  33. TSM.db.factionrealm["CoolDowns"][ID]["Enabled"] = true
  34. elseif TSM.db.factionrealm["CoolDowns"][ID]["Enabled"] == true then
  35. TSM.db.factionrealm["CoolDowns"][ID]["Enabled"] = false
  36. end
  37. end
  38. }
  39. end
  40. return Check
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement