Advertisement
j311yf1sh

thismorning change

Jan 27th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.20 KB | None | 0 0
  1. local TSM = select(2, ...)
  2. local CraftIDToProfessionInfo = LibStub("CraftIDToProfessionInfo")
  3. local Util = TSM:GetModule("Util")
  4. local Options = TSM:NewModule("Options")
  5. local AceGUI = LibStub("AceGUI-3.0")
  6.  
  7. TSM.PageParent = nil
  8.  
  9. function Options:Load(parent)
  10.     TSM.PageParent = parent
  11.    
  12.     local TailoringChildren = {}
  13.     local EnchantingChildren = {}
  14.     local EngineeringChildren = {}
  15.     local BlacksmithingChildren = {}
  16.     local JewelCraftingChildren = {}
  17.     local AlchemyChildren = {}
  18.     local InscriptionChildren = {}
  19.     local LeatherworkingChildren = {}
  20.    
  21.    
  22.     local Checks = {
  23.             {
  24.             type = "InlineGroup",
  25.             layout="flow",
  26.             children =  {
  27.                 {
  28.                 type = "Button",
  29.                 text = "Add items to Queue",
  30.                 fullWidth = true,
  31.                 callback = function() Util:QueueItems() end,
  32.                 },
  33.                 {
  34.                 type = "Button",
  35.                 text = "Remove items from Queue",
  36.                 fullWidth = true,
  37.                 callback = function() Util:UnQueueItems() end,
  38.                 },
  39.                 {
  40.                 type = "Button",
  41.                 text = "Enable All",
  42.                 fullWidth = true,
  43.                 callback = function() Util:EnableAll() end,
  44.                 },
  45.                 {
  46.                 type = "Button",
  47.                 text = "Disable All",
  48.                 fullWidth = true,
  49.                 callback = function() Util:DisableAll() end,
  50.                 },
  51.                 {
  52.                 type = "Button",
  53.                 text = "AutoQueue is "..TSM.AutoQueue,
  54.                 tooltip = "Enable / Disable auto queue of professions when ever they are off CD",
  55.                 fullWidth = true,
  56.                 callback = function() TSM:AutoQueueStatus() end,
  57.                 },
  58.             },
  59.         },
  60.         {
  61.         type = "InlineGroup",
  62.         layout="flow",
  63.         title = "Enchanting",
  64.         children =  EnchantingChildren,
  65.         },
  66.         {
  67.         type = "InlineGroup",
  68.         layout="flow",
  69.         title = "Engineering",
  70.         children =  EngineeringChildren,
  71.         },
  72.         {
  73.         type = "InlineGroup",
  74.         layout="flow",
  75.         title = "Tailoring",
  76.         children =  TailoringChildren,
  77.         },
  78.         {
  79.         type = "InlineGroup",
  80.         layout="flow",
  81.         title = "Blacksmithing",
  82.         children =  BlacksmithingChildren,
  83.         },
  84.         {
  85.         type = "InlineGroup",
  86.         layout="flow",
  87.         title = "JewelCrafting",
  88.         children =  JewelCraftingChildren,
  89.         },{
  90.         type = "InlineGroup",
  91.         layout="flow",
  92.         title = "Alchemy (All Share the same CD)",
  93.         children =  AlchemyChildren,
  94.         },
  95.         {
  96.         type = "InlineGroup",
  97.         layout="flow",
  98.         title = "Inscription",
  99.         children =  InscriptionChildren,
  100.         },
  101.         {
  102.         type = "InlineGroup",
  103.         layout="flow",
  104.         title = "Leatherworking",
  105.         children =  LeatherworkingChildren,
  106.         },
  107.     }
  108.  
  109.     for ID,Name in pairs(TSM.CraftCDs) do -- Loop through CD's and create check boxes
  110.         if CraftIDToProfessionInfo:spellIDToProfession(ID) then
  111.             if CraftIDToProfessionInfo:spellIDToProfession(ID) == "Tailoring" then
  112.                 local Check = Util:CreateCheck(Name,ID)
  113.                 tinsert(TailoringChildren, Check)
  114.             elseif CraftIDToProfessionInfo:spellIDToProfession(ID) == "Enchanting" then
  115.                 local Check = Util:CreateCheck(Name,ID)
  116.                 tinsert(EnchantingChildren, Check)
  117.             elseif CraftIDToProfessionInfo:spellIDToProfession(ID) == "Engineering" then
  118.                 local Check = Util:CreateCheck(Name,ID)
  119.                 tinsert(EngineeringChildren, Check)
  120.             elseif CraftIDToProfessionInfo:spellIDToProfession(ID) == "Blacksmithing" then
  121.                 local Check = Util:CreateCheck(Name,ID)
  122.                 tinsert(BlacksmithingChildren, Check)
  123.             elseif CraftIDToProfessionInfo:spellIDToProfession(ID) == "JewelCrafting" then
  124.                 local Check = Util:CreateCheck(Name,ID)
  125.                 tinsert(JewelCraftingChildren, Check)
  126.             elseif CraftIDToProfessionInfo:spellIDToProfession(ID) == "Alchemy" then
  127.                 local Check = Util:CreateCheck(Name,ID)
  128.                 tinsert(AlchemyChildren, Check)
  129.             elseif CraftIDToProfessionInfo:spellIDToProfession(ID) == "Inscription" then
  130.                 local Check = Util:CreateCheck(Name,ID)
  131.                 tinsert(InscriptionChildren, Check)
  132.             elseif CraftIDToProfessionInfo:spellIDToProfession(ID) == "Leatherworking" then
  133.                 local Check = Util:CreateCheck(Name,ID)
  134.                 tinsert(LeatherworkingChildren, Check)
  135.             else
  136.                 local Check = Util:CreateCheck(Name,ID)
  137.                 tinsert(Checks, Check)
  138.             end
  139.         else
  140.        
  141.         end
  142.     end
  143.  
  144.        
  145.     local page = {
  146.         {
  147.             type="ScrollFrame",
  148.             layout="list",
  149.             children=
  150.             {
  151.                 {
  152.                 type = "InlineGroup",
  153.                 layout="flow",
  154.                 title="TradeSkillMaster CoolDowns Options etc",
  155.                 children = Checks,
  156.             },
  157.         },
  158.     },
  159. }
  160.    
  161.     TSMAPI:BuildPage(parent,page)
  162. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement